Add languageModelToolsForAgent proposal (#243105)

To have a cleaner proposal to enable the tag for extensions to contribute tools to agent mode
This commit is contained in:
Rob Lourens
2025-03-10 12:00:27 -07:00
committed by GitHub
parent 4e8d2667e6
commit 2c19ac01f3
3 changed files with 21 additions and 1 deletions
@@ -226,6 +226,9 @@ const _allApiProposals = {
languageModelSystem: {
proposal: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.languageModelSystem.d.ts',
},
languageModelToolsForAgent: {
proposal: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.languageModelToolsForAgent.d.ts',
},
languageStatusText: {
proposal: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.languageStatusText.d.ts',
},
@@ -135,6 +135,8 @@ function toToolKey(extensionIdentifier: ExtensionIdentifier, toolName: string) {
return `${extensionIdentifier.value}/${toolName}`;
}
const CopilotAgentModeTag = 'vscode_editing';
export class LanguageModelToolsExtensionPointHandler implements IWorkbenchContribution {
static readonly ID = 'workbench.contrib.toolsExtensionPointHandler';
@@ -167,7 +169,14 @@ export class LanguageModelToolsExtensionPointHandler implements IWorkbenchContri
continue;
}
if (rawTool.tags?.some(tag => tag.startsWith('copilot_') || tag.startsWith('vscode_')) && !isProposedApiEnabled(extension.description, 'chatParticipantPrivate')) {
if (rawTool.tags?.includes(CopilotAgentModeTag)) {
if (!isProposedApiEnabled(extension.description, 'languageModelToolsForAgent') && !isProposedApiEnabled(extension.description, 'chatParticipantPrivate')) {
logService.error(`Extension '${extension.description.identifier.value}' CANNOT register tool with tag "${CopilotAgentModeTag}" without enabling 'languageModelToolsForAgent' proposal`);
continue;
}
}
if (rawTool.tags?.some(tag => tag !== CopilotAgentModeTag && (tag.startsWith('copilot_') || tag.startsWith('vscode_'))) && !isProposedApiEnabled(extension.description, 'chatParticipantPrivate')) {
logService.error(`Extension '${extension.description.identifier.value}' CANNOT register tool with tags starting with "vscode_" or "copilot_"`);
continue;
}
@@ -0,0 +1,8 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
declare module 'vscode' {
// Enables access to providing language model tools to agent mode
}