@@ -10,13 +10,46 @@ import { IInstantiationService } from '../../../../util/vs/platform/instantiatio
1010import { CopilotToken , createTestExtendedTokenInfo } from '../../../authentication/common/copilotToken' ;
1111import { ICopilotTokenStore } from '../../../authentication/common/copilotTokenStore' ;
1212import { getEditorVersionHeaders , IEnvService } from '../../../env/common/envService' ;
13+ import { WireTypes } from '../../../inlineEdits/common/dataTypes/inlineEditsModelsTypes' ;
1314import { FetchOptions , IAbortController , IFetcherService , PaginationOptions , Response , WebSocketConnection } from '../../../networking/common/fetcherService' ;
1415import { createFakeResponse } from '../../../test/node/fetcher' ;
1516import { createPlatformServices } from '../../../test/node/services' ;
1617import { ProxyModelsService } from '../../node/proxyModelsService' ;
1718
1819suite ( 'ProxyModelsService' , function ( ) {
1920
21+ test ( 'validates optional eagerness prompts from the models response' , function ( ) {
22+ const withEagernessPrompt = WireTypes . ModelList . validator . validate ( {
23+ models : [ {
24+ serviceType : 'NESChat' ,
25+ name : 'test-model' ,
26+ provider : 'test-provider' ,
27+ capabilities : {
28+ promptStrategy : 'patchBased02Optimized' ,
29+ eagernessPrompt : 'aggressionHighLow' ,
30+ } ,
31+ } ] ,
32+ } ) ;
33+ const withoutEagernessPrompt = WireTypes . ModelList . validator . validate ( {
34+ models : [ {
35+ serviceType : 'NESChat' ,
36+ name : 'test-model' ,
37+ provider : 'test-provider' ,
38+ capabilities : {
39+ promptStrategy : 'patchBased02Optimized' ,
40+ } ,
41+ } ] ,
42+ } ) ;
43+
44+ assert . deepStrictEqual ( {
45+ withEagernessPrompt : withEagernessPrompt . content ?. models [ 0 ] . capabilities . eagernessPrompt ,
46+ withoutEagernessPrompt : withoutEagernessPrompt . content ?. models [ 0 ] . capabilities . eagernessPrompt ,
47+ } , {
48+ withEagernessPrompt : 'aggressionHighLow' ,
49+ withoutEagernessPrompt : undefined ,
50+ } ) ;
51+ } ) ;
52+
2053 test ( 'includes editor-related headers when fetching the models list' , async function ( ) {
2154 let capturedHeaders : { [ name : string ] : string } | undefined ;
2255
0 commit comments