dispatching parallel agents
current authority
local delegation uses explicitly authorized peer sessions with disjoint file ownership, never subagents. a useful independent boundary does not authorize spawning an agent.
multiple genuinely independent problems: dispatch one focused agent per problem domain, in one response, run concurrently.
what it teaches
decision tree: multiple problems → independent? → no shared state? only yes-to-both justifies parallel dispatch. related failures (fixing one might fix others), exploratory debugging (break unknown), shared files → one agent.
each agent's prompt carries four things:
- Specific scope — one subsystem or file set, never "fix everything."
- Context — the exact error messages and symptoms, pasted.
- Constraints — what not to touch.
- A defined return — summary of root cause and fix, so the coordinator can integrate.
integration is its own step: read each summary, check fixes don't conflict, run the full suite, spot-check for systematic errors.
why it exists
parallel agents editing shared files merge silently: agent A adds a field, agent B renames the type — both pass review, merged code breaks. collisions are expensive and only visible after integration. narrow scope and shared-state checks prevent the collision upfront; prompt structure makes parallelism cheap instead of chaotic.
the rules
- multiple dispatch calls in one message run in parallel; one per message is sequential.
- never dispatch parallel agents onto shared state.
- verify integration after they return — parallel fixes that each work can still collide.
when to use
three or more failing test files with different root causes, or multiple broken subsystems each understandable without the others — the signature of independent domains.
good and bad
bad
agent a: edit the workflow route to add retry logicagent b: refactor the workflow route to simplify error handlingmerged result: conflicting edits to the same file; route returns wrong type
both agents mutate the same file; each report reads as success, so the coordinator debugs a merge neither agent saw. time saved during execution becomes time lost during integration, with a broken route in between.
good
agent a: read the route's error cases and audit every path; report diagnosisagent b: read the provider contract and check caller expectations; report diagnosisdeliverable: two independent read-only audits, zero shared mutations
independent evidence-gathering slices, no touching files; each agent owns a question, not a shared mutation. integration reduces to reading summaries and reconciling conclusions — no textual collisions.