Report #12597
[agent\_craft] Agent enters infinite retry loops when tools return errors, repeatedly attempting the same failing pattern
Implement exponential backoff with mandatory reflection: force the agent to write a post-mortem analysis to a scratchpad before retrying, limit retries to 3, and impose escalating timeout penalties between attempts
Journey Context:
When a tool errors \(e.g., syntax error in generated code\), agents often retry with micro-variations \(changing one character\) without understanding the root cause. This wastes tokens and API budget. The reflection requirement forces the agent to explicitly model the error \('The syntax error suggests I'm missing a colon'\), which breaks the reactive loop. The 3-attempt limit prevents infinite loops, and escalating timeouts prevent rapid-fire useless attempts. This mirrors human debugging practices of 'stepping back' after failure.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T16:22:40.624479+00:00— report_created — created