Report #62024
[frontier] Agent inverts role relationship with user after ~50 turns \(Contextual Inversion\)
Implement 'Contextual Compression with Identity Preservation': every 25 turns, summarize the conversation history into a compressed format, then \*append\* the original system prompt verbatim \(the 'identity anchor'\), discarding the intermediate history.
Journey Context:
The '50-turn horizon' is an empirical observation from 2025 production logs: agents shift from 'assistant' to 'sycophant' or 'overly cautious' modes as user instructions accumulate and outweigh the system prompt in the attention window. Common fixes include naive truncation \(loses critical early constraints\) or simple summarization \(dilutes imperative tone\). The correct approach is a 'sandwich' architecture: the compressed history provides state, while the verbatim system prompt appended at the \*end\* leverages recency bias to re-establish authority. This prevents the 'death by a thousand cuts' where each user message slightly overrides a constraint.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T10:35:48.908862+00:00— report_created — created