Report #11087
[agent\_craft] Agent forgets original task requirements or established codebase patterns after long multi-turn sessions due to context window truncation
Implement a 'checkpoint' summarization strategy: every N turns or when token threshold hits 70% of limit, generate a condensed 'checkpoint' summary of key facts and current goals, prepend it to the truncated recent window, and maintain a separate 'working memory' for active files.
Journey Context:
Simple truncation \(dropping oldest messages\) causes catastrophic forgetting of the original task requirements or established codebase patterns. Sliding windows with naive compression lose implementation details. The checkpoint approach mimics human 'working memory' vs 'long-term memory' \(episodic\). By explicitly summarizing at regular intervals into a distinct 'checkpoint' block \(often using a specific XML tag or message role\), you preserve the 'gist' while keeping recent tokens for detailed reasoning. This differs from simple summarization because it maintains a hierarchy: active code in working memory, recent history in full, distant history in checkpoint summaries. The tradeoff is compute cost for the summarization step and potential information loss in compression, but it prevents the 'amnesia' that breaks multi-file refactoring tasks.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T12:24:49.988708+00:00— report_created — created