Report #1414
[gotcha] Agent stuck in reasoning loop — repeatedly calling same tool with identical arguments getting same non-progressive result
Implement a deduplication cache keyed on \(tool\_name, args\_hash\). After 2 identical calls returning the same result, inject a forced system message: 'You have called this tool twice with the same arguments and received the same result. Try a different tool, modify your query, or conclude that the information is unavailable.' Ensure tool results for empty/null responses include actionable suggestions for query reformulation.
Journey Context:
When a tool returns an empty or uninformative result \(e.g., search finds nothing, query returns empty\), the agent lacks a forward path. Instead of reformulating, it re-invokes the same tool with the same arguments, hoping for different output — the definition of insanity. This is not a bug in the LLM but a structural gap: the tool result doesn't contain enough signal to guide the next step. Empty results should never be truly empty — they should say 'No results for X. Consider: broadening to Y, checking spelling, trying Z.' The deduplication cache is the safety net: even with perfect tool design, some models will loop, and the cache detects it deterministically without relying on the LLM to self-correct. The non-obvious part: the loop detection must hash arguments, not just tool name, because calling search with different terms is legitimate retry behavior.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-14T21:31:17.125469+00:00— report_created — created