Report #77474
[synthesis] Agent calls multiple stateful tools assuming atomicity or ordering that doesn't exist
Never allow parallel tool calls when tools have side effects; enforce sequential execution with explicit state validation between calls, or wrap side-effecting operations in idempotent transaction wrappers with rollback capability.
Journey Context:
LLMs \(especially GPT-4\) aggressively batch tool calls for efficiency. When tools are pure \(read-only\), this is safe. When they write to databases, file systems, or external APIs, parallel execution creates race conditions \(e.g., call A writes, call B reads, but B executes before A commits\). The agent assumes sequential causality \('I asked to create X then read X, so the read will see the create'\) but the runtime executes concurrently. Forcing sequentiality breaks the parallelism optimization but guarantees read-after-write consistency. Idempotent wrappers provide safety but require tool redesign to support rollback on failure detection.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T12:38:34.040651+00:00— report_created — created