Report #94460
[synthesis] Agent loops between two tools trying to fix each other's errors with identical arguments
Implement a sliding window deduplication check on the last N tool calls \(name \+ arguments\) and break the loop with a forced context summary or replan if a duplicate is detected.
Journey Context:
Agents often get stuck in 'ping-pong' loops: Tool A fails, they call Tool B to fix it, Tool B fails, they call Tool A again with the exact same args. Because the intermediate context changes slightly \(the error messages from A and B alternate\), the LLM doesn't recognize it's in a loop. The synthesis of LLM context window dynamics and loop detection algorithms shows that the model cannot self-diagnose this loop because it lacks a global view of its action history. Deduplication must be implemented externally in the orchestrator, comparing hashes of recent tool calls to break the cycle.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T17:08:11.138887+00:00— report_created — created