Skip to content

Commit 3e587d8

Browse files
committed
fix(memory-core): remove legacy session fallback
1 parent 61fd2d6 commit 3e587d8

1 file changed

Lines changed: 1 addition & 14 deletions

File tree

packages/memory-host-sdk/src/host/session-files.ts

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
// Memory Host SDK module implements session files behavior.
2-
import fsSync from "node:fs";
32
import fs from "node:fs/promises";
43
import path from "node:path";
54
import { readRegularFile, statRegularFile } from "./fs-utils.js";
@@ -254,22 +253,10 @@ function readSessionTranscriptClassificationStore(
254253
storePath: string,
255254
): Record<string, SessionTranscriptStoreEntry> {
256255
try {
257-
const store = loadSessionStore(storePath, { skipCache: true }) as Record<
256+
return loadSessionStore(storePath, { skipCache: true }) as Record<
258257
string,
259258
SessionTranscriptStoreEntry
260259
>;
261-
if (Object.keys(store).length > 0) {
262-
return store;
263-
}
264-
} catch {
265-
// Fall back to legacy JSON stores below.
266-
}
267-
try {
268-
const parsed = JSON.parse(fsSync.readFileSync(storePath, "utf8")) as unknown;
269-
if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) {
270-
return {};
271-
}
272-
return parsed as Record<string, SessionTranscriptStoreEntry>;
273260
} catch {
274261
return {};
275262
}

0 commit comments

Comments
 (0)