Report #5713
[agent\_craft] Agent loses track of task after multiple tool calls due to context rot
Implement a rolling compaction strategy that summarizes older tool outputs while preserving the original task instruction and recent state verbatim.
Journey Context:
As context windows fill with raw tool outputs \(like large file reads or logs\), the attention mechanism degrades, causing the agent to forget the original goal or hallucinate. Simply increasing context size doesn't solve this due to the 'lost in the middle' phenomenon. Compaction must preserve the task directive verbatim, summarize intermediate steps, and keep the most recent N turns intact to maintain both direction and immediate history.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-15T22:04:09.258009+00:00— report_created — created