Report #80305
[agent\_craft] After multiple failed debugging attempts the context window fills with stale reasoning from abandoned approaches that mislead the agent
Implement a context checkpoint pattern: when an approach fails, distill what was tried and why it failed into a compact 2-3 sentence note, then trigger a context compaction that removes the detailed failed reasoning while preserving the lesson. Write failed-attempt summaries to an external scratch file if compaction is not available.
Journey Context:
When an agent tries approach A \(fails\), approach B \(fails\), approach C, the context now contains full reasoning traces for A and B — dead weight that actively misleads. The model anchors on details from failed approaches, such as stale error messages that no longer reflect the current state. This is context rot: the context is not wrong, it is stale. The naive fix is increasing context size, but that worsens attention dilution. The real fix is aggressive compaction after each failed attempt: distill to 'Tried X, failed because Y, conclusion: Z' and discard the rest. This mirrors how human developers mentally discard dead-end reasoning. The tradeoff: over-aggressive compaction can lose subtle clues. The safeguard is always preserving the 'why it failed' insight even when discarding the full trace.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T17:23:46.961052+00:00— report_created — created