@@ -19,9 +19,9 @@ import type { IByokLmBridgeConnection, IByokLmChatRequest, IByokLmChatResult, IB
1919import { AgentHostByokModelsEnabledConfigKey , type SchemaValues } from '../../common/agentHostSchema.js' ;
2020import type { IAgentHostManagedSettingsPermissions } from '../../common/agentHostManagedSettings.js' ;
2121import { CopilotCliConfigKey , copilotCliConfigSchema } from '../../common/copilotCliConfig.js' ;
22- import { CLIENT_SEMANTIC_SEARCH_REFERENCE_NAME , SEMANTIC_SEARCH_TOOL_NAME } from '../../common/semanticSearchConstants.js' ;
2322import type { IAgentHostOTelService } from '../../common/otel/agentHostOTelService.js' ;
2423import { reasoningEffortLevels } from '../../common/reasoningEffort.js' ;
24+ import { SEMANTIC_SEARCH_TOOL_NAME } from '../../common/semanticSearchConstants.js' ;
2525import { CustomizationType , McpServerStatus , type ModelSelection } from '../../common/state/protocol/state.js' ;
2626import { CLIENT_TOOL_SEARCH_REFERENCE_NAME , RUNTIME_TOOL_SEARCH_TOOL_NAME } from '../../common/toolSearchConstants.js' ;
2727import { ActiveClientToolSet } from '../../node/activeClientState.js' ;
@@ -519,7 +519,7 @@ suite('CopilotSessionLauncher shared session config', () => {
519519 resumeManagedSettings : { permissions : managedSettingsPermissions } ,
520520 ephemeralMcpServers : { } ,
521521 ephemeralDisabledMcpServers : [ 'azure' , 'disabled-workspace-server' , 'github' , 'native-plugin-server' , 'synced-server' ] ,
522- ephemeralExcludedTools : [ 'task' ] ,
522+ ephemeralExcludedTools : [ 'task' , `builtin: ${ SEMANTIC_SEARCH_TOOL_NAME } ` ] ,
523523 } ) ;
524524 } finally {
525525 sessions . dispose ( ) ;
@@ -932,22 +932,6 @@ suite('filterClientToolNames', () => {
932932 ]
933933 ) ;
934934 } ) ;
935-
936- test ( 'keeps workbench and SDK semantic-search names consistent' , ( ) => {
937- const names = new Set ( [ SEMANTIC_SEARCH_TOOL_NAME ] ) ;
938- assert . deepStrictEqual (
939- [
940- [ ...filterClientToolNames ( names , [ CLIENT_SEMANTIC_SEARCH_REFERENCE_NAME ] , undefined ) ] ,
941- [ ...filterClientToolNames ( names , undefined , [ `custom:${ CLIENT_SEMANTIC_SEARCH_REFERENCE_NAME } ` ] ) ] ,
942- toSdkToolFilterPatterns ( [ CLIENT_SEMANTIC_SEARCH_REFERENCE_NAME , `custom:${ CLIENT_SEMANTIC_SEARCH_REFERENCE_NAME } ` , 'builtin:*' ] ) ,
943- ] ,
944- [
945- [ SEMANTIC_SEARCH_TOOL_NAME ] ,
946- [ ] ,
947- [ SEMANTIC_SEARCH_TOOL_NAME , `custom:${ SEMANTIC_SEARCH_TOOL_NAME } ` , 'builtin:*' ] ,
948- ]
949- ) ;
950- } ) ;
951935} ) ;
952936
953937/**
@@ -1030,51 +1014,20 @@ suite('CopilotSessionLauncher resume config', () => {
10301014 return ( launcher as unknown as { _buildSessionConfig ( plan : unknown , runtime : unknown ) : Promise < { model ?: string ; reasoningEffort ?: string ; contextTier ?: string ; availableTools ?: string [ ] ; excludedTools ?: string [ ] ; modelCapabilities ?: Record < string , unknown > ; toolSearch ?: { enabled : boolean } } > } ) . _buildSessionConfig ( plan , runtime ) ;
10311015 }
10321016
1033- test ( 'excludes the built-in semantic search unless the client override is enabled' , async ( ) => {
1034- const store = new DisposableStore ( ) ;
1035- // Same configured filters on both arms, so the snapshot is the only variable.
1036- const overrides = { modelCapabilityOverrides : { '*' : { excludedTools : [ 'mcp:*' ] } } } ;
1037- const disabled = await buildResumeConfig (
1038- createLauncher ( store , overrides ) ,
1039- undefined ,
1040- { tools : [ ] , plugins : [ ] , mcpServers : { } } ,
1041- ) ;
1042- const enabled = await buildResumeConfig (
1043- createLauncher ( store , overrides ) ,
1044- undefined ,
1045- { tools : [ { name : SEMANTIC_SEARCH_TOOL_NAME } ] , plugins : [ ] , mcpServers : { } } ,
1046- ) ;
1047-
1048- assert . deepStrictEqual (
1049- [ disabled . excludedTools , enabled . excludedTools ] ,
1050- [ [ 'mcp:*' , `builtin:${ SEMANTIC_SEARCH_TOOL_NAME } ` ] , [ 'mcp:*' ] ] ,
1051- ) ;
1052- store . dispose ( ) ;
1053- } ) ;
1054-
1055- test ( 'does not fall back to built-in semantic search when filters remove the client override' , async ( ) => {
1017+ test ( 'exposes only the client semantic-search override' , async ( ) => {
10561018 const store = new DisposableStore ( ) ;
10571019 const snapshot = { tools : [ { name : SEMANTIC_SEARCH_TOOL_NAME } ] , plugins : [ ] , mcpServers : { } } ;
1058- const builtinOnly = await buildResumeConfig (
1059- createLauncher ( store , { modelCapabilityOverrides : { '*' : { availableTools : [ `builtin:${ SEMANTIC_SEARCH_TOOL_NAME } ` ] } } } ) ,
1060- undefined ,
1061- snapshot ,
1062- ) ;
1063- const customExcluded = await buildResumeConfig (
1020+ const disabled = await buildResumeConfig ( createLauncher ( store , { } ) , undefined , { tools : [ ] , plugins : [ ] , mcpServers : { } } ) ;
1021+ const enabled = await buildResumeConfig ( createLauncher ( store , { } ) , undefined , snapshot ) ;
1022+ const filtered = await buildResumeConfig (
10641023 createLauncher ( store , { modelCapabilityOverrides : { '*' : { excludedTools : [ `custom:${ SEMANTIC_SEARCH_TOOL_NAME } ` ] } } } ) ,
10651024 undefined ,
10661025 snapshot ,
10671026 ) ;
10681027
10691028 assert . deepStrictEqual (
1070- [
1071- [ builtinOnly . availableTools , builtinOnly . excludedTools ] ,
1072- [ customExcluded . availableTools , customExcluded . excludedTools ] ,
1073- ] ,
1074- [
1075- [ [ `builtin:${ SEMANTIC_SEARCH_TOOL_NAME } ` ] , [ `builtin:${ SEMANTIC_SEARCH_TOOL_NAME } ` ] ] ,
1076- [ undefined , [ `custom:${ SEMANTIC_SEARCH_TOOL_NAME } ` , `builtin:${ SEMANTIC_SEARCH_TOOL_NAME } ` ] ] ,
1077- ]
1029+ [ disabled . excludedTools , enabled . excludedTools , filtered . excludedTools ] ,
1030+ [ [ `builtin:${ SEMANTIC_SEARCH_TOOL_NAME } ` ] , undefined , [ `custom:${ SEMANTIC_SEARCH_TOOL_NAME } ` , `builtin:${ SEMANTIC_SEARCH_TOOL_NAME } ` ] ] ,
10781031 ) ;
10791032 store . dispose ( ) ;
10801033 } ) ;
0 commit comments