In sandbox mode, the command executed is not shown in the tool output#302935
Merged
dileepyavan merged 2 commits intomainfrom Mar 18, 2026
Merged
In sandbox mode, the command executed is not shown in the tool output#302935dileepyavan merged 2 commits intomainfrom
dileepyavan merged 2 commits intomainfrom
Conversation
Contributor
There was a problem hiding this comment.
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
isSandboxWrappedflag 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
RunInTerminalToolwhen 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.
src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalTool.ts
Outdated
Show resolved
Hide resolved
...rminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLineSandboxRewriter.ts
Show resolved
Hide resolved
dmitrivMS
previously approved these changes
Mar 18, 2026
0116405 to
ce4e408
Compare
dmitrivMS
approved these changes
Mar 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fixes(#302907 )