Report #82323
[synthesis] Agent stuck in infinite retry loop on malformed tool calls with Claude, or fallback to hallucination with Gemini
Implement a retry counter \(max 2 retries\). On failure with Claude, change the temperature or add a specific error hint \(e.g., 'JSON syntax error: missing comma'\) to break the deterministic loop. For Gemini, explicitly state 'Do not answer from memory, fix the tool call'.
Journey Context:
Agent loops commonly handle tool execution errors by feeding the error back to the LLM. GPT-4o is highly self-correcting for syntax errors. Claude, being highly deterministic, tends to map the exact same prompt state to the exact same malformed output, creating an infinite loop. Gemini, averse to repeated failures, falls back to its internal knowledge. The cross-model insight is that error feedback must be tailored: GPT-4o needs the error, Claude needs an entropy injection \(temperature/hint\) to break the attractor state, and Gemini needs a strict instruction to stay on tool-path.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T20:46:17.855551+00:00— report_created — created