Skip to content

docs: clarify on_error logic in pipeline protocol#1251

Merged
MistEO merged 9 commits intoMaaXYZ:mainfrom
NtskwK:docs/onerror
Apr 18, 2026
Merged

docs: clarify on_error logic in pipeline protocol#1251
MistEO merged 9 commits intoMaaXYZ:mainfrom
NtskwK:docs/onerror

Conversation

@NtskwK
Copy link
Copy Markdown
Contributor

@NtskwK NtskwK commented Apr 7, 2026

Summary by Sourcery

澄清并重构关于流水线节点生命周期和 on_error 行为的文档,并整理代理(agent)文档中的相关表格。

Enhancements:

  • 通过用新的「Node Flow」章节替换旧的流程图来整合节点生命周期文档,从而减少重复内容。

Documentation:

  • 使用更新后的 Mermaid 流程图和专门的「Node Flow」章节,记录详细的节点生命周期流程。
  • 澄清 on_error 节点在何时执行,明确将该行为与下一个节点的识别超时关联起来,并链接到新的流程图。
  • 调整 AGENTS.md 中的 Markdown 表格格式,以确保间距一致并提升可读性。
Original summary in English

Summary by Sourcery

Clarify and restructure documentation of the pipeline node lifecycle and on_error behavior, and tidy related tables in agent docs.

Enhancements:

  • Consolidate the node lifecycle documentation by replacing the older flowchart with the new Node Flow section to reduce duplication.

Documentation:

  • Document the detailed node lifecycle flow with an updated Mermaid flowchart and dedicated Node Flow section.
  • Clarify when on_error nodes are executed, explicitly tying the behavior to next node recognition timeout and linking to the new flowchart.
  • Adjust Markdown table formatting in AGENTS.md for consistent spacing and readability.

Copy link
Copy Markdown
Contributor

@sourcery-ai sourcery-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - 我发现了 1 个问题,并给出了一些整体性的反馈:

  • 新的流程图只建模了从下一个节点识别超时进入 on_error 的路径,但没有展示在 on_error 描述中提到的“动作执行失败”分支;建议扩展该图,将这条路径也包含进去,从而让文字说明与流程图保持一致。
  • diff 中将文件路径从 "a/docs/zh_cn/..." 改成了 "b/docs/zh_cn/..."(带有字面量引号),看起来像是无意为之,可能会导致文件路径问题;请再次确认是否确实需要这次重命名。
给 AI Agent 的提示词
Please address the comments from this code review:

## Overall Comments
- The new flowchart only models the `on_error` path from next-node recognition timeout but doesn’t show the action-failure branch mentioned in the `on_error` description; consider extending the diagram to include that path so the text and diagram stay aligned.
- The file path change from `"a/docs/zh_cn/..."` to `"b/docs/zh_cn/..."` with literal quotes in the diff looks unintentional and may cause issues with file locations; double-check whether this rename is actually desired.

## Individual Comments

### Comment 1
<location path="docs/en_us/3.1-PipelineProtocol.md" line_range="221" />
<code_context>

 - `on_error` : *string* | *NodeAttr* | *list<string | NodeAttr, >*  
-    When recognition timeout or the action fails to execute, the nodes in this list will be executed next. Optional, empty by default.  
+    When **this node's** next list has no nodes matched and the loop recognition times out, or the action fails to execute, the nodes in this list will be executed next (see [flowchart](#node-flow)). Optional, empty by default.  
     💡 Since v5.1, nodes with attributes, NodeAttr objects, or heterogeneous arrays combining both are supported. See [Node Attributes](#node-attributes) for details.

</code_context>
<issue_to_address>
**suggestion (typo):** Consider rephrasing "has no nodes matched" to more natural English, e.g. "has no matching nodes".

Consider rewording to something like "has no matching nodes" or "has no nodes matching the condition" for smoother, clearer English.

```suggestion
    When **this node's** next list has no matching nodes and the loop recognition times out, or when the action fails to execute, the nodes in this list will be executed next (see [flowchart](#node-flow)). Optional, empty by default.  
```
</issue_to_address>

Sourcery 对开源项目是免费的——如果你觉得我们的 Review 有帮助,欢迎分享 ✨
帮我变得更有用!请对每条评论点选 👍 或 👎,我会根据你的反馈改进后续的 Review。
Original comment in English

Hey - I've found 1 issue, and left some high level feedback:

  • The new flowchart only models the on_error path from next-node recognition timeout but doesn’t show the action-failure branch mentioned in the on_error description; consider extending the diagram to include that path so the text and diagram stay aligned.
  • The file path change from "a/docs/zh_cn/..." to "b/docs/zh_cn/..." with literal quotes in the diff looks unintentional and may cause issues with file locations; double-check whether this rename is actually desired.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The new flowchart only models the `on_error` path from next-node recognition timeout but doesn’t show the action-failure branch mentioned in the `on_error` description; consider extending the diagram to include that path so the text and diagram stay aligned.
- The file path change from `"a/docs/zh_cn/..."` to `"b/docs/zh_cn/..."` with literal quotes in the diff looks unintentional and may cause issues with file locations; double-check whether this rename is actually desired.

## Individual Comments

### Comment 1
<location path="docs/en_us/3.1-PipelineProtocol.md" line_range="221" />
<code_context>

 - `on_error` : *string* | *NodeAttr* | *list<string | NodeAttr, >*  
-    When recognition timeout or the action fails to execute, the nodes in this list will be executed next. Optional, empty by default.  
+    When **this node's** next list has no nodes matched and the loop recognition times out, or the action fails to execute, the nodes in this list will be executed next (see [flowchart](#node-flow)). Optional, empty by default.  
     💡 Since v5.1, nodes with attributes, NodeAttr objects, or heterogeneous arrays combining both are supported. See [Node Attributes](#node-attributes) for details.

</code_context>
<issue_to_address>
**suggestion (typo):** Consider rephrasing "has no nodes matched" to more natural English, e.g. "has no matching nodes".

Consider rewording to something like "has no matching nodes" or "has no nodes matching the condition" for smoother, clearer English.

```suggestion
    When **this node's** next list has no matching nodes and the loop recognition times out, or when the action fails to execute, the nodes in this list will be executed next (see [flowchart](#node-flow)). Optional, empty by default.  
```
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Comment thread docs/en_us/3.1-PipelineProtocol.md Outdated
NtskwK and others added 2 commits April 7, 2026 09:54
Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>
Copy link
Copy Markdown
Member

@MistEO MistEO left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

文档改进很赞,on_error 的触发逻辑描述得更清晰了,新增的 Node Flow 流程图也很直观。Thanks for the detailed docs contribution!

@MistEO
Copy link
Copy Markdown
Member

MistEO commented Apr 18, 2026

貌似有问题

image

@MistEO MistEO merged commit 2a90cb4 into MaaXYZ:main Apr 18, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants