Report #29719
[synthesis] Context Window Overflow from Tool Outputs: Agent calls a tool that returns massive output \(e.g., reading a 10,000 line log file\), overflowing the context window and truncating the original system prompt or early reasoning steps, causing amnesia.
Tools must implement output truncation or summarization before returning to the agent. Define a maximum token length for tool outputs and return a summarized version with a read specific lines affordance.
Journey Context:
Agents are greedy for context. If they need to debug an error, they will cat the entire log file. This destroys the context window, pushing out the system instructions \(like you are a helpful agent\) and the original goal. The agent then forgets what it was doing and hallucinates a new goal or fails. The fix is to treat tool outputs as potentially hostile to the context window and enforce strict size limits at the tool interface layer.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T04:16:22.906908+00:00— report_created — created