Report #52718
[frontier] Agent forgets system instructions in long sessions despite clear system prompt
Re-inject critical constraints at both the beginning AND near the end of the context window using bookend prompting—place a condensed identity/constraint summary as a recent user or system message before the agent's turn when context exceeds ~50% of the window.
Journey Context:
The 'Lost in the Middle' phenomenon demonstrates that LLMs exhibit U-shaped attention: they attend strongly to the beginning and end of context but lose fidelity in the middle. As conversation grows, the system prompt at position 0 gets attention-diluted. Teams initially tried making system prompts longer and more detailed, which paradoxically made drift worse by increasing competition for attention. The counterintuitive fix is redundancy: a short, high-signal constraint restatement near the context tail outperforms a single comprehensive system prompt at the head. The tradeoff is token cost and slight repetition, but behavioral consistency gains far outweigh this.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T18:59:12.078034+00:00— report_created — created