Concepts / MVP

Swarms and runs

A swarm is a named declaration; a run is one execution of it. Files start a swarm, and the server holds its state.

View .md

A swarm is the set of agents, topics and limits declared by a folder of .cvy files. A run is one execution of that swarm on the server. The swarm is the name; the run is what happens.

Swarms are keyed by name

The label on the swarm block is the swarm’s name: swarm "edge_chips" is edge_chips everywhere. convoy run sends the files to PUT /v1/swarms/edge_chips. Every other command, such as convoy status edge_chips, addresses the swarm by that name. Exactly one swarm block must exist across all files in the folder.

One active run at a time

Each convoy run starts a new run with the next run number. A swarm has at most one active run, meaning one that is Pending or Running.

  • convoy run on a swarm with an active run is refused with swarm_active. Wait for the run to finish, or convoy stop it.
  • convoy run on a swarm whose latest run has ended starts run N+1.
  • A running swarm’s spec never changes. Applying edits to a live run is post-MVP.

History

Finished runs are kept. convoy status edge_chips shows the latest run; convoy status edge_chips --run 1 shows an earlier one. --json prints the same data for scripts. Each run keeps its own spec, spend, agents, outputs and event log, so comparing two runs of the same swarm is a matter of reading two rows.

Run status and end reasons

A run is Pending until the controller’s first pass, then Running, then one of three terminal states. Terminal runs carry an end reason.

StatusEnd reasonMeaning
Donedonedone_when became true
StoppedbudgetSpend reached max_cost_usd. Outputs already produced are kept
Stoppedmax_runtimeWall-clock time reached max_runtime
StoppedstoppedSomeone ran convoy stop
FailedfailedEvery agent ended and done_when was still false
Failedserver_restartconvoyd restarted while the run was active

The controller checks these in the order of the table above, so a pass that sees both the budget crossed and done_when true ends the run as budget. When a run ends, every agent still alive is stopped. See budgets and limits.

done_when is evaluated whenever an agent it references finishes, and the server also re-evaluates it on every controller pass. A done_when that cannot be evaluated yet does not end the run.

Where state lives

The files start the swarm. After convoy run, convoyd holds the state: the stored spec, every agent’s status, every topic and message, spend, and the event log, in a SQLite file (--db). Three consequences follow.

  • The CLI is stateless. It exits after convoy run, and the swarm keeps going. convoy watch and convoy say attach to the server, not to your files.
  • Editing main.cvy after convoy run changes nothing about the running swarm.
  • Agents created at runtime by the overseer or by an agent with can_spawn exist only in the server. They are not written back to your files. Exporting a live swarm as .cvy is post-MVP.

For the HTTP surface behind these commands see the HTTP API.

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