Concept · No. 049 · December 5, 2026
Parallel tool calls turn your agent into a concurrent program
When a model emits several tool calls in one turn, it plans them all from the same snapshot of the world. If the harness runs them at once, you inherit every race condition you would expect from threads, with none of the locks.
The idea
Most model APIs now let the model return several tool calls in a single turn. Harnesses usually run them concurrently because it cuts latency: three searches that each take a second finish in about one second instead of three.
The catch is that every call in that batch was chosen before any of them returned. The model is planning from one snapshot and assuming the calls are independent. For reads that is usually true. For writes, or for tools that share hidden state, it often is not.
So parallel tool calls are not a model feature you switch on. They make your harness a scheduler, and your tools become concurrent code whether you wrote them that way or not.
An example
A coding agent decides to rename a function and update its two call sites. It emits three calls in one turn:
edit_file(path="billing.py", old="def charge(", new="def charge_card(")edit_file(path="billing.py", old="charge(order)", new="charge_card(order)")edit_file(path="api.py", old="charge(order)", new="charge_card(order)")
The harness runs them concurrently. The two edits to billing.py each read the file, apply a replacement, and write it back. Whichever writes last wins, so one change silently disappears. Both report success.
The model sees three successes and moves on. The bug surfaces later as a failing test, and the agent spends several turns hunting for an edit it believes it already made. The tools were correct in isolation. The schedule was wrong.
Where it breaks
Lost updates like the one above are the obvious case. The quieter ones:
- Hidden ordering:
create_branchandcommitin one batch, where the second depends on the first existing. - Shared session state: a shell tool where one call runs
cdand another assumes the old directory, or two browser actions on the same tab. - Partial failure: one write of three fails, and the model has to reason about a world that is half changed without being told which half.
- Rate limits: a batch of calls to one upstream API trips a limit that sequential calls would not.
Parallelism is the wrong tool when the work is mostly writes to the same resource, or when tool latency is small compared to model latency. In that case you take on the risk and save almost nothing.
In practice
I would start by classifying every tool by its effect, and letting the harness, not the model, decide what runs concurrently.
- Mark tools as read-only or mutating. MCP tool annotations such as
readOnlyHintanddestructiveHintare a reasonable place to record this, though I would verify them for third-party servers rather than trust them. - Run read-only calls concurrently. Run mutating calls sequentially, in the order the model emitted them.
- Where writes must overlap, lock per resource: key by file path, record id or session, not one global lock.
- Make edit tools carry a precondition, such as the content hash the model last saw, and reject the write if the file changed. A clear conflict error is something the model can recover from. A lost update is not.
- When a write in a sequential batch fails, skip the rest and return them as not executed, so the model knows exactly what state it is in.
- Return results with their call ids, in call order, even if they finished out of order.
- For write-heavy phases, turn off parallel calls in the API request entirely.
Let the model propose a batch of tool calls, but let the harness schedule them: reads together, writes in order, and every edit guarded by the state it was planned against.