You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a tool result exceeds tool_output (default 2,000 lines / 50 KiB), ToolOutput.truncate keeps only the first lines. Everything after the cut never reaches the model.
Shell output already keeps the end: packages/core/src/shell.ts pages from size - maxBytes and reports the last line range. Other tools keep the start. That asymmetry is the problem:
a large SKILL.md whose final checklist or "do not" rules sit at the bottom
an MCP tool whose result field is at the end of a long pretty-printed response
a long build log where the error is in the last few lines
The marker does tell the model that the full output was saved to a file, but in practice it often continues without reading it.
This is the same shape as #54148 (closed as not_planned because it was reported on v1; the bot asked for a v2 report and a link back). Related: #35661 (MCP output truncated at 50 KB). Reproduces on current dev.
Steps to reproduce
Configure tool_output: { "max_lines": 10 }.
Call a tool or plugin that returns 100 numbered lines (or load a SKILL.md larger than 50 KiB).
The model receives lines 1-10 plus the marker; lines 11-100 never reach it.
OpenCode version
0.0.0-dev (v2 dev @ da8c0211f7)
Operating System
Linux
Terminal
Konsole
Suggested direction
Keep both ends instead of only the head:
head and tail share max_lines
the marker keeps line ranges, e.g. [showing lines 1-5 and 96-100 of 100; ...], so it still matches read's offset
attachments keep their original relative position
the full output is still written to the retained file
If generic head+tail is unwanted, a narrower option is to keep the tail only for MCP/skill results, but the generic truncation path is where the loss happens.
Thanks for the detailed write-up, and for linking back to #54148!
You're asking for generic tool-output truncation in v2 to keep both the start and the end of an oversized result, not just the start. That way the end of a large SKILL.md, an MCP response or a build log still reaches the model, and the marker still shows line ranges that match read's offset.
Right now ToolOutput.truncate keeps the first lines on purpose. It saves the full output to a file and adds a marker pointing to it, so this is a change to how truncation is designed rather than a bug. It's a reasonable one, especially since shell output already keeps the end. I've marked it as a feature request for the maintainers to consider, along with your PR #62719.
Activity
opencodejr commentedon Nov 8, 2026
Thanks for the detailed write-up, and for linking back to #54148!
You're asking for generic tool-output truncation in v2 to keep both the start and the end of an oversized result, not just the start. That way the end of a large
SKILL.md, an MCP response or a build log still reaches the model, and the marker still shows line ranges that matchread's offset.Right now
ToolOutput.truncatekeeps the first lines on purpose. It saves the full output to a file and adds a marker pointing to it, so this is a change to how truncation is designed rather than a bug. It's a reasonable one, especially since shell output already keeps the end. I've marked it as a feature request for the maintainers to consider, along with your PR #62719.Related issues:
SKILL.mdfiles, reported on v1@includes go through the Read tool's 50 KB, 2000-line and 2000-character caps, with no config key #54007:@includes are capped by the same 50 KB / 2000-line limitstool_outputoption was undocumentedI don't think a plugin can do this today, because I couldn't find a plugin hook that changes a tool's result before it is truncated.
Estimate Codex's skill-listing budget and flag skills OpenCode truncates