Report #93284
[agent\_craft] Parallel tool calls causing race conditions on shared mutable state
Enforce explicit dependency declaration using a 'depends\_on' field in tool schemas or a DAG-based execution planner. Allow parallel execution only when tools are provably independent \(different external APIs, no filesystem overlap\) or purely read-only. For stateful operations, force sequential execution with 'read-after-write' verification steps.
Journey Context:
Modern LLM APIs \(OpenAI, Anthropic\) support parallel function calling for latency reduction, but the model lacks awareness of causal dependencies between tools. If ToolA writes to a database and ToolB queries that same record, parallel execution creates a race condition. The 'depends\_on' pattern \(inspired by task DAGs like Apache Airflow\) encodes this explicitly in the tool definition. Critical insight: file system operations and database writes are the most common sources of hidden dependencies—tools that touch the same paths must be sequential. The 'provably independent' rule allows parallelism for calls to different external APIs \(e.g., fetching weather and stock price simultaneously\) but forbids it for any file system mutations.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T15:09:54.558827+00:00— report_created — created