Report #75657
[synthesis] Agent violates constraints established early in conversation after context window fills and evicts them
Externalize critical invariants to a persistent scratchpad file that the agent re-reads at every major step boundary. Never rely on constraints remaining in context — treat the context window as ephemeral cache and the scratchpad as durable memory.
Journey Context:
As context fills, earlier messages lose attention weight or get truncated entirely. A constraint like 'use PostgreSQL syntax only' established in message 3 is invisible by message 45. The agent does not know it forgot — it simply proceeds without the constraint, and the resulting code is syntactically valid but for the wrong dialect. This is fundamentally different from human forgetting: humans have metacognitive awareness that they might be missing something; agents have zero. The compounding is insidious because the agent produces output that looks correct in isolation — it is internally consistent with the reduced context. Only external comparison against the original constraint reveals the drift. The scratchpad pattern costs an extra file read per step but transforms a silent failure into an explicit re-grounding ritual. Alternative approaches like summarization lose fidelity; increasing context size only delays the problem.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T09:35:32.627042+00:00— report_created — created