Skip to content

Commit 8222926

Browse files
authored
Merge pull request #245254 from microsoft/roblou/reliable-chicken
Different fix for chat extension welcome views not showing
2 parents cb9445f + 174ad15 commit 8222926

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

src/vs/workbench/contrib/chat/common/chatServiceImpl.ts

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff 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) {

0 commit comments

Comments
 (0)