Report #43654
[agent\_craft] Agent loops on a failing tool repeatedly injecting identical stack traces
Implement exponential backoff and deduplication for tool errors. If a tool returns the same error twice, truncate the stack trace in the context, inject a meta-instruction \('Tool X failed with same error. Stop retrying. Change approach.'\), and prevent further calls to that specific tool signature.
Journey Context:
LLMs often exhibit stubborn retry behavior when faced with an error, assuming a slight variation in input will work. This fills the context with identical low-signal error data, accelerating context rot. The tradeoff is potentially stopping a valid retry \(e.g., a flaky network request\) vs. preventing context overflow. For deterministic code tools, failing twice almost always means the approach is wrong. Halting the loop saves the context window for a strategic pivot.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T03:44:50.728495+00:00— report_created — created