Skip to content

Commit 0835ce4

Browse files
[cherry-pick] Make tool_search visible in the tools picker (#311498)
Co-authored-by: vs-code-engineering[bot] <vs-code-engineering[bot]@users.noreply.github.com>
1 parent df2a441 commit 0835ce4

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

extensions/copilot/src/extension/intents/node/agentIntent.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import { IAutomodeService } from '../../../platform/endpoint/node/automodeServic
1717
import { IEnvService } from '../../../platform/env/common/envService';
1818
import { ILogService } from '../../../platform/log/common/logService';
1919
import { IEditLogService } from '../../../platform/multiFileEdit/common/editLogService';
20-
import { CUSTOM_TOOL_SEARCH_NAME, isAnthropicContextEditingEnabled } from '../../../platform/networking/common/anthropic';
20+
import { isAnthropicContextEditingEnabled } from '../../../platform/networking/common/anthropic';
2121
import { IChatEndpoint } from '../../../platform/networking/common/networking';
2222
import { modelsWithoutResponsesContextManagement } from '../../../platform/networking/common/openai';
2323
import { INotebookService } from '../../../platform/notebook/common/notebookService';
@@ -141,8 +141,6 @@ export const getAgentTools = async (accessor: ServicesAccessor, request: vscode.
141141
allowTools[ToolName.MultiReplaceString] = true;
142142
}
143143

144-
allowTools[CUSTOM_TOOL_SEARCH_NAME] = !!model.supportsToolSearch;
145-
146144
const tools = toolsService.getEnabledTools(request, model, tool => {
147145
if (typeof allowTools[tool.name] === 'boolean') {
148146
return allowTools[tool.name];

extensions/copilot/src/extension/tools/node/toolSearchTool.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
*--------------------------------------------------------------------------------------------*/
55

66
import type * as vscode from 'vscode';
7+
import * as l10n from '@vscode/l10n';
78
import { ILogService } from '../../../platform/log/common/logService';
89
import { CUSTOM_TOOL_SEARCH_NAME } from '../../../platform/networking/common/anthropic';
910
import { LanguageModelTextPart, LanguageModelToolResult } from '../../../vscodeTypes';
@@ -56,10 +57,13 @@ export class ToolSearchTool implements ICopilotModelSpecificTool<IToolSearchPara
5657
ToolRegistry.registerModelSpecificTool(
5758
{
5859
name: CUSTOM_TOOL_SEARCH_NAME,
59-
displayName: 'Search Tools',
60+
displayName: l10n.t('Search Tools'),
61+
toolReferenceName: 'toolSearch',
62+
userDescription: l10n.t('Search for relevant tools by describing what you need'),
6063
description: 'Search for relevant tools by describing what you need. Returns tool references for tools matching your query. Use this when you need to find a tool but aren\'t sure of its exact name. Check the availableDeferredTools list in your instructions for the full set of deferred tools, and include relevant tool names from that list in your query for more accurate results. Use broad queries to find all related tools in a single call rather than making multiple narrow searches.',
6164
tags: [],
6265
source: undefined,
66+
toolSet: 'vscode',
6367
inputSchema: {
6468
type: 'object',
6569
properties: {

0 commit comments

Comments
 (0)