@@ -10,7 +10,7 @@ import { BudgetExceededError } from '@vscode/prompt-tsx/dist/base/materialized';
10
10
import type * as vscode from 'vscode' ;
11
11
import { ChatLocation , ChatResponse } from '../../../platform/chat/common/commonTypes' ;
12
12
import { ConfigKey , IConfigurationService } from '../../../platform/configuration/common/configurationService' ;
13
- import { modelCanUseApplyPatchExclusively , modelCanUseReplaceStringExclusively , modelSupportsApplyPatch , modelSupportsMultiReplaceString , modelSupportsReplaceString } from '../../../platform/endpoint/common/chatModelCapabilities' ;
13
+ import { isHiddenModelB , modelCanUseApplyPatchExclusively , modelCanUseReplaceStringExclusively , modelSupportsApplyPatch , modelSupportsMultiReplaceString , modelSupportsReplaceString } from '../../../platform/endpoint/common/chatModelCapabilities' ;
14
14
import { IEndpointProvider } from '../../../platform/endpoint/common/endpointProvider' ;
15
15
import { IEnvService } from '../../../platform/env/common/envService' ;
16
16
import { ILogService } from '../../../platform/log/common/logService' ;
@@ -68,6 +68,24 @@ const getTools = (instaService: IInstantiationService, request: vscode.ChatReque
68
68
allowTools [ ToolName . EditFile ] = false ;
69
69
}
70
70
71
+ if ( await isHiddenModelB ( model ) ) {
72
+ const treatment = experimentationService . getTreatmentVariable < string > ( 'vscode' , 'copilotchat.hiddenModelBEditTool' ) ;
73
+ switch ( treatment ) {
74
+ case 'with_replace_string' :
75
+ allowTools [ ToolName . ReplaceString ] = true ;
76
+ allowTools [ ToolName . EditFile ] = true ;
77
+ break ;
78
+ case 'only_replace_string' :
79
+ allowTools [ ToolName . ReplaceString ] = true ;
80
+ allowTools [ ToolName . EditFile ] = false ;
81
+ break ;
82
+ case 'control' :
83
+ default :
84
+ allowTools [ ToolName . ReplaceString ] = false ;
85
+ allowTools [ ToolName . EditFile ] = true ;
86
+ }
87
+ }
88
+
71
89
if ( modelCanUseReplaceStringExclusively ( model ) ) {
72
90
allowTools [ ToolName . ReplaceString ] = true ;
73
91
allowTools [ ToolName . EditFile ] = false ;
0 commit comments