docs: 阐明 jump_back 在 on_error 场景下的回跳机制 - #1439
Open
sunyink wants to merge 1 commit into
Open
Conversation
Contributor
There was a problem hiding this comment.
Hey - 我在这里给出了一些高层次的反馈:
- 建议将“error state(错误状态)”的定义从当前局部引用块中移出,放到一个专门的术语表/术语章节中,然后在这里引用它,这样可以在整个协议文档中一致地复用这个术语。
- 终止条件中的短语“if
[JumpBack]points exist and the flow is not in the error state(如果存在[JumpBack]点且流程不处于错误状态)”可以更明确地与后文的定义关联起来(例如:“not in the transient error state described below(未处于下文所述的瞬时错误状态)”),以避免与其他错误处理概念混淆。
给 AI 代理的提示
Please address the comments from this code review:
## Overall Comments
- Consider moving the definition of the “error state” out of a local blockquote into a dedicated glossary/terminology section and referencing it here, so the term can be reused consistently across the protocol docs.
- The phrase “if `[JumpBack]` points exist and the flow is not in the error state” in the termination conditions might be clearer if it explicitly ties to the later definition (e.g. “not in the transient error state described below”) to avoid confusion with other error-handling concepts.帮我变得更有用!请对每条评论点击 👍 或 👎,我会根据你的反馈改进后续评审。
Original comment in English
Hey - I've left some high level feedback:
- Consider moving the definition of the “error state” out of a local blockquote into a dedicated glossary/terminology section and referencing it here, so the term can be reused consistently across the protocol docs.
- The phrase “if
[JumpBack]points exist and the flow is not in the error state” in the termination conditions might be clearer if it explicitly ties to the later definition (e.g. “not in the transient error state described below”) to avoid confusion with other error-handling concepts.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Consider moving the definition of the “error state” out of a local blockquote into a dedicated glossary/terminology section and referencing it here, so the term can be reused consistently across the protocol docs.
- The phrase “if `[JumpBack]` points exist and the flow is not in the error state” in the termination conditions might be clearer if it explicitly ties to the later definition (e.g. “not in the transient error state described below”) to avoid confusion with other error-handling concepts.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
问题
3.1的jump_back/[JumpBack]一节原文:「路径」读起来像一块区域——只要还在
on_error列表里就都算,于是很容易得出「on_error里写[JumpBack]一律无效」、「子节点链中途进入on_error后就不会回跳」的结论。但实现里它是一个瞬时状态位,不是区域。实现
source/MaaFramework/Task/PipelineTask.cpp的run():error_handling由「next列表识别超时」或「节点动作执行失败」置位,被任何后续节点的识别命中清零——不区分该节点来自next还是on_error。因此:next识别超时 →on_error中有节点命中on_error中有节点命中on_error为空 / 其中全部未命中原文那句话只对第三种情形成立。
验证
在 5.11.1 与 5.12.2 上各跑了一组单变量对照(
CustomController恒定截图 + 恒不命中的CustomRecognition+ 计数用CustomAction),两个版本结果完全一致:next: ["B"]next: ["[JumpBack]B"]next超时 →on_error: ["B"]next超时 →on_error: ["[JumpBack]B"]on_error: ["[JumpBack]B"]next)on_error为空on_error放一个DirectHit节点E1/E3 与 E4/E5 各自只差一个变量:前者是
[JumpBack]前缀的有无,后者是on_error里有没有节点接得住。E4/E5 这一对正是原文那句话真正成立的边界。E2 的事件序列(
Node.*回调):改动
只改措辞,把「错误处理路径」明确为「错误处理状态」,并补上它的进入与解除条件;
jump_back一节的主句改为讲「已登记的回跳在后续链失败时是否兑现」——这才是该节的正题,「on_error里能否写[JumpBack]」作为推论放在末尾一句。同时同步了「终止条件」与「执行流程」中相应的两处表述。中英文对称。变更日志中 v5.1 / v5.9 的历史条目未改动。其中 v5.9 的「(错误处理路径不触发回跳)」同样偏宽,但属历史记录,若维护者认为需要一并修正,我可以补上。
🤖 Generated with Claude Code
Summary by Sourcery
在流水线任务文档中澄清关于错误状态和错误处理的跳回(jump-back)行为说明,而不更改运行时行为。
文档更新内容:
jump_back选项文档,解释“瞬时错误状态”的含义、进入与清除该状态的方式,以及在on_error中匹配到[JumpBack]后其仅会生效一次。Original summary in English
Summary by Sourcery
Clarify the jump-back behavior in pipeline task documentation around error states and error handling, without changing runtime behavior.
Documentation:
jump_backoption docs in both English and Chinese to explain the transient error state, how it is entered and cleared, and that[JumpBack]insideon_errorworks once matched.