From 03476c3864e1f49df1a30652a5088d1af4dc3ad8 Mon Sep 17 00:00:00 2001 From: Peng Lyu Date: Tue, 18 Jun 2024 11:10:17 -0700 Subject: [PATCH] fix #215421 --- .../browser/controller/chat/notebookChatController.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/vs/workbench/contrib/notebook/browser/controller/chat/notebookChatController.ts b/src/vs/workbench/contrib/notebook/browser/controller/chat/notebookChatController.ts index a8441f86c2d..5558c1a7b69 100644 --- a/src/vs/workbench/contrib/notebook/browser/controller/chat/notebookChatController.ts +++ b/src/vs/workbench/contrib/notebook/browser/controller/chat/notebookChatController.ts @@ -471,6 +471,10 @@ export class NotebookChatController extends Disposable implements INotebookEdito this._sessionCtor = createCancelablePromise(async token => { await this._startSession(token); + assertType(this._model.value); + const model = this._model.value; + this._widget?.inlineChatWidget.setChatModel(model); + if (fakeParentEditor.hasModel()) { if (this._widget) { @@ -548,9 +552,6 @@ export class NotebookChatController extends Disposable implements INotebookEdito assertType(this._model.value); assertType(this._strategy); - const model = this._model.value; - this._widget.inlineChatWidget.setChatModel(model); - const lastInput = this._widget.inlineChatWidget.value; this._historyUpdate(lastInput);