Skip to content

In sandbox mode for chatUI, the command should be displayed without sandbox command and environment variables#291395

Merged
dileepyavan merged 1 commit intomainfrom
DileepY/sandbox_chat_ui
Jan 29, 2026
Merged

In sandbox mode for chatUI, the command should be displayed without sandbox command and environment variables#291395
dileepyavan merged 1 commit intomainfrom
DileepY/sandbox_chat_ui

Conversation

@dileepyavan
Copy link
Copy Markdown
Member

@dileepyavan dileepyavan commented Jan 28, 2026

fixes:#291672
Before the change:
image

After the change:

image

Copilot AI review requested due to automatic review settings January 28, 2026 20:40
@vs-code-engineering vs-code-engineering bot added this to the January 2026 milestone Jan 28, 2026
Copy link
Copy Markdown
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

This pull request implements a feature to display commands in the chat UI without sandbox wrapper and environment variables when running terminal commands through the agent in sandbox mode. The PR addresses issue #277286 by introducing a forDisplay field that carries the user-friendly command representation through the rewriter pipeline while the actual sandboxed command is executed in the terminal.

Changes:

  • Added optional forDisplay field to command line rewriter result interface to support alternate display text
  • Modified CommandLineSandboxRewriter to set forDisplay to the pre-sandbox command for cleaner UI display
  • Updated chat UI to prioritize forDisplay when rendering terminal commands to users

Reviewed changes

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

Show a summary per file
File Description
src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLineRewriter.ts Added optional forDisplay field to ICommandLineRewriterResult interface
src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLineSandboxRewriter.ts Sets forDisplay to the input command (before sandbox wrapping) so chat UI shows clean command
src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalTool.ts Tracks forDisplay through the rewriter chain and stores it in tool-specific data
src/vs/workbench/contrib/chat/common/chatService/chatService.ts Added forDisplay field to IChatTerminalToolInvocationData interface for chat service data model
src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatTerminalToolProgressPart.ts Updated command display logic to prioritize forDisplay field with highest precedence

Comment thread src/vs/workbench/contrib/chat/common/chatService/chatService.ts
Copy link
Copy Markdown
Contributor

@Tyriar Tyriar left a comment

Choose a reason for hiding this comment

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

You need to link an actual issue to this PR labelled bug so that the change gets verified before we release.

@dileepyavan
Copy link
Copy Markdown
Member Author

dileepyavan commented Jan 29, 2026

You need to link an actual issue to this PR labelled bug so that the change gets verified before we release.

Updated, created a new bug: #291672 and attached the same to this pr

@dileepyavan dileepyavan requested a review from Tyriar January 29, 2026 17:25
@dileepyavan dileepyavan merged commit 9fbb7b8 into main Jan 29, 2026
27 of 28 checks passed
@dileepyavan dileepyavan deleted the DileepY/sandbox_chat_ui branch January 29, 2026 21:15
@vs-code-engineering vs-code-engineering bot locked and limited conversation to collaborators Mar 15, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants