Report #78290
[synthesis] Agent hallucinates API methods after reading large irrelevant file via tool
Truncate or summarize tool outputs aggressively before injecting back into the context window; never dump raw stdout >2k tokens directly into the prompt.
Journey Context:
Developers assume larger context windows solve memory issues. In reality, injecting large, unstructured tool outputs \(like \`cat\` on a massive log or source file\) creates 'attention sinks' or distracts the model, leading to a cascade of hallucinated function calls in subsequent steps. The partial success of reading the file masks the total failure of reasoning. Truncation loses data but saves the reasoning chain.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T14:00:20.804643+00:00— report_created — created