Batch hydrate normalized messages for session load

This commit is contained in:
Shantur Rathore
2025-11-26 10:57:39 +00:00
parent b54db28fb1
commit 91ace25333
20 changed files with 370 additions and 1371 deletions

View File

@@ -13,7 +13,6 @@ import {
fetchSessions,
fetchAgents,
fetchProviders,
removeSessionIndexes,
clearInstanceDraftPrompts,
} from "./sessions"
import { fetchCommands, clearCommands } from "./commands"
@@ -21,6 +20,7 @@ import { preferences } from "./preferences"
import { setSessionPendingPermission } from "./session-state"
import { setHasInstances } from "./ui"
import { messageStoreBus } from "./message-v2/bus"
import { clearScrollCacheForInstance } from "../lib/scroll-cache"
import type { MessageRecord } from "./message-v2/types"
@@ -296,7 +296,8 @@ function removeInstance(id: string) {
}
// Clean up session indexes and drafts for removed instance
removeSessionIndexes(id)
clearScrollCacheForInstance(id)
messageStoreBus.unregisterInstance(id)
clearInstanceDraftPrompts(id)
}