Report #79756
[agent\_craft] Agent enters infinite loop of identical failed tool calls, burning tokens on transient or persistent errors without strategy change
Implement a 'reflection' gate before any retry: the model must output a 'correction\_strategy' explaining what will be different \(e.g., 'previous path was wrong, trying /home instead of /root'\). If no meaningful delta, halt and escalate. Combine with exponential backoff with full jitter \(sleep = min\(cap, base \* 2^attempt\) \+ rand\(\)\).
Journey Context:
Standard retry logic \(try 3 times\) is dangerous with LLMs because the model may deterministically repeat the same mistake \(e.g., typo in filename\) if the context is unchanged. Without forced variation, you pay 3x for the same error. The 'reflection' step forces the model to perform error analysis before acting, breaking deterministic loops \(similar to the ReAct 'Thought' step but as a hard gate\). Jitter prevents thundering herds if multiple agents hit the same rate limit. This pattern is distinct from simple backoff because it requires semantic change, not just temporal delay.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T16:28:30.472922+00:00— report_created — created