Skip to content

Commit 4afe4d3

Browse files
Algorithm5838github-actions[bot]
authored andcommitted
fix: clear taskIds immediately on response done
1 parent b517e60 commit 4afe4d3

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

src/lib/components/chat/Chat.svelte

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1425,8 +1425,6 @@
14251425
await chats.set(await getChatList(localStorage.token, $currentChatPage));
14261426
}
14271427
}
1428-
1429-
taskIds = null;
14301428
};
14311429
14321430
const chatActionHandler = async (_chatId, actionId, modelId, responseMessageId, event = null) => {
@@ -1768,6 +1766,14 @@
17681766
scrollToBottom();
17691767
}
17701768
1769+
const siblingIds =
1770+
message.parentId && history.messages[message.parentId]
1771+
? history.messages[message.parentId].childrenIds
1772+
: [message.id];
1773+
if (siblingIds.every((id) => history.messages[id]?.done === true)) {
1774+
taskIds = null;
1775+
}
1776+
17711777
// Fire-and-forget: run chatCompletedHandler for background work
17721778
// (outlet filters, chat save, title gen, follow-ups, tags)
17731779
// without blocking the user from sending new messages.

0 commit comments

Comments
 (0)