From 3d556065b0a9b2d856c8ab1352d5e37d419e5594 Mon Sep 17 00:00:00 2001 From: Rob Lourens Date: Tue, 21 May 2024 19:03:27 -0700 Subject: [PATCH] Fix "open chat in editor" Fix microsoft/vscode-copilot-release#1233 --- src/vs/workbench/contrib/chat/common/chatServiceImpl.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/vs/workbench/contrib/chat/common/chatServiceImpl.ts b/src/vs/workbench/contrib/chat/common/chatServiceImpl.ts index 296677d5bf386..4b093e1163763 100644 --- a/src/vs/workbench/contrib/chat/common/chatServiceImpl.ts +++ b/src/vs/workbench/contrib/chat/common/chatServiceImpl.ts @@ -742,7 +742,9 @@ export class ChatService extends Disposable implements IChatService { } if (model.initialLocation === ChatAgentLocation.Panel) { - this._persistedSessions[sessionId] = model.toJSON(); + // Turn all the real objects into actual JSON, otherwise, calling 'revive' may fail when it tries to + // assign values to properties that are getters- microsoft/vscode-copilot-release#1233 + this._persistedSessions[sessionId] = JSON.parse(JSON.stringify(model)); } this._sessionModels.deleteAndDispose(sessionId);