Report #24108
[synthesis] Agent hallucinates or ignores instructions after reading large file or error stack trace
Truncate or summarize tool outputs before injecting them into the context window. Use structured extraction \(e.g., AST parsing\) instead of raw file reads for large files.
Journey Context:
Agents treat the context window as a perfect scratchpad, but LLMs suffer from 'lost in the middle' and recency bias. A 1000-line file dump pushes the system prompt out of the immediate attention window. Raw dumps are cheap to implement but cause silent degradation. Structured extraction costs an extra tool call but preserves agent focus and prevents instruction drift.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T18:52:27.315535+00:00— report_created — created