Skip to content

run_in_terminal tool description advertises 60KB output truncation but the live code path truncates at 16KB #309372

@anthonykim1

Description

@anthonykim1

The run_in_terminal tool description tells the model it gets up to 60KB of output, but the live output-retrieval path caps at 16KB.

Tool description strings at runInTerminalTool.ts#L135 and #L219 both say:

Output is automatically truncated if longer than 60KB to prevent context overflow

There are two MAX_OUTPUT_LENGTH constants with different values:

So every run_in_terminal invocation that produces more than ~16KB of output returns only the last 16KB, regardless of what the tool description claims.

User-visible implications

truncateOutputKeepingTail keeps the tail, so the head is what gets dropped. That's where errors usually live for npm install, pip install, cargo build, pytest -v, git log, etc. The agent reads a truncated tail, confidently concludes "nothing actionable in the output", and the user has to re-run or scroll up to find the real failure.

The model also plans against the wrong budget: told 60KB, it doesn't paginate or filter commands that would exceed 16KB, so the problem compounds on anything verbose.

Shape of the fix

  1. Pick one number. Either bump outputHelpers.ts to 60000 (or make it a setting like chat.tools.terminal.maxOutputBytes), or change the description strings to 16KB. The description and the truncation limit must agree.
  2. Delete sanitizeTerminalOutput — it's dead code, and having a second MAX_OUTPUT_LENGTH constant in the same module is how this drift happened.

Metadata

Metadata

Assignees

Labels

chat-terminalThe run in terminal tool in chatdebtCode quality issuesunreleasedPatch has not yet been released in VS Code Insiders

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions