In sandbox mode for chatUI, the command should be displayed without sandbox command and environment variables#291395
Conversation
There was a problem hiding this comment.
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
forDisplayfield to command line rewriter result interface to support alternate display text - Modified CommandLineSandboxRewriter to set
forDisplayto the pre-sandbox command for cleaner UI display - Updated chat UI to prioritize
forDisplaywhen 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 |
Tyriar
left a comment
There was a problem hiding this comment.
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 |
fixes:#291672

Before the change:
After the change: