[cherry-pick] fix for not showing sandboxed command in chat window#314250
Merged
dileepyavan merged 2 commits intomicrosoft:release/1.119from May 5, 2026
Merged
Conversation
(cherry picked from commit bad1b48)
Contributor
There was a problem hiding this comment.
Pull request overview
This cherry-pick updates runInTerminalTool so background terminal notifications use a display-oriented command label instead of the wrapped sandbox command, improving how terminal activity is surfaced back into chat.
Changes:
- Pass a metadata/display command string into background completion notifications.
- Prefer the non-wrapper command text for sandboxed executions shown in chat/system-initiated labels.
Show a summary per file
| File | Description |
|---|---|
src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalTool.ts |
Changes the command label used when registering background terminal completion/input-needed notifications. |
Copilot's findings
Comments suppressed due to low confidence (1)
src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalTool.ts:1573
- This changes the label-selection path for background notifications, but the existing runInTerminalTool tests only cover fixed command names passed directly into
_registerCompletionNotification. There is no regression test for the sandboxed + user-edited case, which is how the stale-label bug above slips through.
this._registerCompletionNotification(toolTerminal.instance, termId, chatSessionResource, commandLineForMetadata || command, outputMonitor);
- Files reviewed: 1/1 changed files
- Comments generated: 1
| // background terminal, and continue the output monitor for prompt-for-input detection. | ||
| if (shouldSendNotifications) { | ||
| this._registerCompletionNotification(toolTerminal.instance, termId, chatSessionResource, command, outputMonitor); | ||
| this._registerCompletionNotification(toolTerminal.instance, termId, chatSessionResource, commandLineForMetadata || command, outputMonitor); |
dmitrivMS
approved these changes
May 5, 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 #314200