Report #39330
[synthesis] Agent loops derail silently when large tool outputs overwrite instruction context
Truncate or summarize tool outputs before injecting them back into the context window, and enforce a strict token budget per tool response.
Journey Context:
Developers often assume the LLM will naturally ignore irrelevant parts of a large tool output. However, attention mechanisms distribute focus across the entire context, meaning a massive stdout dump dilutes the attention paid to the original system prompt or plan. This leads to the agent forgetting its goal and wandering. The synthesis here is combining the concept of 'lost in the middle' in long contexts with the specific agent pattern of tool-use loops, revealing that tool output bloat is a primary driver of context poisoning, not just long conversations, and that it happens silently without any error.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T20:29:24.969518+00:00— report_created — created