Skip to content

bug(core): Shell ignores tools.truncateToolOutputThreshold #8922

Description

@cxruan

What happened?

The official settings documentation says tools.truncateToolOutputThreshold applies to Shell. However, Shell currently uses a fixed 30,000-character budget that takes precedence over the configured value.

As a result, a 40,000-character Shell result is truncated even when the threshold is configured as 100,000.

How to reproduce

  1. Add the following settings and restart Qwen Code:

    {
      "tools": {
        "truncateToolOutputThreshold": 100000,
        "truncateToolOutputLines": 100000
      }
    }
  2. Run this command with Shell:

    node -e "process.stdout.write('x'.repeat(40000))"
  3. Inspect the model-facing Shell result or chat record. The result is truncated and contains:

    Tool output was too large and has been truncated.
    

Depending on the client surface, the visible output may instead show that the full output was saved to a file.

What did you expect to happen?

Shell should honor tools.truncateToolOutputThreshold. If 30,000 characters is an intentional hard limit, the settings documentation should explain that the configured threshold cannot override it for Shell.

Client information

  • Qwen Code: 0.21.8
  • Node.js: v24.14.1
  • Platform: macOS arm64

Anything else we need to know?

Reproduced with the configuration and command above. The full saved output was approximately 40 KB.

On current main (7ebd137edb7e48af1ffd447f1ed7a9bb1ed53799 when verified), Shell passes threshold: 30_000 to the truncation helper, while the helper gives the per-call threshold precedence over config.getTruncateToolOutputThreshold().

The fixed per-tool budget appears to have been introduced by #4880. Related broader tracking issues include #2818 and #7306.

Activity

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

Metadata

Metadata

Assignees

Labels

category/toolsTool integration and executionpriority/P2Medium - Moderately impactful, noticeable problemscope/settingsSettings and preferencesscope/shellShell command executiontype/bugSomething isn't working as expected

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions