From b17b9e470386036a4f75b2a0f4710fafa160d657 Mon Sep 17 00:00:00 2001 From: shaohuzhang1 Date: Mon, 30 Nov 2026 16:49:34 +0800 Subject: [PATCH] fix: After parallel form collection and variable splitting, the intelligent agent converges to the variable aggregation node, and the workflow cannot be fully executed --- apps/application/workflow/workflow_manage.py | 3 ++- ui/src/conversation-panel/components/message-list/index.ts | 4 ++-- ui/src/conversation-panel/core/types.ts | 3 ++- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/apps/application/workflow/workflow_manage.py b/apps/application/workflow/workflow_manage.py index a10bc070d1f..0bc9a2df824 100644 --- a/apps/application/workflow/workflow_manage.py +++ b/apps/application/workflow/workflow_manage.py @@ -87,7 +87,8 @@ def next_nodes(self, nodes: Optional[List[Node]]): @param nodes: 执行下面要执行的节点 @return: """ - if [Signal.FORM, Signal.CANCELLED].__contains__(self.signal): + # FORM 只阻断表单节点自身的下游(表单节点以空锚点结束),其它分支照常执行到结束 + if self.signal == Signal.CANCELLED: return if nodes is None or len(nodes) == 0: return diff --git a/ui/src/conversation-panel/components/message-list/index.ts b/ui/src/conversation-panel/components/message-list/index.ts index 56c49f2359d..74e5990c3d3 100644 --- a/ui/src/conversation-panel/components/message-list/index.ts +++ b/ui/src/conversation-panel/components/message-list/index.ts @@ -264,7 +264,7 @@ export function createMessageListStore(deps: MessageListDeps) { () => chatMessage(cid, payload), (chunk) => { if (chunk?.chat_record_id && !target.recordId) target.recordId = chunk.chat_record_id - if (opts.reChat && !replacementStarted) { + if (opts.replaceContent && !replacementStarted) { target.content = [] target.record = undefined target.write_ed = false @@ -290,7 +290,7 @@ export function createMessageListStore(deps: MessageListDeps) { const index = messages.value.indexOf(message) const question = messages.value[index - 1] if (index < 1 || question?.role !== 'USER' || !question.content[0]) return - sendMessage({ message: question.content[0], newQuestion: false, reChat: true, chatRecordId: message.recordId }) + sendMessage({ message: question.content[0], newQuestion: false, reChat: true, replaceContent: true, chatRecordId: message.recordId }) } // 优雅停止:仅通知后端取消,本地流继续读到 [DONE] 自行结束 diff --git a/ui/src/conversation-panel/core/types.ts b/ui/src/conversation-panel/core/types.ts index 245b2064795..abb01df5d96 100644 --- a/ui/src/conversation-panel/core/types.ts +++ b/ui/src/conversation-panel/core/types.ts @@ -58,7 +58,8 @@ export interface SendMessageOptions { message: ChatContent // 后端 message dict {content,type,image_list?,...} newQuestion: boolean // true=新增 question(新 USER 气泡 + 新 answer 消息);false=续跑已存在的 assistant 消息 questionContent?: ChatContent // newQuestion=true 时 USER 气泡展示的 content 项,缺省用 message - reChat?: boolean + reChat?: boolean // 透传后端 re_chat;不影响前端已有内容 + replaceContent?: boolean // true=收到首个分片时清空目标回答(重新生成);表单续跑保留已有内容并按 id 合并 formData?: Dict position?: unknown chatRecordId?: string | null