Merged
Conversation
Contributor
There was a problem hiding this comment.
你好,我这边有一些整体性的反馈:
- 使用包级别的
state变量来跟踪进度,会让整个流程变得不可重入,而且在同一进程中运行多个 BatchAddFriends 任务时可能并不安全;建议将状态限定在Context或任务实例中,而不是使用全局可变状态。 - 在
BatchAddFriendsUIDEnterAction.Run中,当uidQueue为空时,你调用了PostStop(),而不是像BatchAddFriendsUIDLoopTopAction那样路由到BatchAddFriendsUIDEnd,这样会绕过统一的结束日志/清理流程,也可能会让state处于不一致的状态。 maafocus.NodeActionStarting中的用户可见文案以及日志(例如UID %s:已发送好友申请,添加好友进度 [...])目前是写死的;如果该功能的其他部分是本地化的,为了一致性,可以考虑从本地化资源中读取这些文案。
给 AI Agent 的提示
Please address the comments from this code review:
## Overall Comments
- The use of a package-level `state` variable for tracking progress makes the flow non-reentrant and potentially unsafe if multiple BatchAddFriends tasks run in the same process; consider scoping state to the `Context` or task instance instead of global mutable state.
- In `BatchAddFriendsUIDEnterAction.Run`, when `uidQueue` is empty you call `PostStop()` instead of routing to `BatchAddFriendsUIDEnd` like `BatchAddFriendsUIDLoopTopAction` does, which skips the unified finish logging/cleanup path and may leave `state` in an inconsistent mode.
- The user-facing messages in `maafocus.NodeActionStarting` and logs (e.g., `UID %s:已发送好友申请`, `添加好友进度 [...]`) are currently hard-coded; if the rest of the feature is localized, you may want to fetch these from the locale resources for consistency.帮我变得更有用!请在每条评论上点 👍 或 👎,我会根据你的反馈改进之后的评审。
Original comment in English
Hey - I've left some high level feedback:
- The use of a package-level
statevariable for tracking progress makes the flow non-reentrant and potentially unsafe if multiple BatchAddFriends tasks run in the same process; consider scoping state to theContextor task instance instead of global mutable state. - In
BatchAddFriendsUIDEnterAction.Run, whenuidQueueis empty you callPostStop()instead of routing toBatchAddFriendsUIDEndlikeBatchAddFriendsUIDLoopTopActiondoes, which skips the unified finish logging/cleanup path and may leavestatein an inconsistent mode. - The user-facing messages in
maafocus.NodeActionStartingand logs (e.g.,UID %s:已发送好友申请,添加好友进度 [...]) are currently hard-coded; if the rest of the feature is localized, you may want to fetch these from the locale resources for consistency.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The use of a package-level `state` variable for tracking progress makes the flow non-reentrant and potentially unsafe if multiple BatchAddFriends tasks run in the same process; consider scoping state to the `Context` or task instance instead of global mutable state.
- In `BatchAddFriendsUIDEnterAction.Run`, when `uidQueue` is empty you call `PostStop()` instead of routing to `BatchAddFriendsUIDEnd` like `BatchAddFriendsUIDLoopTopAction` does, which skips the unified finish logging/cleanup path and may leave `state` in an inconsistent mode.
- The user-facing messages in `maafocus.NodeActionStarting` and logs (e.g., `UID %s:已发送好友申请`, `添加好友进度 [...]`) are currently hard-coded; if the rest of the feature is localized, you may want to fetch these from the locale resources for consistency.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Closed
MistEO
reviewed
Feb 20, 2026
HYY1116
pushed a commit
to HYY1116/MaaEnd
that referenced
this pull request
Feb 25, 2026
## 功能说明 新增“批量添加好友”任务,支持在 GUI 任务列表中配置并按既定顺序展示;任务执行时可进入添加好友页面并继续后续流程。 ## 新增内容 - 新增批量添加好友任务入口与流程串联 - 任务列表中新增批量添加好友的展示位置(在库存转移之后) - 新增并同步多语言本地化条目:zh_cn / zh_tw / en_us / ja_jp / ko_kr ## 测试过什么功能 - 批量添加好友流程:进入添加好友页 → 发送申请 → 达到数量后停止 - uid添加好友流程:进入添加好友页 → 搜索指定uid → 添加好友后停止 ## 关联 Issue - Refs MaaEnd#309 ## Summary by Sourcery 添加一个具有可配置行为的新批量加好友任务,并将其集成到智能体任务流水线和界面中。 新功能: - 引入一个 `BatchAddFriends` 任务,支持从 UID 列表中批量加好友,或通过遍历陌生人直至达到可配置上限来加好友。 - 在任务列表/任务流水线中暴露 `BatchAddFriends` 任务,并在智能体服务中注册其自定义动作,以便可以通过图形界面(GUI)执行该任务。 改进: - 为批量加好友添加配置和状态处理,包括数量上限和连续失败保护机制,使流程更安全、更可控。 - 更新界面配置、任务定义和资源流水线,并在多种语言中增加本地化字符串,以在界面中支持新的 `BatchAddFriends` 任务。 <details> <summary>Original summary in English</summary> ## Summary by Sourcery Add a new batch add friends task with configurable behavior and integrate it into the agent task pipeline and UI. New Features: - Introduce a BatchAddFriends task that supports adding friends either from a UID list or by iterating over strangers up to a configurable limit. - Expose the BatchAddFriends task in the task list/pipeline and register its custom actions with the agent service so it can be executed from the GUI. Enhancements: - Add configuration and state handling for batch friend addition, including limits and failure streak safeguards, to make the process safer and more controllable. - Update interface configuration, task definitions, and resource pipelines, along with localized strings in multiple languages, to support the new BatchAddFriends task in the UI. </details>
MistEO
pushed a commit
that referenced
this pull request
Mar 9, 2026
## 功能说明 新增“批量添加好友”任务,支持在 GUI 任务列表中配置并按既定顺序展示;任务执行时可进入添加好友页面并继续后续流程。 ## 新增内容 - 新增批量添加好友任务入口与流程串联 - 任务列表中新增批量添加好友的展示位置(在库存转移之后) - 新增并同步多语言本地化条目:zh_cn / zh_tw / en_us / ja_jp / ko_kr ## 测试过什么功能 - 批量添加好友流程:进入添加好友页 → 发送申请 → 达到数量后停止 - uid添加好友流程:进入添加好友页 → 搜索指定uid → 添加好友后停止 ## 关联 Issue - Refs #309 ## Summary by Sourcery 添加一个具有可配置行为的新批量加好友任务,并将其集成到智能体任务流水线和界面中。 新功能: - 引入一个 `BatchAddFriends` 任务,支持从 UID 列表中批量加好友,或通过遍历陌生人直至达到可配置上限来加好友。 - 在任务列表/任务流水线中暴露 `BatchAddFriends` 任务,并在智能体服务中注册其自定义动作,以便可以通过图形界面(GUI)执行该任务。 改进: - 为批量加好友添加配置和状态处理,包括数量上限和连续失败保护机制,使流程更安全、更可控。 - 更新界面配置、任务定义和资源流水线,并在多种语言中增加本地化字符串,以在界面中支持新的 `BatchAddFriends` 任务。 <details> <summary>Original summary in English</summary> ## Summary by Sourcery Add a new batch add friends task with configurable behavior and integrate it into the agent task pipeline and UI. New Features: - Introduce a BatchAddFriends task that supports adding friends either from a UID list or by iterating over strangers up to a configurable limit. - Expose the BatchAddFriends task in the task list/pipeline and register its custom actions with the agent service so it can be executed from the GUI. Enhancements: - Add configuration and state handling for batch friend addition, including limits and failure streak safeguards, to make the process safer and more controllable. - Update interface configuration, task definitions, and resource pipelines, along with localized strings in multiple languages, to support the new BatchAddFriends task in the UI. </details>
MistEO
pushed a commit
that referenced
this pull request
Mar 9, 2026
## 功能说明 新增“批量添加好友”任务,支持在 GUI 任务列表中配置并按既定顺序展示;任务执行时可进入添加好友页面并继续后续流程。 ## 新增内容 - 新增批量添加好友任务入口与流程串联 - 任务列表中新增批量添加好友的展示位置(在库存转移之后) - 新增并同步多语言本地化条目:zh_cn / zh_tw / en_us / ja_jp / ko_kr ## 测试过什么功能 - 批量添加好友流程:进入添加好友页 → 发送申请 → 达到数量后停止 - uid添加好友流程:进入添加好友页 → 搜索指定uid → 添加好友后停止 ## 关联 Issue - Refs #309 ## Summary by Sourcery 添加一个具有可配置行为的新批量加好友任务,并将其集成到智能体任务流水线和界面中。 新功能: - 引入一个 `BatchAddFriends` 任务,支持从 UID 列表中批量加好友,或通过遍历陌生人直至达到可配置上限来加好友。 - 在任务列表/任务流水线中暴露 `BatchAddFriends` 任务,并在智能体服务中注册其自定义动作,以便可以通过图形界面(GUI)执行该任务。 改进: - 为批量加好友添加配置和状态处理,包括数量上限和连续失败保护机制,使流程更安全、更可控。 - 更新界面配置、任务定义和资源流水线,并在多种语言中增加本地化字符串,以在界面中支持新的 `BatchAddFriends` 任务。 <details> <summary>Original summary in English</summary> ## Summary by Sourcery Add a new batch add friends task with configurable behavior and integrate it into the agent task pipeline and UI. New Features: - Introduce a BatchAddFriends task that supports adding friends either from a UID list or by iterating over strangers up to a configurable limit. - Expose the BatchAddFriends task in the task list/pipeline and register its custom actions with the agent service so it can be executed from the GUI. Enhancements: - Add configuration and state handling for batch friend addition, including limits and failure streak safeguards, to make the process safer and more controllable. - Update interface configuration, task definitions, and resource pipelines, along with localized strings in multiple languages, to support the new BatchAddFriends task in the UI. </details>
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.
功能说明
新增“批量添加好友”任务,支持在 GUI 任务列表中配置并按既定顺序展示;任务执行时可进入添加好友页面并继续后续流程。
新增内容
测试过什么功能
关联 Issue
Summary by Sourcery
添加一个具有可配置行为的新批量加好友任务,并将其集成到智能体任务流水线和界面中。
新功能:
BatchAddFriends任务,支持从 UID 列表中批量加好友,或通过遍历陌生人直至达到可配置上限来加好友。BatchAddFriends任务,并在智能体服务中注册其自定义动作,以便可以通过图形界面(GUI)执行该任务。改进:
BatchAddFriends任务。Original summary in English
Summary by Sourcery
Add a new batch add friends task with configurable behavior and integrate it into the agent task pipeline and UI.
New Features:
Enhancements: