Fix terminal command edits ignored in two-step confirmation flow#309908
Merged
meganrogge merged 4 commits intomainfrom Apr 14, 2026
Merged
Fix terminal command edits ignored in two-step confirmation flow#309908meganrogge merged 4 commits intomainfrom
meganrogge merged 4 commits intomainfrom
Conversation
When using the two-step confirmation flow (ConfirmTerminalCommandTool followed by RunInTerminalTool), user edits to terminal commands were silently discarded because invoke() always returned a static 'yes'. Now the invoke() method checks toolSpecificData.commandLine.userEdited and returns the edited command in the result, allowing the agent to use the correct command when executing. Agent-Logs-Url: https://github.com/microsoft/vscode/sessions/664f7dc6-81de-42c9-ab62-74741a8bf022 Co-authored-by: meganrogge <29464607+meganrogge@users.noreply.github.com>
…ool tests Agent-Logs-Url: https://github.com/microsoft/vscode/sessions/664f7dc6-81de-42c9-ab62-74741a8bf022 Co-authored-by: meganrogge <29464607+meganrogge@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix terminal command edits being ignored in Claude Agent SDK
Fix terminal command edits ignored in two-step confirmation flow
Apr 14, 2026
meganrogge
approved these changes
Apr 14, 2026
Contributor
Contributor
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Fixes the two-step terminal confirmation flow so edits made during confirmation are returned from ConfirmTerminalCommandTool.invoke() and can be used in the follow-up run_in_terminal execution.
Changes:
- Return an edited command from
ConfirmTerminalCommandTool.invoke()whentoolSpecificData.commandLine.userEditeddiffers from the original. - Update the confirmation tool’s “approved” response from a static
'yes'to a descriptive message. - Add tests covering invoke behavior for (a) no edit, (b) edited command, and (c) edit equals original.
Show a summary per file
| File | Description |
|---|---|
| src/vs/workbench/contrib/terminalContrib/chatAgentTools/test/electron-browser/runInTerminalTool.test.ts | Adds invoke tests for the confirmation tool covering command edit/no-edit scenarios. |
| src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalConfirmationTool.ts | Returns an edited command in the tool result when the user modifies it during confirmation. |
Copilot's findings
- Files reviewed: 2/2 changed files
- Comments generated: 6
meganrogge
approved these changes
Apr 14, 2026
joshspicer
approved these changes
Apr 14, 2026
Member
|
@joshspicer @meganrogge reverted, see #310702 |
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.
ConfirmTerminalCommandTool.invoke()returned a static'yes'regardless of whether the user edited the command during confirmation. Agents using the two-step flow (confirm → execute) never saw the edited command and always ran the original.runInTerminalConfirmationTool.ts: ReadtoolSpecificData.commandLine.userEditedininvoke()and return the edited command in the tool result when it differs from the original, so the agent can pass it to the subsequentrun_in_terminalcall.runInTerminalTool.test.ts: Add tests for the three invoke cases: no edit, user edit, and edit-equals-original (no-op).