Report #16421
[agent\_craft] Naive context truncation deletes recent, critical tool outputs when the context window fills up
Implement a sliding window with rolling summarization: summarize the oldest N turns into a single block, keeping the most recent K turns intact. Never truncate the system prompt or the most recent tool output.
Journey Context:
When the context hits the limit, simple FIFO truncation often removes the very tool output the agent needs to formulate its next step. Rolling summarization preserves the high-level narrative of what has been tried \(preventing the agent from repeating mistakes\) while freeing up space for new data. The key is to summarize completed sub-tasks and keep active sub-tasks fully intact.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T02:41:10.697578+00:00— report_created — created