Repository navigation
fix: After parallel form collection and variable splitting, the intelligent agent converges to the variable aggregation node, and the workflow cannot be fully executed #8226
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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] 自行结束 | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Here are my observations on the provided diff: Potential Irregularities / Issues
Optimization Suggestions
Overall, the change looks like a targeted rename, but it introduces potential type and logic inconsistencies that should be addressed before merge. |
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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<unknown> | ||
| position?: unknown | ||
| chatRecordId?: string | null | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No syntax or TypeScript compatibility issue in the diff itself. Adding an optional Potential issues
Optimization suggestions
Overall: the diff is safe syntactically, but the semantics should be made explicit, especially around defaults, backend field mapping, and interactions with |
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review of the diff
1. Behavioral change (most important)
The change removes
Signal.FORMfrom the early-return guard. Previously a FORM signal stopped traversal entirely; now it continues to downstream/parallel branches. This is a semantic change, not a refactor. Make sure:next_nodes()returning early on FORM (e.g., to pause the engine, persist state, or avoid re-entry). Grep forSignal.FORMusages before merging.2. Style / idiomatic issues in the original line
__contains__directly is an anti-pattern; usein.frozenset/tuple.Signalis anEnum, prefer identity comparison for the new check.Suggested form:
Or, if you keep the single check:
3. Comment concerns
4. Docstring / contract
The method docstring (
@param nodes …) doesn't mention signals or termination semantics. Now that FORM no longer terminates traversal, document that explicitly — it's an externally observable contract.5. Edge cases to verify
self.signal is None(initial state) —==still works, but confirm the default case is covered.nodesempty /None— unchanged, fine.CANCELLEDis checked only at entry, confirm the caller re-invokesnext_nodes()after cancel, otherwise the guard never fires.6. Tests to add
CANCELLEDstill blocks downstream.FORMnode with empty anchor terminates the branch, while sibling branches still run to completion.FORMfollowed (unexpectedly) by a non-empty anchor — assert the intended behavior.7. Minor optimizations
enumidentity checks.next_nodesis called in a tight loop, hoisting the signal check is negligible but the constant avoids churn.Summary: The one-line change is reasonable and more efficient, but it silently alters control-flow semantics. Confirm FORM nodes are always leaf nodes, audit other
Signal.FORMchecks, fix the__contains__idiom, and add tests before merging.