Overview
The Orchestrator is an advanced task execution system that goes beyond the build mode. It decomposes complex tasks into a DAG (Directed Acyclic Graph) of subtasks, creates isolated git worktrees for each, runs verification pipelines, and escalates models on failure.
Harness required
The orchestrator works with opencode (recommended), Claude Code, Codex CLI, Gemini CLI, Copilot CLI, Goose, OpenHands, or Cline. It needs a harness that can run shell commands, access the file system, and execute git operations. Headless mode (--self) and Aider do not support orchestrator worktrees. See docs/harness-headless.md for the full harness comparison.
| Feature | Build Mode | Orchestrator |
|---|---|---|
| Task decomposition | LLM plans linear queue | LLM plans DAG with dependencies |
| Isolation | Works in linked folder | Git worktrees per task |
| Verification | None | Build / test / lint / git-diff + optional agent review |
| Model escalation | None | User-configurable tiers (any catalog model) |
| Retry logic | None | Up to maxAttempts with rollback |
| Review loop | None | Optional verification agent (LLM review of diff) |
Using the Orchestrator from the UI
The orchestrator is accessible from the Orchestrator tab in any project. There are two ways to create orchestrator tasks:
Method 1: Create a new orchestrator task
- 1Open your project and click the Orchestrator tab.
- 2Click New task in the top-right corner.
- 3Fill in the form: Title (required), Description (optional), Preferred model (optional), Escalation tiers, Escalation policy, Max attempts, Verification agent, Verification steps.
- 4Click Create task — the planner breaks it down and queues the steps.
Method 2: Hand a build task to the orchestrator
- 1Create tasks with readyForDev: true in the Build tab (or via --draft).
- 2Go to the Orchestrator tab — ready-for-dev tasks appear in the Build queue section.
- 3Click Run via orchestrator next to any task.
- 4The planner decomposes the task and queues the steps.
When to use the orchestrator vs build mode
Use build mode for simple linear task queues. Use the orchestrator for complex tasks that benefit from DAG decomposition, verification pipelines, and automatic model escalation on failure.
Creating a task — form fields
| Field | Required | Description |
|---|---|---|
| Title | Yes | A clear goal for the orchestrator (e.g. 'Implement prescription refill API') |
| Description | No | Detailed goal description for better decomposition |
| Preferred model | No | Starting model (e.g. opencode-go:mimo-v2.5). Escalates on failure if policy allows. |
| Escalation tiers | No | Ordered list of provider:model ids — tier 0 = first try, each failure escalates to the next. Any catalog model. Empty = built-in ladder. |
| Escalation policy | No | Escalate (after 2 failures), Aggressive (after 1), Fixed/None (never). Default: Escalate. |
| Max attempts | No | How many times to retry with escalating models. Default: 3. |
| Verification agent | No | Agent that LLM-reviews the worktree diff after scripted steps. A rejected review triggers retry/escalation. |
| Verification steps | No | Override the default pipeline (build, test, lint, git_diff, review). Include 'review' to run the agent. |
Viewing task details
Click any orchestrator task in the list to open its detail view. The detail panel shows:
- Current status and integration branch (e.g. ai/batch-abc123)
- Attempt count vs max attempts
- Escalation path (the ordered list of models tier 0→N)
- Verification agent and steps configured for the run
- All subtasks created by the planner (with their individual statuses)
- Verification results for each attempt (build, test, lint, git-diff, review with hover feedback)
- Cancel and Retry buttons for failed tasks
Task lifecycle
An orchestrator task goes through these states:
| Status | Description |
|---|---|
| pending | Created, waiting for decomposition |
| queued | Decomposed, waiting for agent capacity |
| running | Agent is working on the task |
| verifying | Verification pipeline running |
| merging | Committing and merging to integration branch |
| question_pending | Agent asked a human question — waiting for answer |
| completed | All verification passed, work merged |
| failed | All attempts exhausted |
| cancelled | Cancelled by user |
| blocked | Waiting for dependency to complete |
Verification pipeline
After an agent completes work, the orchestrator runs a verification pipeline in the worktree:
- 1Build: npm run build — must exit 0
- 2Test: npm test — must exit 0
- 3Lint: npx eslint . — must exit 0
- 4Git diff: git diff —stat — shows what changed
- 5Agent review (optional): verification agent LLM-reviews the worktree diff — a rejected review fails verification
Fail fast
If any verification step fails, the pipeline stops immediately and the task is retried with a potentially more capable model.
Model escalation
When verification fails, the orchestrator can escalate to a more capable model. You can configure the exact escalation path per run or set agent-level defaults.
Default escalation tiers
When no custom tiers are set, the built-in 4-tier ladder is used:
| Tier | Model | Capability |
|---|---|---|
| 1 | opencode-go:mimo-v2.5 | Fast, lightweight |
| 2 | opencode-go:deepseek-v4-flash | Balanced |
| 3 | deepseek:deepseek-chat | Strong reasoning |
| 4 | openrouter:anthropic/claude-sonnet-4.5 | Most capable |
Custom escalation path
Set any ordered list of provider:model ids in the Escalation tiers field. Any model from the curated catalog is selectable (see Agent Models docs). Each failure escalates to the next tier.
Policies
Escalation policies: Fixed/None (never escalate), Escalate (after 2 consecutive failures), Aggressive (after 1 failure). Default: Escalate.
Per-agent defaults
Set default flow settings on any agent via the Edit dialog's 'Orchestrator flow defaults' section. These apply to every run the agent handles unless overridden at run time.
Git worktrees
Each orchestrator task gets its own git worktree — an isolated working copy on a dedicated branch. This prevents conflicts between parallel tasks.
- Worktrees are created at ~/.teamshare-worktrees/task-<id>/.
- Each worktree has its own branch (task/<task-id>).
- After verification, the branch merges into the integration branch (ai/batch-<timestamp>).
- Worktrees are cleaned up after merge.
API access
You can also create orchestrator tasks via the REST API. This is useful for automation and scripting.
curl -X POST https://api.teamshare.name.ng/orchestrator/tasks \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer <jwt>' \
-d '{
"projectId": "<project-id>",
"title": "Build a Next.js landing page",
"description": "Create a responsive landing page with hero, features, pricing, and contact form",
"preferredModel": "opencode-go:mimo-v2.5",
"escalationPolicy": "escalate",
"maxAttempts": 4,
"escalationTiers": ["opencode-go:mimo-v2.5", "deepseek:deepseek-chat", "openrouter:anthropic/claude-sonnet-4.5"],
"verificationAgentId": null,
"verificationSteps": ["build", "test", "lint", "git_diff"]
}'