diff --git a/src/stores/chat.ts b/src/stores/chat.ts index cc000ea24..2928ffe94 100644 --- a/src/stores/chat.ts +++ b/src/stores/chat.ts @@ -1010,19 +1010,10 @@ export const useChatStore = create((set, get) => ({ // ── New session ── newSession: () => { - const { currentSessionKey } = get(); - - // Notify the gateway that the old session is ending so the session-memory - // hook can persist conversation memories to memory/YYYY-MM-DD-.md. - if (currentSessionKey) { - void window.electron.ipcRenderer.invoke( - 'gateway:rpc', - 'sessions.reset', - { key: currentSessionKey, reason: 'new' }, - ).catch(() => { /* fire-and-forget */ }); - } - - // Generate a new unique session key and switch to it + // Generate a new unique session key and switch to it. + // NOTE: We intentionally do NOT call sessions.reset on the old session. + // sessions.reset archives (renames) the session JSONL file, making old + // conversation history inaccessible when the user switches back to it. const prefix = getCanonicalPrefixFromSessions(get().sessions) ?? DEFAULT_CANONICAL_PREFIX; const newKey = `${prefix}:session-${Date.now()}`; const newSessionEntry: ChatSession = { key: newKey, displayName: newKey };