Skip to content

Commit 1760ed0

Browse files
Algorithm5838github-actions[bot]
authored andcommitted
fix: clear taskIds immediately on response done
1 parent 0905672 commit 1760ed0

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
@@ -1452,8 +1452,6 @@
14521452
await chats.set(await getChatList(localStorage.token, $currentChatPage));
14531453
}
14541454
}
1455-
1456-
taskIds = null;
14571455
};
14581456
14591457
const chatActionHandler = async (_chatId, actionId, modelId, responseMessageId, event = null) => {
@@ -1795,6 +1793,14 @@
17951793
scrollToBottom();
17961794
}
17971795
1796+
const siblingIds =
1797+
message.parentId && history.messages[message.parentId]
1798+
? history.messages[message.parentId].childrenIds
1799+
: [message.id];
1800+
if (siblingIds.every((id) => history.messages[id]?.done === true)) {
1801+
taskIds = null;
1802+
}
1803+
17981804
// Fire-and-forget: run chatCompletedHandler for background work
17991805
// (outlet filters, chat save, title gen, follow-ups, tags)
18001806
// without blocking the user from sending new messages.

0 commit comments

Comments
 (0)