feat: 添加重置节点命中计数的通用Custom 自定义动作,并添加对应文档和示例#1063
Merged
MistEO merged 3 commits intoMaaEnd:mainfrom Mar 7, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
Hey - 我发现了 1 个问题,并给出了一些整体层面的反馈:
- 在
ClearHitCountAction.Run中,对空节点名的检查仅使用nodeName == "";建议在检查前先去除空白字符(trim),这样像" "这样的名称也会被视为无效。 - 当部分节点清除失败但
strict为false时,该 action 仍然会记录错误日志;如果在此模式下预期会出现部分失败,建议将这些日志级别从 error 降级为 warning 或 info,以减少正常运行时的噪音。
给 AI Agent 的提示词
Please address the comments from this code review:
## Overall Comments
- In `ClearHitCountAction.Run`, empty node names are only checked by `nodeName == ""`; consider trimming whitespace so names like `" "` are also treated as invalid.
- When some nodes fail to clear but `strict` is `false`, the action still logs errors; if partial failure is expected in this mode, consider downgrading those logs to warning or info to reduce noise in normal operation.
## Individual Comments
### Comment 1
<location path="docs/zh_cn/developers/custom-action.md" line_range="64" />
<code_context>
+- **注意事项**
+ - 节点按 `nodes` 数组顺序依次清除计数,某个节点清除失败不影响其他节点的清除。
+ - 节点名称必须与 Pipeline 中定义的节点名称完全一致。
+ - 节点不存在或从未被执行过时,清除操作会失败。
+ - 当 `strict: false` 时,即使部分节点清除失败,action 也会返回成功,适用于清理可能不存在的可选节点。
+ - 当 `strict: true` 时,任一节点清除失败都会导致 action 返回失败,适用于关键节点的计数清理。
</code_context>
<issue_to_address>
**question:** Clarify whether the Chinese description should match the English condition (“recognized successfully” vs “executed”).
The English text says “Clearing a node will fail if the node does not exist or has never been recognized successfully,” while the Chinese reads “节点不存在或从未被执行过时,清除操作会失败.” These differ (“recognized successfully” vs “executed”). Please confirm the intended behavior and update one language so they describe the same condition.
</issue_to_address>帮我变得更有用!请在每条评论上点 👍 或 👎,我会根据你的反馈持续改进代码评审质量。
Original comment in English
Hey - I've found 1 issue, and left some high level feedback:
- In
ClearHitCountAction.Run, empty node names are only checked bynodeName == ""; consider trimming whitespace so names like" "are also treated as invalid. - When some nodes fail to clear but
strictisfalse, the action still logs errors; if partial failure is expected in this mode, consider downgrading those logs to warning or info to reduce noise in normal operation.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- In `ClearHitCountAction.Run`, empty node names are only checked by `nodeName == ""`; consider trimming whitespace so names like `" "` are also treated as invalid.
- When some nodes fail to clear but `strict` is `false`, the action still logs errors; if partial failure is expected in this mode, consider downgrading those logs to warning or info to reduce noise in normal operation.
## Individual Comments
### Comment 1
<location path="docs/zh_cn/developers/custom-action.md" line_range="64" />
<code_context>
+- **注意事项**
+ - 节点按 `nodes` 数组顺序依次清除计数,某个节点清除失败不影响其他节点的清除。
+ - 节点名称必须与 Pipeline 中定义的节点名称完全一致。
+ - 节点不存在或从未被执行过时,清除操作会失败。
+ - 当 `strict: false` 时,即使部分节点清除失败,action 也会返回成功,适用于清理可能不存在的可选节点。
+ - 当 `strict: true` 时,任一节点清除失败都会导致 action 返回失败,适用于关键节点的计数清理。
</code_context>
<issue_to_address>
**question:** Clarify whether the Chinese description should match the English condition (“recognized successfully” vs “executed”).
The English text says “Clearing a node will fail if the node does not exist or has never been recognized successfully,” while the Chinese reads “节点不存在或从未被执行过时,清除操作会失败.” These differ (“recognized successfully” vs “executed”). Please confirm the intended behavior and update one language so they describe the same condition.
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
- strict 模式下失败记录 error 级别日志 - 非 strict 模式下失败记录 warning 级别日志 - 减少非严格模式下的日志噪音
- 中英文文档统一使用'从未被执行过'(never been executed) - 更准确描述节点状态,避免技术实现细节带来的混淆 - 从用户角度理解节点执行流程
Contributor
There was a problem hiding this comment.
Hey - 我已经审查了你的更改,看起来很棒!
帮我变得更有用!请在每条评论上点 👍 或 👎,我会根据你的反馈改进后续的评审。
Original comment in English
Hey - I've reviewed your changes and they look great!
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
MistEO
pushed a commit
that referenced
this pull request
Mar 9, 2026
MistEO
pushed a commit
that referenced
this pull request
Mar 9, 2026
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.
变更内容
新增功能
ClearHitCount自定义动作,用于清除指定节点的命中计数strict参数控制清除失败时的行为Summary by Sourcery
添加一个新的
ClearHitCount自定义动作,用于重置节点命中次数,并通过示例文档说明其用法。新功能:
ClearHitCount自定义动作,用于清除一个或多个指定节点的命中次数,并支持可选的严格失败处理。增强:
ClearHitCount自定义动作,以便可以通过 Custom 机制调用。文档:
ClearHitCount自定义动作的相关内容,包括参数、行为和注意事项。ClearHitCount自定义动作。Original summary in English
Summary by Sourcery
Add a new ClearHitCount custom action to reset node hit counts and document its usage with examples.
New Features:
Enhancements:
Documentation:
新特性:
ClearHitCount自定义动作,可在可选的严格失败处理模式下,清除一个或多个指定节点的命中计数。功能增强:
ClearHitCount自定义动作,使其可以通过 Custom 机制被调用。文档:
ClearHitCount自定义动作的相关内容,包括参数、行为及使用注意事项。ClearHitCount自定义动作。Original summary in English
Summary by Sourcery
添加一个新的
ClearHitCount自定义动作,用于重置节点命中次数,并通过示例文档说明其用法。新功能:
ClearHitCount自定义动作,用于清除一个或多个指定节点的命中次数,并支持可选的严格失败处理。增强:
ClearHitCount自定义动作,以便可以通过 Custom 机制调用。文档:
ClearHitCount自定义动作的相关内容,包括参数、行为和注意事项。ClearHitCount自定义动作。Original summary in English
Summary by Sourcery
Add a new ClearHitCount custom action to reset node hit counts and document its usage with examples.
New Features:
Enhancements:
Documentation: