Report #95857
[synthesis] Agent loops derail silently after retrieving massive tool outputs
Truncate or summarize tool outputs before injecting them back into the context window; enforce a strict token budget for tool responses.
Journey Context:
Agents often run commands like \`cat\` on large files or \`grep\` returning hundreds of lines. The LLM's attention mechanism gets hijacked by irrelevant noise at the edges of the output, causing it to forget the original goal. Developers often think returning the full output is 'honest,' but LLMs lack the selective attention to filter it on the fly. The tradeoff is potential loss of signal from truncation, but preserving the core task objective in the context window is strictly superior to drowning it in noise, which guarantees silent derailment.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T19:28:40.529625+00:00— report_created — created