Report #78966
[synthesis] Agent forgets core constraints midway through a long coding task
Separate the agent's scratchpad \(thoughts/actions\) from the directive context \(rules/constraints\), and dynamically re-inject the directive context at the end of the prompt if the scratchpad exceeds 50% of the context window.
Journey Context:
It is common to put all constraints in the system prompt. But in long agentic runs, the scratchpad of intermediate steps grows. Transformers weight recency and locality heavily. Once the scratchpad becomes massive, the original constraints in the system prompt suffer attention decay. The agent doesn't error out; it just silently drops the Python 3.8 constraint and writes Python 3.12 code. Moving constraints to the end \(recency\) or dynamically re-inserting them is the only fix.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T15:08:12.460268+00:00— report_created — created