Fix user-edited terminal commands being ignored in confirmation UI#307433
Draft
Fix user-edited terminal commands being ignored in confirmation UI#307433
Conversation
…mTerminalCommandTool 1. Add userEditedInput field to ISessionToolCallApprovedAction protocol 2. Update reducer to use userEditedInput when present 3. Send userEditedInput in agentHostSessionHandler's _awaitToolConfirmation 4. Return user-edited command in ConfirmTerminalCommandTool.invoke() result 5. Add tests for ConfirmTerminalCommandTool user-edit behavior Agent-Logs-Url: https://github.com/microsoft/vscode/sessions/a1ae137d-c533-4696-b7fe-4e2580ce340b Co-authored-by: meganrogge <29464607+meganrogge@users.noreply.github.com>
Agent-Logs-Url: https://github.com/microsoft/vscode/sessions/a1ae137d-c533-4696-b7fe-4e2580ce340b Co-authored-by: meganrogge <29464607+meganrogge@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix issue with editing commit message in sessions
Fix user-edited terminal commands being ignored in confirmation UI
Apr 2, 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.
When a user edits a terminal command in the chat confirmation widget (e.g. changing a commit message) and clicks Allow, the original unedited command was executed instead. Two root causes:
Agent Host sessions:
SessionToolCallConfirmedaction only sentapproved: trueto the server — the user-edited command text was never included. The server continued executing the originaltoolInput.ConfirmTerminalCommandTool:invoke()returned a bare'yes'string, discarding the user edit. The LM then calledRunInTerminalToolwith the original command from its parameters.Changes
ISessionToolCallApprovedAction— added optionaluserEditedInputfield to the protocol action typesessionReducer— useaction.userEditedInput ?? tc.toolInputwhen transitioning tool call toRunningagentHostSessionHandler._awaitToolConfirmation— extractcommandLine.userEditedfromtoolSpecificDataand include it in the dispatched confirmation actionConfirmTerminalCommandTool.invoke()— whenuserEditeddiffers fromoriginal, return the edited command in the result so the LM uses it for subsequent executionNote: The
RunInTerminalTool.invoke()path already correctly prioritizesuserEditedviatoolSpecificData.commandLine.userEdited ?? toolEdited ?? original— that flow was not broken.Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
redirector.gvt1.com/proc/self/exe /proc/self/exe --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=none --no-sandbox --crashpad-handler-pid=8484 --enable-crash-reporter=33d8f196-36d4-433c-9345-98f01e12f298,no_channel --user-data-dir=/tmp/vscode-tests-1775148836363 --shared-files=v8_context_snapshot_data:100 --field-trial-handle=3,i,9699356955558524326,2821434709459238297,262144 --enable-features=PdfUseShowSaveFilePicker --disable-features=LocalNetworkAccessChecks,ScreenAIOCREnabled,SpareRendererForSitePerProcess,TraceSiteInstanceGetProcessCreation --variations-seed-version --trace-process-track-uuid=3190708989122997041 bash k/vscode/vscode/git .ts k/vscode/vscode/--name-only eaderValidation.HEAD(dns block).build/electron/code-oss .build/electron/code-oss test/unit/electron/index.js --crash-reporter-directory=/home/REDACTED/work/vscode/vscode/.build/crashes --run src/vs/workbench/contrib/terminalContrib/chatAgentTools/test/electron-browser/runInTerminalTool.test.ts --grep ConfirmTerminalCommandTool --timeout 30000 k/vscode/vscode/./scripts/test.sh k/vscode/vscode/--run k/vscode/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/test/electron-browser/runInTerminalTool.test.ts k/vs�� k/vscode/vscode/ConfirmTerminalCommandTool k/vscode/vscode/--timeout rgo/bin/bash k/vscode/vscode/git .ts k/vscode/vscode/--name-only eaderValidation.HEAD(dns block)/proc/self/exe /proc/self/exe --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=none --no-sandbox --crashpad-handler-pid=10473 --enable-crash-reporter=33d8f196-36d4-433c-9345-98f01e12f298,no_channel --user-data-dir=/tmp/vscode-tests-1775149058336 --shared-files=v8_context_snapshot_data:100 --field-trial-handle=3,i,7937307963620496307,2974062484487749855,262144 --enable-features=PdfUseShowSaveFilePicker --disable-features=LocalNetworkAccessChecks,ScreenAIOCREnabled,SpareRendererForSitePerProcess,TraceSiteInstanceGetProcessCreation --variations-seed-version --trace-process-track-uuid=3190708989122997041 k/vscode/vscode/--inlineSources b/chat/test/brownode -lname ache/node/22.22.--project node(dns block)If you need me to access, download, or install something from one of these locations, you can either: