This commit is contained in:
Timothy Jaeryang Baek
2026-06-29 03:03:36 -05:00
parent 7be009649a
commit 388f62f8a0

View File

@@ -555,6 +555,10 @@
}
} else if (type === 'context_compaction') {
handleContextCompactionStatus(data);
} else if (type === 'chat:active') {
if (!data?.active) {
taskIds = null;
}
} else if (type === 'chat:completion') {
chatCompletionEventHandler(data, message, event.chat_id);
} else if (type === 'chat:tasks:cancel') {
@@ -1614,7 +1618,6 @@
currentChatPage.set(1);
await chats.set(await getChatList(localStorage.token, $currentChatPage));
}
taskIds = null;
};
const chatActionHandler = async (_chatId, actionId, modelId, responseMessageId, event = null) => {
@@ -2584,10 +2587,8 @@
} else {
// Backend returns task_ids (multi-model) or task_id (single model)
const newTaskIds = res.task_ids ?? (res.task_id ? [res.task_id] : []);
if (taskIds) {
taskIds.push(...newTaskIds);
} else {
taskIds = newTaskIds;
if (newTaskIds.length > 0) {
taskIds = [...(taskIds ?? []), ...newTaskIds];
}
// Backend returns chat_id for new chats — set store + URL.