Report #11278
[agent\_craft] Conversation history exceeds token limit in long coding sessions causing loss of initial requirements
Implement hierarchical checkpointing: Every N turns or when token count > threshold, compress the history into a 'Memory Block' containing: \(1\) Original task specification, \(2\) Key decisions made with rationale, \(3\) Current state of modified files. Replace the raw message history with this block plus the last 2 raw turns.
Journey Context:
Standard 'sliding window' truncation loses the initial user requirements and early architectural decisions made in the session. Summarization of individual messages loses the structured context of tool outputs \(e.g., exact error messages\). The 'Memory Block' pattern treats the session as a state machine: it preserves the invariant \(task spec\), the derivation \(decisions\), and the current state \(file contents\). This is distinct from simple summarization; it's a structured state checkpoint that mimics how human developers maintain mental context across interruptions. Implementation requires tracking 'critical turns' \(tool success/failure, user corrections\) vs 'exploratory turns'.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T12:54:16.498084+00:00— report_created — created