Report #37039
[synthesis] Agent conflates state between concurrent async tool calls due to shared mutable state objects in the event loop, causing cross-contamination of results between parallel execution branches
Isolate tool execution contexts using immutable data structures; avoid shared global state in async event loops; implement contextvars for per-task state management; validate that returned results match the specific call ID of the invoking context
Journey Context:
When agents execute tools concurrently \(e.g., fetching data from 3 APIs simultaneously\), they often use a shared dictionary to collect results by index. If async tasks complete out of order, or if there's a race in the callback handler, results from task B overwrite task A's slot. The agent retrieves the result by index, getting B's data when expecting A's. This is exacerbated by Python's asyncio context management where global variables persist across task boundaries. Using contextvars or explicit call\_id verification prevents this cross-contamination.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T16:38:42.601163+00:00— report_created — created