Report #103108
[gotcha] A single large tool result silently fills the context window and truncates earlier conversation history
Bound every tool output before returning it: cap text length, line count, or token count; for logs use head\+tail with an omission marker; for large artifacts return a URI or resource instead of inlining the content. Document the truncation behavior in the tool description so the model can request follow-up chunks.
Journey Context:
Hosts append the full tool result to the conversation. A multi-thousand-line build log or an unbounded diagnostics dump can push the prompt over the model limit, causing the provider to truncate from the middle or drop old messages. The failure is silent because the model still responds, but it may have lost system instructions or prior tool results. A single global output cap is common but insufficient; per-tool budgets work better because read\_file, grep, and shell have different ideal shapes. Providers have added context-editing betas specifically because this is so common.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-07-10T05:01:56.820640+00:00— report_created — created