diff --git a/public/app.js b/public/app.js index f8957d0..da31d83 100644 --- a/public/app.js +++ b/public/app.js @@ -2,7 +2,7 @@ (function () { 'use strict'; - const ASSET_VERSION = '20260622-queued-send'; + const ASSET_VERSION = '20260622-streaming-restore'; const WS_URL = `${location.protocol === 'https:' ? 'wss' : 'ws'}://${location.host}/ws`; const RENDER_DEBOUNCE = 100; const COMPOSER_SUGGESTION_DEBOUNCE = 120; @@ -3196,10 +3196,11 @@ function currentSessionWaitState() { const meta = currentSessionId ? getSessionMeta(currentSessionId) : null; const cached = currentSessionId ? sessionCache.get(currentSessionId)?.snapshot : null; + const source = meta || cached || {}; return { - waitingOnChildren: !!(meta?.waitingOnChildren || cached?.waitingOnChildren), - pendingReplyCount: Number(meta?.pendingReplyCount ?? cached?.pendingReplyCount ?? 0), - readyReplyCount: Number(meta?.readyReplyCount ?? cached?.readyReplyCount ?? 0), + waitingOnChildren: !!source.waitingOnChildren, + pendingReplyCount: Number(source.pendingReplyCount || 0), + readyReplyCount: Number(source.readyReplyCount || 0), }; } @@ -3342,6 +3343,9 @@ currentModel = snapshot.model || ''; if (!preserveStreaming) { renderMessages(snapshot.messages || [], { immediate: !!options.immediate }); + if (snapshot.isRunning && snapshot.sessionId === currentSessionId) { + startGenerating(snapshot.sessionId); + } } else { generatingSessionId = snapshot.sessionId; } @@ -4122,16 +4126,30 @@ case 'session_message': if (msg.sessionId && msg.message) { + const isCrossConversationReply = !!msg.message.crossConversation?.replyToRequestId; updateCachedSession(msg.sessionId, (snapshot) => { snapshot.messages = Array.isArray(snapshot.messages) ? snapshot.messages : []; snapshot.messages.push(deepClone(msg.message)); snapshot.updated = msg.message.timestamp || new Date().toISOString(); - if (msg.message.crossConversation?.replyToRequestId) { + if (isCrossConversationReply) { snapshot.readyReplyCount = Math.max(0, Number(snapshot.readyReplyCount || 0) - 1); snapshot.pendingReplyCount = Math.max(0, Number(snapshot.pendingReplyCount || 0) - 1); snapshot.waitingOnChildren = Number(snapshot.pendingReplyCount || 0) > 0; } }); + if (isCrossConversationReply) { + sessions = sessions.map((session) => { + if (session.id !== msg.sessionId) return session; + const pendingReplyCount = Math.max(0, Number(session.pendingReplyCount || 0) - 1); + const readyReplyCount = Math.max(0, Number(session.readyReplyCount || 0) - 1); + return { + ...session, + readyReplyCount, + pendingReplyCount, + waitingOnChildren: pendingReplyCount > 0, + }; + }); + } } if (msg.sessionId === currentSessionId && msg.message) { collectClosedCollabAgentIds([msg.message]).forEach((id) => closedCollabAgentIds.add(id)); diff --git a/public/index.html b/public/index.html index 0650692..ba4200c 100644 --- a/public/index.html +++ b/public/index.html @@ -14,7 +14,7 @@ document.documentElement.dataset.dividerTime = dividerTime; })(); - +
@@ -163,6 +163,6 @@ - +