Skip to content

Commit 0e0424c

Browse files
Algorithm5838github-actions[bot]
authored andcommitted
fix: clear taskIds immediately on response done
1 parent 41207c7 commit 0e0424c

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
@@ -1398,8 +1398,6 @@
13981398
await chats.set(await getChatList(localStorage.token, $currentChatPage));
13991399
}
14001400
}
1401-
1402-
taskIds = null;
14031401
};
14041402
14051403
const chatActionHandler = async (_chatId, actionId, modelId, responseMessageId, event = null) => {
@@ -1741,6 +1739,14 @@
17411739
scrollToBottom();
17421740
}
17431741
1742+
const siblingIds =
1743+
message.parentId && history.messages[message.parentId]
1744+
? history.messages[message.parentId].childrenIds
1745+
: [message.id];
1746+
if (siblingIds.every((id) => history.messages[id]?.done === true)) {
1747+
taskIds = null;
1748+
}
1749+
17441750
// Fire-and-forget: run chatCompletedHandler for background work
17451751
// (outlet filters, chat save, title gen, follow-ups, tags)
17461752
// without blocking the user from sending new messages.

0 commit comments

Comments
 (0)