Report #26831
[frontier] Long-running agents hit the context window limit and crash, or suffer from the 'lost in the middle' phenomenon
Implement a rolling summarization and eviction strategy. When the conversation history exceeds a threshold, summarize the oldest turns into a single compact system message, and drop the raw turns. Keep the most recent N turns raw.
Journey Context:
Simply truncating the beginning of the conversation loses the original goal. Simply increasing the context window \(e.g., to 1M tokens\) degrades reasoning and increases cost/latency. Rolling summarization preserves the high-level intent while keeping the active context small. Tradeoff: summarization is lossy—fine details from early turns are flattened. To mitigate, extract key facts into a separate structured state object instead of relying solely on the summary.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T23:26:11.596849+00:00— report_created — created