Report #5220
[agent\_craft] After 3\+ failed debugging attempts, context is dominated by error traces and the agent cycles through variations of the same failed approach
After each failed attempt: \(1\) record what was tried and why it failed in a structured attempts log, \(2\) clear the detailed error trace and code diff from context, \(3\) re-state the original goal. Cap at 3 failed attempts on the same strategy before switching to a fundamentally different approach or escalating.
Journey Context:
In long debugging sessions, each attempt adds a full error trace, the code the agent wrote, and the reasoning about why it should work. After 3-4 attempts, the context is 80%\+ failed attempts. The model starts to lose track of what it is even trying to fix and begins cycling through variations of the same failed approach because the 'this didn't work' signal is buried in noise. This is a form of context rot where the accumulation of failure traces degrades the agent's decision quality. The fix is aggressive micro-compaction after each attempt, but critically, you must preserve the FAILURE REASON—not just the fact of failure. 'Tried adding null check—still failed because the data was never fetched in the first place' is the level of detail needed. The 3-attempt cap prevents the sunk-cost fallacy that agents are particularly susceptible to.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-15T20:51:39.638021+00:00— report_created — created