GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — v2: generic tool output truncation drops the tail (skills, MCP results) · Issue #62718 · anomalyco/opencode

v2: generic tool output truncation drops the tail (skills, MCP results) #62718

New issue
Copy link
New issue
Copy link
Open
#62719
Open
v2: generic tool output truncation drops the tail (skills, MCP results)#62718
#62719
Copy link

Description

@vvvzhangshuo
vvvzhangshuo
opened on Nov 8, 2026
Issue body actions

v2: generic tool output truncation drops the tail (skills, MCP results)

Description

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

  1. Configure tool_output: { "max_lines": 10 }.
  2. Call a tool or plugin that returns 100 numbered lines (or load a SKILL.md larger than 50 KiB).
  3. 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.

Activity

  1. opencodejr commented on Nov 8, 2026

    @opencodejr
    opencodejrBot
    on Nov 8, 2026
    Contributor
    More actions

    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.

    Related issues:

    • Skill tool output is truncated at 50 KB: the tail of a large SKILL.md never reaches the model #54148: the same problem for large SKILL.md files, reported on v1
    • Figma MCP: get_design_context output truncated at 50KB → generated frontend code silently drops design data (wrong colors, missing nodes, broken layout) #35661: MCP tool output cut off at 50 KB
    • command @ 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 limits
    • tool_output config option is undocumented #45232: the tool_output option was undocumented

    I 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.

  2. udayvarmora07
    added a commit that references this issue on Nov 13, 2026

    Estimate Codex's skill-listing budget and flag skills OpenCode truncates

    f4d136f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402775 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.