@@ -43,6 +43,8 @@ import { InMemoryStorageService, IStorageService } from '../../../../../../../pl
4343import { IPathService } from '../../../../../../services/path/common/pathService.js' ;
4444import { ISearchService } from '../../../../../../services/search/common/search.js' ;
4545import { IExtensionService } from '../../../../../../services/extensions/common/extensions.js' ;
46+ import { IDefaultAccountService } from '../../../../../../../platform/defaultAccount/common/defaultAccount.js' ;
47+ import { IDefaultAccount } from '../../../../../../../base/common/defaultAccount.js' ;
4648
4749suite ( 'PromptsService' , ( ) => {
4850 const disposables = ensureNoDisposablesAreLeakedInTestSuite ( ) ;
@@ -78,6 +80,10 @@ suite('PromptsService', () => {
7880 activateByEvent : ( ) => Promise . resolve ( )
7981 } ) ;
8082
83+ instaService . stub ( IDefaultAccountService , {
84+ getDefaultAccount : ( ) => Promise . resolve ( { chat_preview_features_enabled : true } as IDefaultAccount )
85+ } ) ;
86+
8187 fileService = disposables . add ( instaService . createInstance ( FileService ) ) ;
8288 instaService . stub ( IFileService , fileService ) ;
8389
@@ -1267,6 +1273,42 @@ suite('PromptsService', () => {
12671273 assert . strictEqual ( result , undefined ) ;
12681274 } ) ;
12691275
1276+ test ( 'should return undefined when chat_preview_features_enabled is false' , async ( ) => {
1277+ testConfigService . setUserConfiguration ( PromptsConfig . USE_AGENT_SKILLS , true ) ;
1278+ instaService . stub ( IDefaultAccountService , {
1279+ getDefaultAccount : ( ) => Promise . resolve ( { chat_preview_features_enabled : false } as IDefaultAccount )
1280+ } ) ;
1281+
1282+ // Recreate service with new stub
1283+ service = disposables . add ( instaService . createInstance ( PromptsService ) ) ;
1284+
1285+ const result = await service . findAgentSkills ( CancellationToken . None ) ;
1286+ assert . strictEqual ( result , undefined ) ;
1287+
1288+ // Restore default stub for other tests
1289+ instaService . stub ( IDefaultAccountService , {
1290+ getDefaultAccount : ( ) => Promise . resolve ( { chat_preview_features_enabled : true } as IDefaultAccount )
1291+ } ) ;
1292+ } ) ;
1293+
1294+ test ( 'should return undefined when USE_AGENT_SKILLS is enabled but chat_preview_features_enabled is false' , async ( ) => {
1295+ testConfigService . setUserConfiguration ( PromptsConfig . USE_AGENT_SKILLS , true ) ;
1296+ instaService . stub ( IDefaultAccountService , {
1297+ getDefaultAccount : ( ) => Promise . resolve ( { chat_preview_features_enabled : false } as IDefaultAccount )
1298+ } ) ;
1299+
1300+ // Recreate service with new stub
1301+ service = disposables . add ( instaService . createInstance ( PromptsService ) ) ;
1302+
1303+ const result = await service . findAgentSkills ( CancellationToken . None ) ;
1304+ assert . strictEqual ( result , undefined ) ;
1305+
1306+ // Restore default stub for other tests
1307+ instaService . stub ( IDefaultAccountService , {
1308+ getDefaultAccount : ( ) => Promise . resolve ( { chat_preview_features_enabled : true } as IDefaultAccount )
1309+ } ) ;
1310+ } ) ;
1311+
12701312 test ( 'should find skills in workspace and user home' , async ( ) => {
12711313 testConfigService . setUserConfiguration ( PromptsConfig . USE_AGENT_SKILLS , true ) ;
12721314
0 commit comments