diff --git a/apps/desktop/src/app/session/hooks/use-session-actions/index.ts b/apps/desktop/src/app/session/hooks/use-session-actions/index.ts index d8a7e0bd15d1..96c8c913b56c 100644 --- a/apps/desktop/src/app/session/hooks/use-session-actions/index.ts +++ b/apps/desktop/src/app/session/hooks/use-session-actions/index.ts @@ -536,6 +536,16 @@ export function useSessionActions({ setFreshDraftReady(false) setActiveSessionId(null) activeSessionIdRef.current = null + // A warm-cache hit at entry skipped the cold-path transcript clear, but the + // warm path can still bail down to here — an empty-transcript drop, or the + // cache getting purged during the profile-swap await — so the PREVIOUS + // session's transcript would leak into this cold resume ("switching + // sessions shows the same messages"). Clear it so the loader/prefetch + // paints fresh; guarded so the normal cold path (already cleared) no-ops. + if ($messages.get().length > 0) { + setMessages([]) + } + busyRef.current = true setBusy(true) setAwaitingResponse(false)