File tree Expand file tree Collapse file tree 1 file changed +14
-4
lines changed
src/vs/workbench/contrib/chat/common Expand file tree Collapse file tree 1 file changed +14
-4
lines changed Original file line number Diff line number Diff line change @@ -496,10 +496,20 @@ export class ChatService extends Disposable implements IChatService {
496496 throw new ErrorNoTelemetry ( 'No default agent contributed' ) ;
497497 }
498498
499- // Activate the default extension provided agent but do not wait
500- // for it to be ready so that the session can be used immediately
501- // without having to wait for the agent to be ready.
502- this . extensionService . activateByEvent ( `onChatParticipant:${ defaultAgentData . id } ` ) ;
499+ if ( this . configurationService . getValue ( 'chat.setupFromDialog' ) ) {
500+ // Activate the default extension provided agent but do not wait
501+ // for it to be ready so that the session can be used immediately
502+ // without having to wait for the agent to be ready.
503+ this . extensionService . activateByEvent ( `onChatParticipant:${ defaultAgentData . id } ` ) ;
504+ } else {
505+ // No setup participant to fall back on- wait for extension activation
506+ await this . extensionService . activateByEvent ( `onChatParticipant:${ defaultAgentData . id } ` ) ;
507+
508+ const defaultAgent = this . chatAgentService . getActivatedAgents ( ) . find ( agent => agent . id === defaultAgentData . id ) ;
509+ if ( ! defaultAgent ) {
510+ throw new ErrorNoTelemetry ( 'No default agent registered' ) ;
511+ }
512+ }
503513
504514 model . initialize ( ) ;
505515 } catch ( err ) {
You can’t perform that action at this time.
0 commit comments