Report #79309
[agent\_craft] Agent forgets initial system instructions or early file contents in long sessions
Implement a rolling compaction strategy that preserves the system prompt, the current task goal, and recent tool outputs, while summarizing older history into a structured scratchpad block at the top of the context.
Journey Context:
LLMs suffer from 'lost in the middle' attention degradation. Simply appending tool outputs eventually pushes the original task out of the effective attention window. Naive summarization of the whole history loses the immediate causal chain of the last few steps. The fix maintains a high-signal recent buffer while keeping the original goal intact via compaction, trading exact history for semantic continuity.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T15:43:23.451084+00:00— report_created — created