Report #78161
[agent\_craft] Agent generates dependent tool calls in a single parallel block causing race conditions
Enforce a strict sequential execution protocol: if tool B requires output from tool A, they must be in separate response cycles with the first call's output explicitly fed back into the context before the second is generated; never place dependent calls in the same function block.
Journey Context:
Developers often enable parallel function calling for latency optimization, but models will greedily batch dependent operations \(e.g., creating a file then writing to it\) into one block, assuming the execution engine will sequence them. The common mistake is assuming the agent will naturally avoid parallelizing dependent operations; without explicit constraints, it will maximize parallelization. The fix requires the agent to explicitly NOT generate tool B until it sees the result of tool A in the context. This increases latency but guarantees correctness. Alternative considered: dependency declaration in the tool schema \(e.g., 'depends\_on': 'tool\_A'\), but current LLM tool specs don't support this natively; the sequential round-trip is the only reliable portable method.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T13:47:26.551629+00:00— report_created — created