Proposal for tool combination approval#302395
Conversation
Adds support for approving a specific tool + args combination Part of #302393
There was a problem hiding this comment.
Pull request overview
Adds a new proposed API and corresponding workbench support to let users approve (and later auto-confirm) a specific tool + argument combination, addressing #302393’s request for argument-scoped confirmations.
Changes:
- Introduces proposed API
toolInvocationApproveCombinationviaLanguageModelToolConfirmationMessages.approveCombination. - Threads an optional
combinationLabelthrough tool confirmation plumbing to offer combination-scoped approval actions and auto-confirm checks. - Persists combination approvals in a new confirmation store and gates extension usage behind the proposal flag.
Reviewed changes
Copilot reviewed 8 out of 9 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/vscode-dts/vscode.proposed.toolInvocationApproveCombination.d.ts | New proposed API surface adding approveCombination to tool confirmation messages. |
| src/vs/workbench/contrib/chat/common/tools/languageModelToolsService.ts | Adds approveCombination to internal confirmation message shape. |
| src/vs/workbench/contrib/chat/common/tools/languageModelToolsConfirmationService.ts | Extends confirmation ref with combinationLabel to enable combination-scoped actions. |
| src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolConfirmationSubPart.ts | Passes combinationLabel to confirmation service; keeps “Allow Once” primary when combination approvals exist. |
| src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/abstractToolConfirmationSubPart.ts | Adds overridable hook to keep “Allow Once” as primary button. |
| src/vs/workbench/contrib/chat/browser/tools/languageModelToolsService.ts | Includes combination label in pre-confirm/auto-confirm lookup path. |
| src/vs/workbench/contrib/chat/browser/tools/languageModelToolsConfirmationService.ts | Implements combination approval actions + storage and checks combination approvals before tool/server approvals. |
| src/vs/workbench/api/common/extHostLanguageModelTools.ts | Gates new field behind toolInvocationApproveCombination proposal and serializes it to DTO. |
| src/vs/platform/extensions/common/extensionsApiProposals.ts | Registers the new proposal file in the proposals list. |
You can also share your feedback on Copilot code review. Take the survey.
src/vs/workbench/contrib/chat/browser/tools/languageModelToolsConfirmationService.ts
Show resolved
Hide resolved
src/vs/workbench/contrib/chat/browser/tools/languageModelToolsConfirmationService.ts
Show resolved
Hide resolved
src/vs/workbench/contrib/chat/browser/tools/languageModelToolsConfirmationService.ts
Show resolved
Hide resolved
There was a problem hiding this comment.
Pull request overview
Adds a proposed API and workbench support for approving a specific tool + argument combination (rather than approving the tool globally), addressing the “tool confirmations for specific arguments” request in #302393.
Changes:
- Introduces proposed API
toolInvocationApproveCombinationthat addsapproveCombinationto tool confirmation messages. - Plumbs the new
approveCombinationlabel through ext host → tool invocation preparation → confirmation UI/service to offer combination-scoped approvals. - Expands confirmation service tests to cover combination-level actions and storage format handling.
Reviewed changes
Copilot reviewed 9 out of 10 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/vscode-dts/vscode.proposed.toolInvocationApproveCombination.d.ts | Adds the proposed API surface (approveCombination) for combination approval labels. |
| src/vs/platform/extensions/common/extensionsApiProposals.ts | Registers the new proposal so extensions can opt-in. |
| src/vs/workbench/api/common/extHostLanguageModelTools.ts | Gates the new field behind the proposal and converts it for main-thread consumption. |
| src/vs/workbench/contrib/chat/common/tools/languageModelToolsService.ts | Extends internal confirmation messages with approveCombination. |
| src/vs/workbench/contrib/chat/common/tools/languageModelToolsConfirmationService.ts | Extends the confirmation ref with combinationLabel. |
| src/vs/workbench/contrib/chat/browser/tools/languageModelToolsService.ts | Passes approveCombination through auto-confirm evaluation. |
| src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolConfirmationSubPart.ts | Surfaces combination actions in the UI and adjusts primary-button selection behavior. |
| src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/abstractToolConfirmationSubPart.ts | Adds an override point to keep “Allow Once” as primary when desired. |
| src/vs/workbench/contrib/chat/test/browser/tools/languageModelToolsConfirmationService.test.ts | Adds unit tests for combination-scoped actions and storage migration behavior. |
You can also share your feedback on Copilot code review. Take the survey.
Adds support for approving a specific tool + args combination Part of #302393