Skip to content

Commit 1f715da

Browse files
authored
fall back to default panel agent when not having a location specific default agent (microsoft#210070)
1 parent 67f1ea8 commit 1f715da

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -338,14 +338,14 @@ export class ChatService extends Disposable implements IChatService {
338338
model.startInitialize();
339339

340340
await this.extensionService.whenInstalledExtensionsRegistered();
341-
const defaultAgentData = this.chatAgentService.getContributedDefaultAgent(model.initialLocation);
341+
const defaultAgentData = this.chatAgentService.getContributedDefaultAgent(model.initialLocation) ?? this.chatAgentService.getContributedDefaultAgent(ChatAgentLocation.Panel);
342342
if (!defaultAgentData) {
343343
throw new ErrorNoTelemetry('No default agent contributed');
344344
}
345345

346346
await this.extensionService.activateByEvent(`onChatParticipant:${defaultAgentData.id}`);
347347

348-
const defaultAgent = this.chatAgentService.getDefaultAgent(model.initialLocation);
348+
const defaultAgent = this.chatAgentService.getActivatedAgents().find(agent => agent.id === defaultAgentData.id);
349349
if (!defaultAgent) {
350350
// Should have been registered during activation above!
351351
throw new ErrorNoTelemetry('No default agent registered');

0 commit comments

Comments
 (0)