From 366200b29ddbd5319494156c0007e22f36dc0ef9 Mon Sep 17 00:00:00 2001 From: David Kaya Date: Tue, 7 Apr 2026 10:25:09 +0200 Subject: [PATCH] fix: eliminate thinking message flash before reclassification The optimistic fold previously required prior thinking messages in the pending group (pendingThinking.length > 0) before it would absorb an unclassified pending assistant message. When the first assistant message in a turn arrived before any thinking messages were classified, it briefly rendered as a full chat message, then snapped into the collapsible panel once the message-reclassified event arrived. Remove the pendingThinking.length guard so any trailing pending, unclassified assistant message during an active turn is folded into the turn-activity panel immediately, regardless of whether prior thinking messages exist. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- src/renderer/components/ChatPane.tsx | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/renderer/components/ChatPane.tsx b/src/renderer/components/ChatPane.tsx index 1a5f477..b99dd5b 100644 --- a/src/renderer/components/ChatPane.tsx +++ b/src/renderer/components/ChatPane.tsx @@ -157,15 +157,14 @@ export function ChatPane({ } // Optimistic thinking classification: fold a pending assistant - // message into the current thinking group when it immediately follows - // thinking messages during an active turn. This prevents the brief - // flash of content that occurs before a message-reclassified event - // arrives. Only the very last message qualifies — earlier messages - // have already been classified definitively. + // message into the current activity group when it immediately follows + // thinking messages during an active turn, OR when it's the very last + // message and no kind has been assigned yet. This prevents the brief + // flash where content renders as a full chat message before the + // message-reclassified event arrives. if ( busy && isLast - && pendingThinking.length > 0 && message.role === 'assistant' && message.pending && !message.messageKind