Skip to content

In sandbox mode, the command executed is not shown in the tool output#302935

Merged
dileepyavan merged 2 commits intomainfrom
DileepY/terminal_tool_output
Mar 18, 2026
Merged

In sandbox mode, the command executed is not shown in the tool output#302935
dileepyavan merged 2 commits intomainfrom
DileepY/terminal_tool_output

Conversation

@dileepyavan
Copy link
Member

fixes(#302907 )

Copilot AI review requested due to automatic review settings March 18, 2026 18:14
@dileepyavan dileepyavan enabled auto-merge (squash) March 18, 2026 18:15
@dileepyavan dileepyavan disabled auto-merge March 18, 2026 18:15
@vs-code-engineering vs-code-engineering bot added this to the 1.113.0 milestone Mar 18, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Removes sandbox-specific “command was rewritten” messaging from run_in_terminal tool output by tracking when a command line was wrapped for sandbox execution, so the chat/tool transcript doesn’t expose the sandbox wrapper command.

Changes:

  • Add an isSandboxWrapped flag to command-line rewriter results and propagate it through terminal tool invocation data.
  • Mark sandbox-wrapped commands in CommandLineSandboxRewriter.
  • Suppress rewritten-command “Note:” prefixes in RunInTerminalTool when the command was sandbox-wrapped.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalTool.ts Tracks sandbox wrapping and suppresses rewritten-command notes in tool output.
src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLineSandboxRewriter.ts Sets isSandboxWrapped: true when sandbox wrapping is applied.
src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLineRewriter.ts Extends rewriter result shape to include isSandboxWrapped.
src/vs/workbench/contrib/chat/common/chatService/chatService.ts Extends terminal tool invocation data with isSandboxWrapped.
Comments suppressed due to low confidence (1)

src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalTool.ts:947

  • These strings include an extra backslash after the newline escape (\n\ The ...), which will render a literal \ in the tool output. This looks accidental and makes the output harder to read; remove the stray backslash so the message starts on the next line cleanly.
				if (pollingResult && pollingResult.modelOutputEvalResponse) {
					resultText += `\n\ The command became idle with output:\n${pollingResult.modelOutputEvalResponse}`;
				} else if (pollingResult) {
					resultText += `\n\ The command is still running, with output:\n${pollingResult.output}`;
				}

You can also share your feedback on Copilot code review. Take the survey.

dmitrivMS
dmitrivMS previously approved these changes Mar 18, 2026
@dileepyavan dileepyavan merged commit 9b45522 into main Mar 18, 2026
19 checks passed
@dileepyavan dileepyavan deleted the DileepY/terminal_tool_output branch March 18, 2026 21:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants