@@ -16,6 +16,7 @@ import { equalsIgnoreCase } from '../../../../base/common/strings.js';
16
16
import { ThemeIcon } from '../../../../base/common/themables.js' ;
17
17
import { URI } from '../../../../base/common/uri.js' ;
18
18
import { Command } from '../../../../editor/common/languages.js' ;
19
+ import { IConfigurationService } from '../../../../platform/configuration/common/configuration.js' ;
19
20
import { ContextKeyExpr , IContextKey , IContextKeyService } from '../../../../platform/contextkey/common/contextkey.js' ;
20
21
import { ExtensionIdentifier } from '../../../../platform/extensions/common/extensions.js' ;
21
22
import { createDecorator } from '../../../../platform/instantiation/common/instantiation.js' ;
@@ -27,7 +28,7 @@ import { ChatContextKeys } from './chatContextKeys.js';
27
28
import { IChatAgentEditedFileEvent , IChatProgressHistoryResponseContent , IChatRequestVariableData , ISerializableChatAgentData } from './chatModel.js' ;
28
29
import { IRawChatCommandContribution } from './chatParticipantContribTypes.js' ;
29
30
import { IChatFollowup , IChatLocationData , IChatProgress , IChatResponseErrorDetails , IChatTaskDto } from './chatService.js' ;
30
- import { ChatAgentLocation , ChatModeKind } from './constants.js' ;
31
+ import { ChatAgentLocation , ChatConfiguration , ChatModeKind } from './constants.js' ;
31
32
32
33
//#region agent service, commands etc
33
34
@@ -238,6 +239,7 @@ export class ChatAgentService extends Disposable implements IChatAgentService {
238
239
239
240
constructor (
240
241
@IContextKeyService private readonly contextKeyService : IContextKeyService ,
242
+ @IConfigurationService private readonly configurationService : IConfigurationService ,
241
243
) {
242
244
super ( ) ;
243
245
this . _hasDefaultAgent = ChatContextKeys . enabled . bindTo ( this . contextKeyService ) ;
@@ -392,7 +394,8 @@ export class ChatAgentService extends Disposable implements IChatAgentService {
392
394
}
393
395
394
396
public get hasToolsAgent ( ) : boolean {
395
- return ! ! this . _hasToolsAgent ;
397
+ // The chat participant enablement is just based on this setting. Don't wait for the extension to be loaded.
398
+ return ! ! this . configurationService . getValue ( ChatConfiguration . AgentEnabled ) ;
396
399
}
397
400
398
401
getContributedDefaultAgent ( location : ChatAgentLocation ) : IChatAgentData | undefined {
0 commit comments