diff --git a/clients/shared/Features/Chat/ChatActionHandler.swift b/clients/shared/Features/Chat/ChatActionHandler.swift index 9e92a8b05e9..0012e5c71f7 100644 --- a/clients/shared/Features/Chat/ChatActionHandler.swift +++ b/clients/shared/Features/Chat/ChatActionHandler.swift @@ -348,11 +348,11 @@ final class ChatActionHandler { guard belongsToConversation(complete.conversationId) else { return } // Auxiliary message_complete events (watch notifiers, call notifications) // that lack a messageId should not reset the main agent turn state. - // Only filter when a main agent turn is actively streaming - // (currentAssistantMessageId is set). This allows slash commands and other - // non-auxiliary completions (which don't set currentAssistantMessageId) - // to process normally. - if complete.messageId == nil && vm.currentAssistantMessageId != nil { + // Filter when a main agent turn is actively streaming (currentAssistantMessageId + // is set) OR still in the thinking phase (isThinking is true but + // currentAssistantMessageId hasn't been set yet by the first streaming flush). + // This allows slash commands and other non-auxiliary completions to process normally. + if complete.messageId == nil && (vm.currentAssistantMessageId != nil || vm.isThinking) { return } // Flush any buffered streaming text before finalizing the message.