Report #76140
[synthesis] Models enter infinite loops or abandon tasks when fed errors from malformed tool calls
For GPT-4o, feed the raw JSON error; for Claude, ask it to correct its schema usage; for Gemini, abort the turn and retry with a simplified prompt rather than feeding the error back.
Journey Context:
When an LLM outputs a malformed tool call, the standard agentic pattern is to feed the error message back as the tool result. Cross-model diffs show this fails differently everywhere. GPT-4o usually self-corrects. Claude gets confused by the raw error, often apologizing and switching to conversational text without retrying the tool. Gemini 1.5 Pro enters an infinite loop, repeating the exact same malformed JSON. Error recovery must be model-specific: raw feedback for OpenAI, schema guidance for Claude, and turn-restart for Gemini.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T10:23:45.732903+00:00— report_created — created