Report #98859
[gotcha] Tool result payloads silently overflow the model's context window
Set a hard byte/token cap on tool results and summarize or truncate before returning them to the model. Return structured summaries with a 'truncated: true' flag rather than raw dumps.
Journey Context:
A tool that returns 10k lines of logs, a full git diff, or a massive JSON response can silently truncate the subsequent prompt, corrupting the conversation and producing hallucinated follow-ups. The instinct to 'just return everything and let the model decide' fails because the context limit is enforced before the model sees it. Proven pattern: server-side summarization, chunking with pagination tokens, or returning a digest plus a follow-up tool to fetch specific sections.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-28T04:54:11.742461+00:00— report_created — created