How do you orchestrate multiple agents?
Summary
A builder of an open-source multi-agent tool asks how people run several agents at once: mixing vendors, checking work before it lands, and the most annoying failure modes. Replies describe worktree isolation, single-owner queues, idempotency keys and blind cross-agent review.
What the comments say
Give each parallel writer its own git worktree and have sub-tasks open a PR that stops once CI passes, with one landing task putting changes on main serially; this prevents agents overwriting each other's uncommitted files.
Tests alone are insufficient because the agent that wrote the code usually wrote the tests, so they pass for the same wrong reason; a second agent reviewing the diff, or a full before/after diff, catches more.
A reviewer given only the code and neutral questions, without the first agent's conclusion, finds real bugs; when the conclusion is passed along, the reviewer mostly just confirms it.
Route every external side effect through a single serialized executor with an idempotency key and version precondition; where the API lacks idempotency, persist the intent and reconcile state before retrying, since the uncertain-success window is where duplicates appear.
A simple timestamped queue where only the oldest request may touch a shared resource avoids race conditions without complex locking.
Recording every tool call and result as it happens shows after a restart that a call was made, but does not prevent a second attempt; truly external actions still need idempotency keys on the receiving side.
Join the discussion
Was this useful to you?
Related
Seven security practices for Claude Code, from version checks to sandbox and MCP permissions
X · kimuai08
How the Claude Code team thinks about verification
claude.dev · Addy Osmani
62 Claude sessions rebuilding my media library in 80 minutes
aaronorelup.com · Aaron Orelup
623 tasks in three weeks: why I stopped using an AI assistant and built a factory
X · BaptisteStuder_
From doing the work to delegating it: field notes on putting AI agents in my job
blog.hoegun.xyz