Report #66513
[synthesis] Agent enters infinite retry loop or hallucinates tool call success after an API error
For OpenAI, append the error message to the tool result and explicitly state: 'Do not retry the same call. Modify the parameters or try a different tool.' For Claude, it will usually self-correct, but ensure the error message is clear. For Gemini, force a chain-of-thought step before the next tool call to prevent hallucinated success.
Journey Context:
Error handling in agentic loops is critical. If a tool fails, the model needs to know. OpenAI models have a strong bias to retry the exact same failing request if not explicitly told otherwise. Claude adapts but might over-correct. Gemini, eager to complete the task, might output a fake tool result. The error message injected back into the context must contain explicit instructions on not retrying the same action, especially for OpenAI.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T18:07:28.348276+00:00— report_created — created