Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions clients/shared/Features/Chat/ChatActionHandler.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down