diff --git a/src/lib/components/chat/Chat.svelte b/src/lib/components/chat/Chat.svelte index 715aeb985c..98ae358aa1 100644 --- a/src/lib/components/chat/Chat.svelte +++ b/src/lib/components/chat/Chat.svelte @@ -1591,9 +1591,13 @@ // Reconcile active tasks with message state: // If the response is already done, remaining tasks are just background // work (follow-ups, title gen) that shouldn't block the input. + const activeTaskIds = taskIds; const pendingTaskIds = await getTaskIdsByChatId(localStorage.token, $chatId) .then((res) => res?.task_ids ?? []) .catch(() => []); + if (taskIds !== activeTaskIds) { + return; + } const currentMessage = history.currentId ? history.messages[history.currentId] : null; const responseComplete = currentMessage?.role === 'assistant' && currentMessage?.done;