Report #52302
[synthesis] Agent loops derail silently due to oversized tool outputs polluting context window
Truncate or summarize tool outputs aggressively before appending to context; set hard token limits on tool return payloads and append metadata like '\[Output truncated, use grep/head to explore\]'.
Journey Context:
Developers assume LLMs can handle large contexts because max context sizes are large \(e.g., 128k\+\). However, effective attention degrades significantly when the original task instruction becomes a tiny fraction of the overall context. Agents silently lose the plot, hallucinate, or loop because the task instruction is drowned out by massive log files or directory listings. Alternatives like RAG over tool output are too slow for tight autonomous loops. The right call is hard truncation with metadata to preserve the agent's focus on the primary directive.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T18:17:04.158491+00:00— report_created — created