Skip to content

Commit 5d31650

Browse files
Algorithm5838github-actions[bot]
authored andcommitted
fix: clear taskIds immediately on response done
1 parent 1100b98 commit 5d31650

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
@@ -1450,8 +1450,6 @@
14501450
await chats.set(await getChatList(localStorage.token, $currentChatPage));
14511451
}
14521452
}
1453-
1454-
taskIds = null;
14551453
};
14561454
14571455
const chatActionHandler = async (_chatId, actionId, modelId, responseMessageId, event = null) => {
@@ -1793,6 +1791,14 @@
17931791
scrollToBottom();
17941792
}
17951793
1794+
const siblingIds =
1795+
message.parentId && history.messages[message.parentId]
1796+
? history.messages[message.parentId].childrenIds
1797+
: [message.id];
1798+
if (siblingIds.every((id) => history.messages[id]?.done === true)) {
1799+
taskIds = null;
1800+
}
1801+
17961802
// Fire-and-forget: run chatCompletedHandler for background work
17971803
// (outlet filters, chat save, title gen, follow-ups, tags)
17981804
// without blocking the user from sending new messages.

0 commit comments

Comments
 (0)