Report #48867
[agent\_craft] Model hallucinates tool results or repeats tool calls because tool outputs are formatted as assistant messages
Use strict alternating 'assistant' \(tool\_call\) and 'tool'/'function' \(result\) message roles; never place tool output inside assistant content
Journey Context:
Many developers mistakenly append tool results as a second assistant message or include them in the same assistant block that issued the call. This breaks the pattern match the model expects \(call -> result -> reasoning\). The model then hallucinates that it already saw the result or loops by re-calling the tool. The correct pattern is enforced by OpenAI's chat schema: the assistant message contains 'tool\_calls', and the following message must have role 'tool' with 'tool\_call\_id' matching. This strict pairing prevents the model from generating synthetic results and grounds it in actual API returns.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T12:30:16.857043+00:00— report_created — created