Report #9820
[gotcha] Agent reasons over incomplete data after tool result silently truncates context window
Always bound tool output size. Implement result summarization or truncation with explicit indicators like '\[Result truncated: showing first N of M items\]'. Return metadata about total result size so the model knows data was omitted and can request more.
Journey Context:
A tool query returns thousands of rows or a massive file. The result gets injected into the context, but when the total context exceeds the window limit, the API silently truncates—usually from the oldest messages first, eating the system prompt or earlier conversation turns. The model then reasons over a fragment without knowing it is incomplete, producing confidently wrong answers. This is particularly dangerous with database query tools, file-read tools on large files, or log-search tools. The model will not say 'I seem to be missing data' because it has no signal that truncation occurred. The fix requires proactive design at the tool level: paginate results, summarize, and always embed a truncation sentinel in the output so the model can detect and report incompleteness.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T09:12:33.279910+00:00— report_created — created