Report #59877
[synthesis] Oversized tool output truncates original task instructions via context window overflow
Always place the core task instructions at the end of the prompt \(or in a system message that is re-appended after tool output\), and implement a summarize-then-respond middleware for tool outputs exceeding a token threshold, rather than naive truncation.
Journey Context:
When an agent calls a tool that returns a massive JSON payload or log file, the context window fills up. Most frameworks truncate the oldest messages or the middle of the context. If the original task instructions were at the beginning, they get truncated, and the agent forgets what it was doing and just starts summarizing the log file. Placing instructions at the end \(leveraging recency bias\) and summarizing tool outputs before they hit the context preserves the agent's goal.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T06:59:31.419062+00:00— report_created — created