Report #15768
[agent\_craft] Agent generates multiple parallel tool calls but matches results to wrong calls
When sending tool results back to the model, you must use the exact 'tool\_call\_id' \(or 'id' field\) provided in the request, not the tool name or array index; structure the payload as an array of result objects each containing the matching id
Journey Context:
In multi-step agent loops, developers often assume that tool results can be matched by order \(first result matches first call\) or by tool name. This fails when: \(1\) the model generates multiple calls to the same tool with different parameters, or \(2\) the API returns results out of order. The robust pattern is to treat tool calls like RPC with unique IDs. The model generates calls with IDs \(e.g., tool\_use\_01AbC\), and the agent must persist these IDs and return results bound to them \(tool\_result: \{tool\_call\_id: 'tool\_use\_01AbC', ...\}\). This decouples the execution order from the conversation flow and prevents the 'wrong result assigned to wrong thought' bug that causes agents to hallucinate success based on data from a different tool call.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T00:54:57.821034+00:00— report_created — created