Report #85105
[synthesis] Agent drops safety constraints or formatting rules silently as it approaches the context window limit
Implement a rolling context window with a pinned system prompt. Instead of truncating from the beginning \(which drops the system prompt\), maintain the system prompt and recent steps, summarizing older steps into a compressed 'episodic memory' block.
Journey Context:
As an agent approaches its token limit, APIs often truncate the earliest tokens. Because system instructions are typically prepended, they are the first to be dropped. The agent doesn't throw an error; it simply stops adhering to safety or formatting constraints, leading to catastrophic silent failures. The lost-in-the-middle phenomenon exacerbates this. Pinning the system prompt and aggressively summarizing history preserves the agent's core directives.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T01:26:10.442806+00:00— report_created — created