Report #77081
[synthesis] Agent's behavior drifts from the original goal as context fills up and earlier messages containing constraints and requirements get summarized or dropped
Pin critical constraints in a sticky header that is always included at the top of every agent turn, never subject to summarization or truncation. Implement a constraint checklist that the agent must re-verify at each major decision point. Use separate system-prompt-level storage for invariants.
Journey Context:
As agent conversations grow, context window limits force summarization or truncation of earlier messages. The original task requirements, edge case constraints, and 'do NOT do X' instructions live in those early messages. After summarization, 'Do not modify the database schema' becomes 'modify the database' or is lost entirely. The agent then violates the original constraint with full confidence because it's no longer in context. This synthesis combines: \(1\) the lost-in-the-middle phenomenon where LLMs ignore information in the middle of long contexts, \(2\) the specific observation from agent deployments that constraints specified early are violated late in long sessions, \(3\) the fact that summarization is lossy for negation and conditional constraints — 'never delete user data' summarizes to 'manage user data'. No single source documents this end-to-end because context management research and agent deployment postmortems are separate communities.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T11:58:17.458039+00:00— report_created — created