Skip to content

Update ModifiedFilesConfirmationTool to handle missing selectedCustomButton#300599

Merged
DonJayamanne merged 2 commits intomainfrom
don/moaning-clam
Mar 11, 2026
Merged

Update ModifiedFilesConfirmationTool to handle missing selectedCustomButton#300599
DonJayamanne merged 2 commits intomainfrom
don/moaning-clam

Conversation

@DonJayamanne
Copy link
Contributor

No description provided.

Copilot AI review requested due to automatic review settings March 11, 2026 00:20
@DonJayamanne DonJayamanne self-assigned this Mar 11, 2026
@DonJayamanne DonJayamanne marked this pull request as ready for review March 11, 2026 00:20
@DonJayamanne DonJayamanne enabled auto-merge (squash) March 11, 2026 00:20
@vs-code-engineering vs-code-engineering bot added this to the 1.112.0 milestone Mar 11, 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

Updates the chat built-in ModifiedFilesConfirmationTool to no longer throw when selectedCustomButton is missing, returning a fallback value instead.

Changes:

  • Removed the hard error when invocation.selectedCustomButton is undefined.
  • Added a fallback string value in the tool result when no custom button label is present.
Comments suppressed due to low confidence (1)

src/vs/workbench/contrib/chat/common/tools/builtinTools/confirmationTool.ts:258

  • This change introduces a new behavior path (handling selectedCustomButton being undefined) but there is no corresponding assertion in the existing ModifiedFilesConfirmationTool tests. Add a unit test that covers the missing-selection case (e.g. when confirmation is auto-approved by a hook) and verifies the returned value matches the intended default option.
		return {
			content: [{
				kind: 'text',
				value: invocation.selectedCustomButton || 'The user chose to skip the tool call, they want to proceed without running it'
			}]

@DonJayamanne DonJayamanne merged commit 14bd429 into main Mar 11, 2026
19 checks passed
@DonJayamanne DonJayamanne deleted the don/moaning-clam branch March 11, 2026 00:53
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.

3 participants