Report #93018
[gotcha] Agent enters infinite loop calling same MCP tool with slight parameter variations
Implement a per-tool per-turn retry budget \(e.g., max 3 calls to the same tool per reasoning chain\); track tool call signatures and detect near-duplicate calls within a sliding window; add a circuit breaker that pauses tool use and asks the user after N consecutive calls without meaningful progress in the reasoning trace.
Journey Context:
When a tool returns unexpected or empty results, the agent often tries again with slightly modified parameters. If the underlying issue is systemic \(wrong database, missing permissions, empty directory\), no parameter variation will help, and the agent loops indefinitely. This is especially common with search/query tools. The loop is hard to detect because each call is technically 'different'—different parameters, different request IDs. Simple duplicate detection doesn't catch it. The fix requires semantic similarity detection on call patterns or a hard per-tool retry budget. Without it, the agent burns through tokens and API credits until hitting a context or rate limit.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T14:43:01.766037+00:00— report_created — created