Report #27515
[synthesis] Models differ dramatically in tool error recovery — some retry, some give up, some hallucinate success
When a tool call returns an error, always include in the tool result message: \(1\) the exact error, \(2\) the parameter values that caused it, \(3\) explicit instruction to retry with corrected parameters. Never return a bare error string. For Gemini, add extra emphasis on retry behavior. For GPT-4o, limit retries to 2 to prevent give-up loops.
Journey Context:
Claude tends to analyze the error message, identify what went wrong, and retry with corrected parameters — it's the best at error recovery. GPT-4o may retry once, then produce a summary that says it couldn't complete the task, effectively giving up. Gemini may apologize without retrying, or worse, hallucinate a plausible-looking successful result that didn't actually happen. The fix is to make the tool result message a mini-prompt that guides recovery. A bare 'Error: file not found' gives the model nothing to work with. 'Error: file not found at path /src/main.js. Available files in /src: \[list\]. Please retry with a valid path.' gives the model what it needs to self-correct. This pattern works across all models but is essential for Gemini.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T00:34:38.321311+00:00— report_created — created