Skip to content

fix bypass approvals skipping "copy changes" confirmation widget#302184

Merged
justschen merged 1 commit intomainfrom
justin/beheeyem
Mar 16, 2026
Merged

fix bypass approvals skipping "copy changes" confirmation widget#302184
justschen merged 1 commit intomainfrom
justin/beheeyem

Conversation

@justschen
Copy link
Collaborator

fix #302182

  • fix issue where if you have exisiting changes in worktree CLI, when you are in bypass approvals, nothing happens

Copilot AI review requested due to automatic review settings March 16, 2026 17:19
@vs-code-engineering vs-code-engineering bot added this to the 1.112.0 milestone Mar 16, 2026
Copy link
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

Fixes an issue in the chat tool auto-approval flow where “Bypass Approvals” could skip required multi-option confirmation UI for Copilot CLI/background sessions, resulting in no “copy changes” confirmation being shown.

Changes:

  • Update tool auto-confirm logic to not bypass confirmation for specific “cannot be auto-approved” tools when the session is non-local.
  • Add tests covering the CLI vs local-session behavior for these non-auto-approvable tools.

Reviewed changes

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

File Description
src/vs/workbench/contrib/chat/browser/tools/languageModelToolsService.ts Adds a session-type gate so certain tools still require confirmation UI under Bypass Approvals for non-local sessions.
src/vs/workbench/contrib/chat/test/browser/tools/languageModelToolsService.test.ts Adds coverage to ensure CLI sessions require confirmation while local sessions still auto-approve under Bypass Approvals.
Comments suppressed due to low confidence (1)

src/vs/workbench/contrib/chat/browser/tools/languageModelToolsService.ts:1177

  • Same as above: this check keys off getChatSessionType(...) !== localChatSessionType, which applies to all non-local session types (not just CLI/background). If the special-casing is intended only for CLI sessions, it would be safer/clearer to gate on the explicit CLI session type; otherwise adjust the comment/naming to match the broader scope.
			if (isAutoApproveLevel(request?.modeInfo?.permissionLevel) || this._isSessionLiveAutoApproveLevel(chatSessionResource)) {
				if (!(toolIdsThatCannotBeAutoApproved.has(toolId) && getChatSessionType(chatSessionResource) !== localChatSessionType)) {
					return { type: ToolConfirmKind.ConfirmationNotNeeded, reason: 'auto-approve-all' };
				}

You can also share your feedback on Copilot code review. Take the survey.

@justschen justschen enabled auto-merge (squash) March 16, 2026 17:29
@justschen justschen merged commit 606a534 into main Mar 16, 2026
24 checks passed
@justschen justschen deleted the justin/beheeyem branch March 16, 2026 18:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bypass approvals skips confirmation in CLI

3 participants