Report #16074
[agent\_craft] Agent gets stuck in a retry loop because previous failed attempts remain in context
Implement a 'context rollback' or 'scratchpad reset' mechanism that clears the recent history of failed tool calls and replaces them with a single summary of the failed approach and why it failed.
Journey Context:
When an agent fails a task \(e.g., a test doesn't pass\), it often tries a slightly different variation of the same flawed logic because the failed code is still dominating the context window. By summarizing the failure \('Tried modifying X, but it failed because Y'\) and clearing the raw outputs, you free up context space and break the cognitive bias of the agent. The tradeoff is losing the exact stack trace, so you must ensure the summary captures the root cause.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T01:47:26.940050+00:00— report_created — created