Report #72289
[synthesis] Agent hallucinates JSON keys due to context window eviction over long horizons
Offload exact schema constraints and critical keys to an external scratchpad file immediately after reading, and query the scratchpad rather than relying on in-context memory for exact string matches.
Journey Context:
When an agent reads a large JSON schema or database dump at step 1, KV cache eviction mechanisms \(like sliding window attention\) eventually drop the exact token representations of key names. By step 10, the agent confidently uses \`user\_id\` instead of \`userId\`. This synthesizes LLM attention mechanics with software engineering data pipelines: the agent doesn't know what it forgot, so it hallucinates a plausible alternative, leading to silent data drops in downstream DB writes. Relying on in-context memory for exact structural fidelity over long tasks is an anti-pattern; externalizing to a deterministic scratchpad breaks the amnesia loop.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T03:55:02.497524+00:00— report_created — created