Concepts / MVP

Agents and turns

An agent works in turns. It starts when its inputs are ready, gets more turns from the board or from continue turns, and ends by calling finish.

View .md

An agent is one model session run by a runner process. It works in turns. One turn is one call into the SDK: the model reads its input, calls tools, and stops. Between turns the agent is Idle and costs nothing. The SDK session persists across turns, so the agent remembers what it has already read and done.

Runner turn loop
PENDING turn 0 Run a turn SDK + MCP swarm tools wake(usage) turn ended · spend priced Long poll blocks · 30s renew Turn arrives unread summary + addressed Start runner prompt · inputs JSON Exit finish · stop · max_turns
Fig. 1 The runner's turn and wake loop. Each pass through the loop is one turn.

Starting

  • An agent with no inputs and no depends_on starts as soon as the run starts.
  • An agent with inputs starts only after every agent it references has finished. The referenced outputs are passed into its first turn as JSON.
  • depends_on works the same way but passes nothing.

Every reference in inputs or depends_on is an edge in the dependency graph, which must have no cycles. References in writes, watches and done_when are not edges. An agent also waits in Pending when convoyd is at --max-processes.

A count agent expands into instances named worker[0], worker[1], and so on; a for_each agent into instances named by key, such as researcher[nvidia]. Referencing agent.researcher in inputs or depends_on waits for all instances.

Taking more turns

After its first turn, an agent gets another turn in exactly two cases:

  1. A message is published to a topic in its watches.
  2. A message is published with to set to the agent’s name, on any topic.

The input of that turn is an unread summary of the board, plus any messages addressed to the agent, in full. The agent pulls what else it needs with read_topic. See topics and the board.

Continue turns

An agent with an empty watches list works until it calls finish. Whenever it ends a turn without finishing, it immediately gets a continue turn, carrying any messages addressed to it, until it calls finish or reaches max_turns. This is how a single agent works through a long job, and it is the same rule in a team or alone. It also means an agent with empty watches, no output and the default max_turns can loop for 50 turns; convoy validate warns, and long jobs should set their own limit.

Finishing

Calling finish(output) ends the agent. If the agent declares an output shape, the payload is checked against it and a mismatch is returned to the model as an error, so it can correct itself. After finish the agent is Done, agent.<name>.output resolves to the payload, and its runner exits on its next wake, which revokes its token.

Agents that watch topics usually never call finish. The server stops them when the run ends. An agent is also stopped when it reaches max_turns.

Output shapes

output is an object type: { approved = bool, score = number }. It is required when done_when or another agent’s inputs reads a field of this agent’s output. Reading .approved from an agent that declares no output, or a field not in its shape, is a validation error. Without output, finish accepts any JSON.

HCL
output = { approved = bool, score = number }

Agent states

Agent states
live · counts against budget terminal gates met wake news 20m silent progress wake finish stop · limit crash Pending Running Idle Stuck Done Stopped Failed
Select a stateClick a state to see every transition out of it, or play a typical lifetime.
Fig. 2 Agent states as the controller sees them.
StateMeaning
PendingWaiting for inputs or depends_on, or for a free process slot
RunningIn a turn
IdleBetween turns, waiting on the board
StuckRunning, but no report_progress for 20 minutes. Not terminal; the overseer is woken
DoneCalled finish
StoppedStopped by convoy stop, its parent, the overseer, the run ending, or max_turns
FailedThe runner exited without finish. No restart in the MVP

The server treats a runner’s wake call as “turn ended” and its response as “turn started”, so it always knows whether an agent is Running or Idle. Details are in the controller and the runner.

Progress

Agents call report_progress(summary) after each meaningful step. The summary is what convoy status, other agents and the overseer see, and it resets the Stuck timer.

Last updated 2026-11-05
esc
    ↑↓ to move · ↵ to open
    Menu
    Get started
    IntroductionInstallQuickstartYour first swarm
    Concepts
    Swarms and runsAgents and turnsTopics and the boardThe overseerSpawning agentsBudgets and limits
    DSL
    Language rulesswarmprovidertopicagentReferences and functionsValidation rules
    Providers
    Provider typesUsing a provider typeWriting a provider type
    CLI
    Overviewconvoy goalconvoy validateconvoy runconvoy statusconvoy watchconvoy sayconvoy stopconvoy uiconvoy provider
    Runtime
    convoydControllerMessage boardRunnerSwarm tools (MCP)Web UIDurability
    Architecture
    OverviewRepository layoutSeams and contractsHTTP API
    Examples
    OverviewWriter and criticResearch teamCode teamPaperBench replicationCommit0 libraryVending-BenchSWE-Lancer bountyτ²-bench loop
    Inspiration
    What we borrowedThe harness landscape