@@ -29,6 +29,10 @@ import { IRawChatCommandContribution } from './chatParticipantContribTypes.js';
29
29
import { IChatFollowup , IChatLocationData , IChatProgress , IChatResponseErrorDetails , IChatTaskDto } from './chatService.js' ;
30
30
import { ChatAgentLocation , ChatMode } from './constants.js' ;
31
31
32
+ // --- Start Positron ---
33
+ import { IConfigurationService } from '../../../../platform/configuration/common/configuration.js' ;
34
+ // --- End Positron ---
35
+
32
36
//#region agent service, commands etc
33
37
34
38
export interface IChatAgentHistoryEntry {
@@ -243,6 +247,9 @@ export class ChatAgentService extends Disposable implements IChatAgentService {
243
247
244
248
constructor (
245
249
@IContextKeyService private readonly contextKeyService : IContextKeyService ,
250
+ // --- Start Positron ---
251
+ @IConfigurationService private readonly configurationService : IConfigurationService ,
252
+ // --- End Positron ---
246
253
) {
247
254
super ( ) ;
248
255
this . _hasDefaultAgent = ChatContextKeys . enabled . bindTo ( this . contextKeyService ) ;
@@ -316,7 +323,13 @@ export class ChatAgentService extends Disposable implements IChatAgentService {
316
323
}
317
324
}
318
325
this . _editingAgentRegistered . set ( editingAgentRegistered ) ;
319
- this . _defaultAgentRegistered . set ( defaultAgentRegistered ) ;
326
+ // --- Start Positron ---
327
+ // Do not register default agents when Assistant is disabled.
328
+ // this._defaultAgentRegistered.set(defaultAgentRegistered);
329
+ if ( this . configurationService . getValue ( 'positron.assistant.enable' ) ) {
330
+ this . _defaultAgentRegistered . set ( defaultAgentRegistered ) ;
331
+ }
332
+ // --- End Positron ---
320
333
if ( toolsAgentRegistered !== this . _hasToolsAgentContextKey . get ( ) ) {
321
334
this . _hasToolsAgentContextKey . set ( toolsAgentRegistered ) ;
322
335
this . _onDidChangeAgents . fire ( this . getDefaultAgent ( ChatAgentLocation . EditingSession ) ) ;
0 commit comments