Report #83273
[frontier] Agent loses original instructions when context window fills and older messages are evicted
Implement 'sticky context': ensure the system prompt and constitutional constraints are never evicted. If your framework doesn't support non-evictable messages, detect eviction events and immediately re-inject a compressed identity\+constraints summary. Never let the system prompt be the first message evicted. Use APIs that separate system prompts from conversation history.
Journey Context:
Most production agent frameworks handle context overflow by evicting the oldest messages first. The system prompt—typically message zero—is the first to go. Once evicted, the agent operates without its original instructions and drifts rapidly. The common mistake is assuming the framework handles this correctly—most don't. Anthropic's API keeps the system prompt separate from conversation history, which prevents this specific failure mode, but many custom frameworks and open-source toolchains don't. If you're managing context yourself, you must handle eviction explicitly. Three options: \(1\) use an API that separates system prompts, \(2\) implement non-evictable message flags in your context manager, \(3\) detect eviction and re-inject. Option 3 is the most portable and is what most production teams implement in 2025—the re-injected summary should be compressed to minimize token cost while preserving identity and hard constraints.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T22:21:38.039715+00:00— report_created — created