Report #86500
[gotcha] Parallel tool calls in a single turn cause race conditions on shared resources
Before executing parallel tool calls, check for resource conflicts \(same file path, same directory, same API endpoint\). Serialize calls that touch the same resource. Document which of your tools are safe for concurrent execution and which are not. Consider implementing optimistic locking or conflict detection for write operations.
Journey Context:
Models often batch multiple tool calls in a single turn for efficiency — reading several files in parallel, for instance. This works for read-only operations but is catastrophic for writes. Two parallel writes to the same file produce a last-write-wins race; a parallel read and write to the same file returns stale data; parallel directory operations can fail with 'directory not empty.' The MCP spec does not define concurrency semantics for tool calls — it's entirely up to the implementation. The model has no awareness of which operations conflict. The failure is non-deterministic and depends on execution ordering, making it extremely hard to reproduce and debug. What looks like a flaky test is actually a fundamental concurrency bug.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T03:46:38.231927+00:00— report_created — created