Skip to content

Commit f2c8acb

Browse files
authored
Use safe stringify for agent session cache (#292537)
1 parent 66cc770 commit f2c8acb

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsModel.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import { IMarkdownString } from '../../../../../base/common/htmlContent.js';
1212
import { Disposable } from '../../../../../base/common/lifecycle.js';
1313
import { ResourceMap } from '../../../../../base/common/map.js';
1414
import { MarshalledId } from '../../../../../base/common/marshallingIds.js';
15+
import { safeStringify } from '../../../../../base/common/objects.js';
1516
import { ThemeIcon } from '../../../../../base/common/themables.js';
1617
import { URI, UriComponents } from '../../../../../base/common/uri.js';
1718
import { localize } from '../../../../../nls.js';
@@ -725,7 +726,7 @@ class AgentSessionsCache {
725726
metadata: session.metadata
726727
} satisfies ISerializedAgentSession));
727728

728-
this.storageService.store(AgentSessionsCache.SESSIONS_STORAGE_KEY, JSON.stringify(serialized), StorageScope.WORKSPACE, StorageTarget.MACHINE);
729+
this.storageService.store(AgentSessionsCache.SESSIONS_STORAGE_KEY, safeStringify(serialized), StorageScope.WORKSPACE, StorageTarget.MACHINE);
729730
}
730731

731732
loadCachedSessions(): IInternalAgentSessionData[] {

0 commit comments

Comments
 (0)