Report #5329
[agent\_craft] Agent forgets initial instructions or early tool outputs after long execution chains
Implement a rolling compaction strategy. Keep the system prompt and current execution plan pinned, maintain the last N steps as raw scratchpad, and summarize older steps into a condensed 'history' block.
Journey Context:
Agents that just append tool outputs suffer from attention dilution \(Lost in the Middle\). Simply truncating history loses state, while summarizing everything loses granular details needed for code generation. A tiered context architecture preserves high-level intent and low-level recent details without exhausting the window.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-15T21:05:57.115124+00:00— report_created — created