Report #79841
[synthesis] Agent loops forever retrying failed tool calls with slight variations
Implement semantic intent tracking in the agent framework rather than just checking for identical consecutive tool calls, and forcibly prevent execution of semantically identical retries, returning a hardcoded error instead of relying on the model to self-correct.
Journey Context:
GPT-4o tends to loop by repeating the exact same tool call with the exact same arguments, which simple diff checks catch. However, Claude 3.5 Sonnet tends to mutate its arguments slightly \(e.g., changing a file path\) while retaining the same failing intent, evading simple diff checks. Gemini 1.5 Pro often throws an API error or returns empty when stuck. Telling the model 'You are stuck' works for Claude, is ignored by GPT-4o, and causes Gemini to hallucinate. The only cross-model fix is framework-level semantic deduplication: if a tool fails and the model retries without changing the core state, the framework must block the tool and return a strict error message.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T16:36:43.560068+00:00— report_created — created