@@ -87,6 +87,7 @@ import { isCancellationError } from '../../../../base/common/errors.js';
87
87
import { IChatService } from '../../chat/common/chatService.js' ;
88
88
import { ChatAgentLocation , ChatMode } from '../../chat/common/constants.js' ;
89
89
import { CHAT_OPEN_ACTION_ID } from '../../chat/browser/actions/chatActions.js' ;
90
+ import { IChatAgentService } from '../../chat/common/chatAgents.js' ;
90
91
91
92
92
93
const QUICKOPEN_HISTORY_LIMIT_CONFIG = 'task.quickOpen.history' ;
@@ -286,6 +287,7 @@ export abstract class AbstractTaskService extends Disposable implements ITaskSer
286
287
@IRemoteAgentService remoteAgentService : IRemoteAgentService ,
287
288
@IInstantiationService private readonly _instantiationService : IInstantiationService ,
288
289
@IChatService private readonly _chatService : IChatService ,
290
+ @IChatAgentService private readonly _chatAgentService : IChatAgentService
289
291
) {
290
292
super ( ) ;
291
293
this . _whenTaskSystemReady = Event . toPromise ( this . onDidChangeTaskSystemInfo ) ;
@@ -683,15 +685,21 @@ export abstract class AbstractTaskService extends Disposable implements ITaskSer
683
685
const customMessage = message === errorMessage
684
686
? `\`${ message } \``
685
687
: `\`${ message } \`\n\`\`\`json${ errorMessage } \`\`\`` ;
686
- actions . push ( {
687
- label : nls . localize ( 'troubleshootWithChat' , "Fix with Copilot" ) ,
688
- run : async ( ) => {
689
- this . _commandService . executeCommand ( CHAT_OPEN_ACTION_ID , {
690
- mode : ChatMode . Agent ,
691
- query : `Fix this task configuration error: ${ customMessage } `
692
- } ) ;
693
- }
694
- } ) ;
688
+
689
+
690
+ const defaultAgent = this . _chatAgentService . getDefaultAgent ( ChatAgentLocation . Panel ) ;
691
+ const providerName = defaultAgent ?. fullName ;
692
+ if ( providerName ) {
693
+ actions . push ( {
694
+ label : nls . localize ( 'troubleshootWithChat' , "Fix with {0}" , providerName ) ,
695
+ run : async ( ) => {
696
+ this . _commandService . executeCommand ( CHAT_OPEN_ACTION_ID , {
697
+ mode : ChatMode . Agent ,
698
+ query : `Fix this task configuration error: ${ customMessage } `
699
+ } ) ;
700
+ }
701
+ } ) ;
702
+ }
695
703
}
696
704
}
697
705
actions . push ( {
0 commit comments