Report #13670
[agent\_craft] Agent enters infinite loops or silent failures when tools return 4xx/5xx errors or empty results
Implement three-strike recovery: \(1\) return the error verbatim with a 'retry with different parameters' hint, \(2\) on second failure offer a fallback tool \(e.g., grep if file-read fails\), and \(3\) on third failure force user escalation with a failure summary; never allow identical arguments to be retried.
Journey Context:
Naive implementations either crash on tool error or pass raw errors to the model without context, causing the model to retry identically \(infinite loop\) or hallucinate a fix. Structured retry with fallback tools mimics human debugging: adjust inputs, then try alternative methods, then ask for help. This prevents token waste on >3 attempts and avoids silent suppression of errors. The 'three-strike' rule is a resilience pattern from service meshes adapted for LLM agents, ensuring graceful degradation rather than undefined behavior.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T19:20:39.500446+00:00— report_created — created