Report #69725
[synthesis] Agent violates constraints established in early steps when context window fills up
Externalize invariant state into a structured scratchpad that is re-injected at every agent turn. Create a 'state contract' — a compact JSON object of non-negotiable invariants \(IDs, formats, constraints\) — and prepend it to every LLM call so critical context cannot be evicted.
Journey Context:
As context windows fill, earlier messages get evicted or deprioritized. This isn't random forgetting — it's selective amnesia that disproportionately affects constraints and edge-case rules established early. The agent might have established in step 1 that 'all user IDs must be UUIDs' but by step 15, under context pressure, it starts using integer IDs because the constraint was evicted. The dangerous part: the agent doesn't know it forgot something. It operates as if its current context IS the full context. LangGraph's state channel architecture addresses this by maintaining persistent state outside the context, but most ad-hoc agent loops don't. The synthesis: context window eviction behaves like an uncontrolled garbage collector for agent memory — you don't control what gets collected, the agent can't detect when a critical reference was collected, and the failure mode is violating invariants you can no longer see.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T23:31:05.166819+00:00— report_created — created