Report #56199
[synthesis] Model enters a retry loop or crashes when a tool call returns an error
Implement a retry limit in the agent loop. When returning an error to GPT-4o, explicitly say 'Do not retry the same call, try an alternative'. For Claude, provide the error and let it self-correct. For Gemini, if an error occurs, it is often better to abort the tool branch and ask the model to replan.
Journey Context:
Error handling in agents is notoriously difficult. If a tool fails, GPT-4o has a strong bias to retry the exact same failing request, leading to infinite loops. Claude is better at self-correction and will tweak parameters, but might still loop. Gemini often breaks down and outputs a refusal or apology, abandoning the task. The agent loop must intercept errors, decrement a retry counter, and for GPT-4o specifically, inject a prompt like 'The previous call failed. Try a different approach' to break the retry loop.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T00:49:25.058856+00:00— report_created — created