AI CodeOps

Agent orchestration

Agent orchestration decides which AI agent runs when, with what context, tools, model and limits. What it covers, and how AI CodeOps runs a session's agents.

Agent orchestration is the control layer of a multi-agent system: it decides which agent runs at each point, what context and tools it gets, which model it uses, and what limits apply, then collects the results and decides what happens next.

What it is

An orchestrator handles the work around the model calls:

  • Order. A fixed pipeline, a graph with branches, or a planner agent that picks the next step.
  • Context. What each agent sees: the task, earlier outputs, files from the repository.
  • Tools. Which tools an agent may call, and how many times.
  • Models. Which model each step uses, often a stronger one for planning and review.
  • Limits and checks. Time, tokens, cost, and permission checks before anything with side effects.

Fixed pipelines are predictable and easy to audit. Dynamic orchestration is more flexible but harder to reason about, especially when agents can call tools that change things.

Why it matters

Most failures in agent systems are orchestration failures: an agent missing context, a loop that doesn't stop, a tool call nobody permitted, a bill nobody expected. Orchestration is where you put the guardrails, so it's also what an auditor needs to understand.

In AI CodeOps

AI CodeOps uses fixed workflows. A session runs like this:

  1. Checks before start. The budget is checked, then the workspace policy: workflow.dispatch for the workflow and agent.dispatch for every agent it will run. A deny refuses the session; an ask holds it for approval.
  2. Steps in order. Each step is run by one agent and sees the task and what the earlier steps wrote. On Auto, steering steps (architect, reviewer, security auditor, researcher, planners) get the best model tier you have allowance for, code-writing gets Standard, and drafting gets Economy.
  3. Tools. Agents can call tools from remote MCP servers you connect, filtered by policy and per agent.
  4. Change, tests, review. The plan becomes files and a diff, your tests run in an offline sandbox, and a findings pass reviews the diff.
  5. A person decides. A review request opens under Review & Gate → Approvals.

The limits, as the session enforces them:

budget             checked before every model call
agent steps        4 minutes in total
tests              6 minutes, plus the command already running
diff review        2 minutes
whole session      stopped as stalled after about 19 minutes
MCP tools          up to 32 per session; 6 rounds of tool calls per step;
                   30 seconds per call
diff size          over 60 KB is refused: "Split the task into smaller changes."

From a finished session you can send a follow-up, a new linked session that starts from the parent's unmerged change. While a session runs, Spawn handoff starts a linked session from a chosen step. Cancel session stops it within a few seconds, including a model call in flight.

Frequently asked questions

Can I build my own workflow in AI CodeOps?

Not yet. Every session runs one of the 16 built-in workflows, each with a fixed list of steps. You can customise the agents those steps use.

What stops a session that runs away on cost?

The budget is checked before every model call. A session that goes over budget mid-way stops with the reason.

Is a follow-up the same as a re-run?

No. A re-run starts the same task again from scratch. A follow-up is a new session linked to its parent, with the parent's task and summary as context.