@@ -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' ;
@@ -925,22 +925,6 @@ suite('filterClientToolNames', () => {
925925 ]
926926 ) ;
927927 } ) ;
928-
929- test ( 'keeps workbench and SDK semantic-search names consistent' , ( ) => {
930- const names = new Set ( [ SEMANTIC_SEARCH_TOOL_NAME ] ) ;
931- assert . deepStrictEqual (
932- [
933- [ ...filterClientToolNames ( names , [ CLIENT_SEMANTIC_SEARCH_REFERENCE_NAME ] , undefined ) ] ,
934- [ ...filterClientToolNames ( names , undefined , [ `custom:${ CLIENT_SEMANTIC_SEARCH_REFERENCE_NAME } ` ] ) ] ,
935- toSdkToolFilterPatterns ( [ CLIENT_SEMANTIC_SEARCH_REFERENCE_NAME , `custom:${ CLIENT_SEMANTIC_SEARCH_REFERENCE_NAME } ` , 'builtin:*' ] ) ,
936- ] ,
937- [
938- [ SEMANTIC_SEARCH_TOOL_NAME ] ,
939- [ ] ,
940- [ SEMANTIC_SEARCH_TOOL_NAME , `custom:${ SEMANTIC_SEARCH_TOOL_NAME } ` , 'builtin:*' ] ,
941- ]
942- ) ;
943- } ) ;
944928} ) ;
945929
946930/**
@@ -1023,51 +1007,20 @@ suite('CopilotSessionLauncher resume config', () => {
10231007 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 ) ;
10241008 }
10251009
1026- test ( 'excludes the built-in semantic search unless the client override is enabled' , async ( ) => {
1027- const store = new DisposableStore ( ) ;
1028- // Same configured filters on both arms, so the snapshot is the only variable.
1029- const overrides = { modelCapabilityOverrides : { '*' : { excludedTools : [ 'mcp:*' ] } } } ;
1030- const disabled = await buildResumeConfig (
1031- createLauncher ( store , overrides ) ,
1032- undefined ,
1033- { tools : [ ] , plugins : [ ] , mcpServers : { } } ,
1034- ) ;
1035- const enabled = await buildResumeConfig (
1036- createLauncher ( store , overrides ) ,
1037- undefined ,
1038- { tools : [ { name : SEMANTIC_SEARCH_TOOL_NAME } ] , plugins : [ ] , mcpServers : { } } ,
1039- ) ;
1040-
1041- assert . deepStrictEqual (
1042- [ disabled . excludedTools , enabled . excludedTools ] ,
1043- [ [ 'mcp:*' , `builtin:${ SEMANTIC_SEARCH_TOOL_NAME } ` ] , [ 'mcp:*' ] ] ,
1044- ) ;
1045- store . dispose ( ) ;
1046- } ) ;
1047-
1048- test ( 'does not fall back to built-in semantic search when filters remove the client override' , async ( ) => {
1010+ test ( 'exposes only the client semantic-search override' , async ( ) => {
10491011 const store = new DisposableStore ( ) ;
10501012 const snapshot = { tools : [ { name : SEMANTIC_SEARCH_TOOL_NAME } ] , plugins : [ ] , mcpServers : { } } ;
1051- const builtinOnly = await buildResumeConfig (
1052- createLauncher ( store , { modelCapabilityOverrides : { '*' : { availableTools : [ `builtin:${ SEMANTIC_SEARCH_TOOL_NAME } ` ] } } } ) ,
1053- undefined ,
1054- snapshot ,
1055- ) ;
1056- const customExcluded = await buildResumeConfig (
1013+ const disabled = await buildResumeConfig ( createLauncher ( store , { } ) , undefined , { tools : [ ] , plugins : [ ] , mcpServers : { } } ) ;
1014+ const enabled = await buildResumeConfig ( createLauncher ( store , { } ) , undefined , snapshot ) ;
1015+ const filtered = await buildResumeConfig (
10571016 createLauncher ( store , { modelCapabilityOverrides : { '*' : { excludedTools : [ `custom:${ SEMANTIC_SEARCH_TOOL_NAME } ` ] } } } ) ,
10581017 undefined ,
10591018 snapshot ,
10601019 ) ;
10611020
10621021 assert . deepStrictEqual (
1063- [
1064- [ builtinOnly . availableTools , builtinOnly . excludedTools ] ,
1065- [ customExcluded . availableTools , customExcluded . excludedTools ] ,
1066- ] ,
1067- [
1068- [ [ `builtin:${ SEMANTIC_SEARCH_TOOL_NAME } ` ] , [ `builtin:${ SEMANTIC_SEARCH_TOOL_NAME } ` ] ] ,
1069- [ undefined , [ `custom:${ SEMANTIC_SEARCH_TOOL_NAME } ` , `builtin:${ SEMANTIC_SEARCH_TOOL_NAME } ` ] ] ,
1070- ]
1022+ [ disabled . excludedTools , enabled . excludedTools , filtered . excludedTools ] ,
1023+ [ [ `builtin:${ SEMANTIC_SEARCH_TOOL_NAME } ` ] , undefined , [ `custom:${ SEMANTIC_SEARCH_TOOL_NAME } ` , `builtin:${ SEMANTIC_SEARCH_TOOL_NAME } ` ] ] ,
10711024 ) ;
10721025 store . dispose ( ) ;
10731026 } ) ;
0 commit comments