web: fold background chat safely and harden notify mode
Limit live chat paints and history syncs to the open conversation; initialize the per-run notify map lazily.
This commit is contained in:
@@ -765,7 +765,9 @@ function onChatEvent(frame) {
|
||||
// missed) appears without a manual refresh.
|
||||
const knownTurn = messageId !== "" && (thread.messages ?? []).some((m) => m?.id === messageId);
|
||||
state.chatThreads.set(sessionId, applyChatEvent(thread, frame, Date.now()));
|
||||
scheduleChatRender("transcript");
|
||||
if (state.view === "chat" && sessionId === state.chatActiveId) {
|
||||
scheduleChatRender("transcript");
|
||||
}
|
||||
if (!knownTurn) scheduleHistorySync(sessionId, messageId);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user