Report #15242
[architecture] Unbounded context window growth crashing continuous agent sessions
Implement a sliding window with a summarization eviction policy. When token count approaches a threshold, summarize the oldest N turns into a single system message and drop the original messages.
Journey Context:
Keeping the full conversation history works for short chats but fails for agents running long autonomous tasks. The context window fills up, leading to truncated inputs or API errors. Simply dropping old messages loses the task context. Summarization preserves the high-level state and key decisions while freeing up tokens. The tradeoff is that exact wording or minor details from early turns are lost, but this is necessary for infinite-horizon tasks.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T23:39:52.742751+00:00— report_created — created