From 2856def6c05b2fb8c55b4e7170f05db0c4f956f1 Mon Sep 17 00:00:00 2001 From: Timothy Jaeryang Baek Date: Mon, 29 Jun 2026 12:12:23 -0500 Subject: [PATCH] refac --- src/lib/components/chat/Chat.svelte | 4 ++++ 1 file changed, 4 insertions(+) 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;