tools: update tools of a chat request when they change (#256321)

Makes the `userSelectedTools` passed into the chat agent service
observable such that the tools of the ongoing request update as new
tools come in. The benefit of this versus other (previous) approaches
is that it reflects the enablement/disablement state of the picker
(which is likely to get additional controls in the future) and works
without special tagging.

@roblourens / @DonJayamanne I think with this we can get rid of

0d6f5516d2/src/extension/tools/vscode-node/toolsService.ts (L118-L122)

which was added for Jupyter iirc.

Closes #254684
This commit is contained in:
Connor Peet
2025-07-16 16:10:47 -07:00
committed by GitHub
parent c8aac76f9f
commit d86855a647
13 changed files with 94 additions and 30 deletions

View File

@@ -1551,6 +1551,10 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor): I
},
registerMcpServerDefinitionProvider(id, provider) {
return extHostMcp.registerMcpConfigurationProvider(extension, id, provider);
},
onDidChangeChatRequestTools(...args) {
checkProposedApiEnabled(extension, 'chatParticipantAdditions');
return _asExtensionEvent(extHostChatAgents2.onDidChangeChatRequestTools)(...args);
}
};