fix(shipping-notice): 优化发货通知Agent相关逻辑并修复问题

This commit is contained in:
hugo committed 2026-06-08 20:13:27 +08:00
1 parent ee90b66ff7
commit c974566c34
5 files changed
+11 -6

No files matched your search

+8
View File
@@ -2403,11 +2403,14 @@ const findHistorySessionForShippingTask = (taskId: string) => {
return history.value.find((item) => String(item.title || '').toUpperCase().includes(needle)) || null;
};
const autoResumedShippingTasks = ref<Record<string, boolean>>({});
const resumeShippingTaskFromQuery = async () => {
const taskId = shippingTaskIdFromQuery.value;
if (!taskId || !isShippingNoticeAgent.value) return;
if (route.query.conversation_id) return;
if (presetQuestion.value) return;
if (autoResumedShippingTasks.value[taskId]) return;
const existing = findHistorySessionForShippingTask(taskId);
if (existing) {
@@ -2415,6 +2418,7 @@ const resumeShippingTaskFromQuery = async () => {
return;
}
autoResumedShippingTasks.value[taskId] = true;
input.value = t('chat.shippingNoticeContinue', { taskId });
await handleSend();
};
@@ -3925,6 +3929,10 @@ const loadConversation = async (id: string, options?: { force?: boolean }) => {
loadConversationState(id, Array.isArray(loaded) ? loaded : []);
if (!loaded?.length) {
msg.warning(t('chat.historyEmpty'));
if (isShippingNoticeAgent.value && shippingTaskIdFromQuery.value && !isThinking.value) {
await router.replace({ path: route.path, query: { task_id: shippingTaskIdFromQuery.value } });
return;
}
}
void refreshShippingActions();
} catch (e) {