Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/Emanuele-web04/synara/llms.txt

Use this file to discover all available pages before exploring further.

Synara treats Git as a first-class part of the agent workflow, not an afterthought. Every thread can live on its own branch, every agent turn that writes files generates a diff you can inspect, and you can commit, push, and open a pull request without ever leaving the app. This page explains how Git integrates with threads and what operations are available.

Git worktrees: isolated branch checkouts per thread

When you create a thread with envMode: "worktree", Synara calls git worktree add to create a separate directory on disk for that thread’s branch. Each worktree is a full working copy of the repository pinned to a specific branch. Multiple worktrees from the same repo coexist without interfering — the agent in one worktree can commit freely while another agent on a different branch does the same.
// From git.ts — worktree creation input
export const GitCreateWorktreeInput = Schema.Struct({
  cwd: TrimmedNonEmptyString,        // project root
  branch: TrimmedNonEmptyString,     // existing branch to check out
  newBranch: Schema.optional(TrimmedNonEmptyString), // create a new branch
  path: Schema.NullOr(TrimmedNonEmptyString),        // worktree path (null = auto)
});
When a thread is closed or archived, Synara can remove the worktree with GitRemoveWorktreeInput:
export const GitRemoveWorktreeInput = Schema.Struct({
  cwd: TrimmedNonEmptyString,
  path: TrimmedNonEmptyString,
  force: Schema.optional(Schema.Boolean),
});
Use force: true only when the worktree has uncommitted changes you are sure you want to discard. In normal cleanup flows Synara will warn if changes would be lost.

Reviewing diffs: per-turn and per-thread

Every time an agent completes a turn that writes files, Synara records a checkpoint with a file-level summary. You can retrieve the exact diff for any single turn or for the entire history of a thread using the getTurnDiff and getFullThreadDiff WebSocket methods.
// From orchestration.ts — WebSocket method names
export const ORCHESTRATION_WS_METHODS = {
  getTurnDiff: "orchestration.getTurnDiff",
  getFullThreadDiff: "orchestration.getFullThreadDiff",
  // ...
} as const;
The inputs describe the range of turns to diff:
export const OrchestrationGetTurnDiffInput = TurnCountRange.mapFields(
  Struct.assign({
    threadId: ThreadId,
    ignoreWhitespace: Schema.optional(Schema.Boolean),
  }),
  { unsafePreserveChecks: true },
);

export const OrchestrationGetFullThreadDiffInput = Schema.Struct({
  threadId: ThreadId,
  toTurnCount: NonNegativeInt,
  ignoreWhitespace: Schema.optional(Schema.Boolean),
});
The built-in diff viewer in the chat panel shows changed files grouped by turn. Each file entry in a checkpoint carries path, kind (the change type), additions, and deletions:
export const OrchestrationCheckpointFile = Schema.Struct({
  path: TrimmedNonEmptyString,
  kind: TrimmedNonEmptyString,
  additions: NonNegativeInt,
  deletions: NonNegativeInt,
});
Diffs attach to individual turns so you can trace exactly what the agent changed in response to each message. If an agent’s output looks wrong, scroll to the turn in question and inspect its checkpoint diff before reverting.

Git operations available in Synara

Synara exposes a stacked Git action system that can run multiple operations in sequence. The available actions are:
export const GitStackedAction = Schema.Literals([
  "commit",
  "push",
  "create_pr",
  "commit_push",
  "commit_push_pr",
]);
You trigger these from the Git panel in the sidebar or from the composer. Each action runs through a defined set of phases:
export const GitActionProgressPhase = Schema.Literals([
  "branch",
  "commit",
  "push",
  "pr",
]);
1

Stage your changes

Select the files you want to include. Synara calls GitStageFilesInput to add paths to the index:
export const GitStageFilesInput = Schema.Struct({
  cwd: TrimmedNonEmptyString,
  paths: Schema.Array(TrimmedNonEmptyString).check(Schema.isMinLength(1)),
});
2

Generate a commit message

Click Generate message. Synara uses the textGenerationModelSelection from your settings to summarize the staged diff into a conventional commit message. The default text-generation model is "gpt-5.4-mini" (the value of DEFAULT_GIT_TEXT_GENERATION_MODEL), but you can change it in Settings under textGenerationModelSelection.
3

Commit and push

Choose commit_push to create the commit and push to the remote in one action, or commit_push_pr to also open a draft pull request.
4

Review the PR

If a PR was created, Synara records the PR metadata in lastKnownPr on the thread so the PR number, title, URL, and base/head branches stay visible in the thread header without leaving the app.

AI-generated commit messages

The GitRunStackedActionInput accepts an optional commitMessage. When you leave it blank, Synara summarizes the diff with the text-generation model configured in settings:
export const GitRunStackedActionInput = Schema.Struct({
  actionId: TrimmedNonEmptyString,
  cwd: TrimmedNonEmptyString,
  action: GitStackedAction,
  commitMessage: Schema.optional(
    TrimmedNonEmptyString.check(Schema.isMaxLength(10_000))
  ),
  featureBranch: Schema.optional(Schema.Boolean),
  filePaths: Schema.optional(
    Schema.Array(TrimmedNonEmptyString).check(Schema.isMinLength(1))
  ),
  textGenerationModel: Schema.optional(TrimmedNonEmptyString),
});
You can also summarize any diff patch directly with GitSummarizeDiffInput to preview what the model would produce before committing.

Working with branches

The branch picker lists all local and remote branches returned by GitListBranchesInput. Each branch entry includes whether it is the current branch, whether it has an active worktree, and whether it is the default branch of the repository:
export const GitBranch = Schema.Struct({
  name: TrimmedNonEmptyString,
  isRemote: Schema.optional(Schema.Boolean),
  remoteName: Schema.optional(TrimmedNonEmptyString),
  current: Schema.Boolean,
  isDefault: Schema.Boolean,
  worktreePath: TrimmedNonEmptyString.pipe(Schema.NullOr),
});
Use GitCreateBranchInput to create a new branch, optionally publishing it to the remote immediately:
export const GitCreateBranchInput = Schema.Struct({
  cwd: TrimmedNonEmptyString,
  branch: TrimmedNonEmptyString,
  publish: Schema.optional(Schema.Boolean),
});

Worktree cleanup after closing a thread

When you delete or archive a thread that used envMode: "worktree", Synara can call git worktree remove via GitRemoveWorktreeInput to free up the disk space. This is called the worktree cleanup step. The force flag controls whether cleanup proceeds even when the worktree has uncommitted changes.
Removing a worktree with force: true permanently discards any uncommitted changes inside that directory. Commit or stash work before removing if you want to keep it.
  • Parallel Agents — running multiple threads across different worktrees
  • Threads and Worktrees — the relationship between threads, branches, and worktrees
  • Settings — configuring textGenerationModelSelection for commit message generation

Build docs developers (and LLMs) love