Skip to content

Commit 3eb7fca

Browse files
Algorithm5838github-actions[bot]
authored andcommitted
fix: clear taskIds immediately on response done
1 parent a85b876 commit 3eb7fca

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
@@ -1465,8 +1465,6 @@
14651465
await chats.set(await getChatList(localStorage.token, $currentChatPage));
14661466
}
14671467
}
1468-
1469-
taskIds = null;
14701468
};
14711469
14721470
const chatActionHandler = async (_chatId, actionId, modelId, responseMessageId, event = null) => {
@@ -1808,6 +1806,14 @@
18081806
scrollToBottom();
18091807
}
18101808
1809+
const siblingIds =
1810+
message.parentId && history.messages[message.parentId]
1811+
? history.messages[message.parentId].childrenIds
1812+
: [message.id];
1813+
if (siblingIds.every((id) => history.messages[id]?.done === true)) {
1814+
taskIds = null;
1815+
}
1816+
18111817
// Fire-and-forget: run chatCompletedHandler for background work
18121818
// (outlet filters, chat save, title gen, follow-ups, tags)
18131819
// without blocking the user from sending new messages.

0 commit comments

Comments
 (0)