Skip to content

Commit cd8fc2d

Browse files
Algorithm5838github-actions[bot]
authored andcommitted
fix: clear taskIds immediately on response done
1 parent 46657a0 commit cd8fc2d

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
@@ -1480,8 +1480,6 @@
14801480
await chats.set(await getChatList(localStorage.token, $currentChatPage));
14811481
}
14821482
}
1483-
1484-
taskIds = null;
14851483
};
14861484
14871485
const chatActionHandler = async (_chatId, actionId, modelId, responseMessageId, event = null) => {
@@ -1823,6 +1821,14 @@
18231821
scrollToBottom();
18241822
}
18251823
1824+
const siblingIds =
1825+
message.parentId && history.messages[message.parentId]
1826+
? history.messages[message.parentId].childrenIds
1827+
: [message.id];
1828+
if (siblingIds.every((id) => history.messages[id]?.done === true)) {
1829+
taskIds = null;
1830+
}
1831+
18261832
// Fire-and-forget: run chatCompletedHandler for background work
18271833
// (outlet filters, chat save, title gen, follow-ups, tags)
18281834
// without blocking the user from sending new messages.

0 commit comments

Comments
 (0)