Skip to content

Commit

Permalink
finish inline chat session when EH restarts or dies (#229132)
Browse files Browse the repository at this point in the history
  • Loading branch information
jrieken authored Sep 20, 2024
1 parent 527e41f commit 82a1f0b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -204,10 +204,7 @@ export class InlineChatController implements IEditorContribution {
this._store.add(this._inlineChatSessionService.onDidEndSession(e => {
if (e.session === this._session && e.endedByExternalCause) {
this._log('session ENDED by external cause');
this._session = undefined;
this._strategy?.cancel();
this._resetWidget();
this.cancelSession();
this.finishExistingSession();
}
}));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ export class InlineChatSessionServiceImpl implements IInlineChatSessionService {
}));

store.add(this._chatAgentService.onDidChangeAgents(e => {
if (e === undefined && !this._chatAgentService.getAgent(agent.id)) {
if (e === undefined && (!this._chatAgentService.getAgent(agent.id) || !this._chatAgentService.getActivatedAgents().includes(agent))) {
this._logService.trace(`[IE] provider GONE for ${editor.getId()}, ${agent.extensionId}`);
this._releaseSession(session, true);
}
Expand Down

0 comments on commit 82a1f0b

Please sign in to comment.