Swarm Code Review
A swarm of reviewers forked from one checkout — steered and paused mid-review, then merged by an editor, via alineod.
A code review run by a swarm of agents, orchestrated entirely through alineod's HTTP API. One lead agent checks out the repository; three reviewers are forked from its sandbox — each starting with the checkout already on disk — to review one concern each; an editor waits for all three and merges their findings into a single report.
review-lead ── clones expressjs/cors once
├── reviewer: security ┐
├── reviewer: correctness ├─ forked from the lead's sandbox
├── reviewer: tests ┘
└── editor ── waitFor all three → one reportSetup
Start OpenSandbox in Docker (one-time setup), and build the workspace:
bunx alineo-cli init
bun install && bun run buildGet a free API key from build.nvidia.com and start alineod with it in its
environment. The agent specs reference ${NVIDIA_API_KEY}, which the daemon resolves — the key never travels in a
request.
cd apps/alineod
NVIDIA_API_KEY=nvapi-... bun run startRun it
What it does
Check out the repository once
agents/lead.json installs git and clones expressjs/cors as a setup step. POST /runs creates the run with the
lead as its root, and its first turn reports the commit under review. The lead's spawnDepth: 1 and maxAgents: 5
are what allow — and cap — the swarm below it.
Fork a reviewer per concern
Three POST /runs/:runId/agents calls fork the lead's live sandbox into reviewers for security, correctness, and test
coverage. Each one starts with /workspace/cors already present, so the repository is cloned exactly once. Every
spawn carries an idempotencyKey, so retrying a request can never fork a duplicate reviewer.
Intervene mid-review
While the reviewers work, the script pauses the tests reviewer's container for five seconds and resumes it — it continues exactly where it stopped — and steers the security reviewer onto a narrower brief. The steer lands after the reviewer's current tool call finishes, before its next model call. Neither agent restarts.
Gather with waitFor
The editor is spawned with waitFor on all three reviewers. alineod holds it in the spawning state until they
finish, then forks it and writes each reviewer's findings into its sandbox as /inputs/<agentId>.txt, plus an
/inputs.json manifest carrying each reviewer's outcome. The editor merges them into one report.
Report and tear down
The report is printed and saved to review.md, followed by the final agent tree. DELETE /runs/:runId then closes
every sandbox in the swarm while keeping the run's history.
Every agent's progress arrives on a single GET /runs/:runId/events connection — lifecycle events plus each agent's
tool calls, tagged with the agentId that produced them.
Adapt it
To review a different repository, change the clone URL in agents/lead.json, and the paths and
concerns in index.ts. Add a concern by adding a key to concerns — and raise maxAgents if the
swarm grows past five.
Where to go next
Fan-out and gather and Steering and pausing cover the mechanics used here, and the HTTP API lists every route.