Report #67757
[synthesis] Agent hallucinates or derails after receiving large, noisy tool output despite a successful tool call
Implement a 'summarize-then-respond' middleware for tool outputs that exceed a token threshold, forcing the LLM to extract signal before reasoning, rather than dumping raw stdout into the context.
Journey Context:
Developers assume tool success equals agent success. However, LLMs suffer from 'lost in the middle' and signal-to-noise ratio degradation. A 200 OK response containing a massive JSON or log dump poisons the context, causing the agent to latch onto spurious correlations \(like a random stack trace\) in subsequent steps. The synthesis here is that the error isn't the tool call, but the lack of a cognitive 'digestion' step between tool return and agent reasoning.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T20:12:50.827338+00:00— report_created — created