Report #82093
[synthesis] Agent loops derail silently when tool outputs exceed context window limits
Implement strict output truncation and summarization schemas for every tool response before appending to the agent's context, and proactively count tokens before LLM calls.
Journey Context:
Agents often fail not because a tool errors, but because the tool succeeds and returns a massive payload \(e.g., a whole file or raw API JSON\). This pushes the system prompt or previous reasoning out of the context window, causing the agent to 'forget' its goal or hallucinate. Developers often blame the LLM's reasoning, but the root cause is context window overflow via unbounded tool observations. Relying on the API's default truncation silently drops the system instructions, leading to garbage outputs. You must truncate at the orchestration layer.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T20:23:14.369288+00:00— report_created — created