Report #95173
[frontier] Agent quality degrades as context window fills up over long session despite large context limits
Implement strategic context compaction with a priority queue: \(1\) System prompt and constraint re-injections—never compact, always full fidelity. \(2\) Recent N turns—keep verbatim. \(3\) Older turns—summarize, preserving decisions and their rationale but discarding the exploration process. \(4\) Correction log—keep structured entries, discard conversational context. Compact when context exceeds 60-70% of window to leave headroom for re-injection.
Journey Context:
As context windows grew from 4K to 128K\+ tokens, teams assumed longer contexts would solve instruction drift. In practice, longer contexts often worsen it: more context means more competition for attention, and the system prompt becomes an increasingly tiny fraction of total context. At 100K tokens of context, a 500-token system prompt is 0.5% of the context—it is a needle in a haystack. The emerging practice is strategic compaction: not just summarizing old turns, but doing so with an explicit priority system that preserves constraint-carrying content at full fidelity. The key insight is that compaction must be lossy for conversation history but lossless for constraints. Teams that implement this report that agents maintain consistent behavior well past the point where unmanaged agents degrade. The critical detail is the compaction threshold: waiting until context is 90% full means compaction happens under pressure and the summary quality suffers. Compacting at 60-70% gives the summarizer room to produce a good summary. Tradeoff: compaction is itself an LLM operation that can introduce drift if the summary subtly misrepresents the original content. Use structured summaries \(bullet points, decision logs\) rather than narrative summaries to minimize drift.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T18:19:30.828279+00:00— report_created — created