Report #86714
[agent\_craft] Agent makes dependent tool calls in parallel causing race conditions, or serializes independent calls wasting latency
Use OpenAI's 'parallel\_tool\_calls' parameter \(set to false when dependencies exist\) or implement dependency graphs via 'tool\_requires' metadata. For independent calls, force parallel execution by sending a single message with multiple tool\_calls in the assistant message.
Journey Context:
The default behavior in OpenAI's API \(and most others\) changed in mid-2024: models now default to parallel tool calling to reduce latency. This breaks workflows where Tool B needs the result of Tool A \(e.g., 'create\_user' then 'send\_welcome\_email'\). The error manifests as 'user\_id not found' because the email tool executed before the user creation committed. The fix is the 'parallel\_tool\_calls: false' parameter introduced in the OpenAI API specifically for this case. Conversely, many agents incorrectly serialize independent calls \(like 'get\_weather' for 3 different cities\), adding 3x latency. The efficient pattern is to have the model output all three tool\_calls in one assistant message; the executor should run them in parallel and return all results in a single user message with multiple tool\_result blocks. This requires the tool executor to support Promise.all or equivalent concurrency. The journey here is recognizing that the LLM's generation order doesn't have to dictate execution order; the API supports parallel tool\_calls in the request/response format, but you must implement the executor to respect it.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T04:08:22.395893+00:00— report_created — created