You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[BUG] Approved tool calls run concurrently with later calls in the same batch, so a Read can race the Write it depends on #1290
When one assistant turn batches tool calls that depend on each other, an approved call can run at the same time as the calls after it. A Read of a file that an earlier Write in the same batch creates can therefore return NOT_FOUND.
Cause: ApprovingToolsState.processNextTool (internal/agent/states/approving_tools.go) asks for approvals one at a time. Once a call is approved, spawnExecution starts it in a goroutine and the loop moves straight on to the next call. A call that needs no approval (such as Read) is started at once in the same way. The two run concurrently, up to max_concurrent_tools (default 5), so the order the model chose is not kept. Results are still recorded in tool-call order, so the conversation looks ordered even though execution was not.
The concurrent execution is intentional (it lets independent calls such as parallel Reads run together). The problem is only that calls which depend on an earlier write can overlap with it.
Found while reproducing #1286. The e2e scenario approval-tail in tests/e2e/scenarios.yaml (added in #1289) hits this reliably.
In an empty directory, run INFER_GATEWAY_MOCK=true INFER_GATEWAY_MOCK_SCENARIOS=scenarios.yaml infer chat and pick the mock model.
Send write then read and approve both Write prompts.
Expected Behavior
Read(m1.txt) runs after Write(m1.txt) finishes and returns one.
Actual Behavior
Read(m1.txt) fails with NOT_FOUND: <cwd>/m1.txt. Both Write calls succeed, and m1.txt exists on disk afterwards. In the TUI, the Write result shows 46ms and the Read result 41ms, so the two ran at the same time.
Activity
inference-gateway-releaser commentedon Sep 23, 2026
🎉 This issue has been resolved in version 0.207.0 🎉
The release is available on:
Your semantic-release bot 📦🚀