Skip to content

Commit ed7bcb2

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

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
@@ -1418,8 +1418,6 @@
14181418
await chats.set(await getChatList(localStorage.token, $currentChatPage));
14191419
}
14201420
}
1421-
1422-
taskIds = null;
14231421
};
14241422
14251423
const chatActionHandler = async (_chatId, actionId, modelId, responseMessageId, event = null) => {
@@ -1761,6 +1759,14 @@
17611759
scrollToBottom();
17621760
}
17631761
1762+
const siblingIds =
1763+
message.parentId && history.messages[message.parentId]
1764+
? history.messages[message.parentId].childrenIds
1765+
: [message.id];
1766+
if (siblingIds.every((id) => history.messages[id]?.done === true)) {
1767+
taskIds = null;
1768+
}
1769+
17641770
// Fire-and-forget: run chatCompletedHandler for background work
17651771
// (outlet filters, chat save, title gen, follow-ups, tags)
17661772
// without blocking the user from sending new messages.

0 commit comments

Comments
 (0)