Report #93650
[gotcha] Agent calls the same tool repeatedly with identical arguments in an infinite reasoning loop
Implement a call deduplication guard: track \(tool\_name, args\_hash\) pairs per conversation turn. After 2 identical calls with identical args, inject a system message forcing the agent to change strategy. Set a hard max-tool-calls-per-turn limit \(e.g., 15\).
Journey Context:
When a tool returns an unexpected or empty result, the agent's reasoning often goes: 'The result doesn't match my expectation → maybe it was a transient failure → try again with the same args.' This creates a loop because the tool will deterministically return the same result. The agent lacks meta-cognition to recognize it's stuck. This is especially common with search/query tools returning empty results — the agent assumes the call failed rather than the query being wrong. The dedup guard is a circuit breaker that forces strategy change.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T15:46:40.953087+00:00— report_created — created