Skip to content

新增批量添加好友流程与配置#642

Merged
MistEO merged 7 commits intoMaaEnd:mainfrom
amiliyaai:feature/batch-add-friends
Feb 21, 2026
Merged

新增批量添加好友流程与配置#642
MistEO merged 7 commits intoMaaEnd:mainfrom
amiliyaai:feature/batch-add-friends

Conversation

@amiliyaai
Copy link
Contributor

@amiliyaai amiliyaai commented Feb 20, 2026

功能说明

新增“批量添加好友”任务,支持在 GUI 任务列表中配置并按既定顺序展示;任务执行时可进入添加好友页面并继续后续流程。

新增内容

  • 新增批量添加好友任务入口与流程串联
  • 任务列表中新增批量添加好友的展示位置(在库存转移之后)
  • 新增并同步多语言本地化条目:zh_cn / zh_tw / en_us / ja_jp / ko_kr

测试过什么功能

  • 批量添加好友流程:进入添加好友页 → 发送申请 → 达到数量后停止
  • uid添加好友流程:进入添加好友页 → 搜索指定uid → 添加好友后停止

关联 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:

  • 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.

@amiliyaai amiliyaai changed the title Feature/batch add friends新增批量添加好友流程与配置 新增批量添加好友流程与配置 Feb 20, 2026
Copy link
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.

你好,我这边有一些整体性的反馈:

  • 使用包级别的 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.

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

Hey - I've left some high level feedback:

  • 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.
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.

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.

@HBLADEH HBLADEH linked an issue Feb 20, 2026 that may be closed by this pull request
@MistEO MistEO merged commit e106f3a into MaaEnd:main Feb 21, 2026
17 checks passed
@amiliyaai amiliyaai deleted the feature/batch-add-friends branch February 21, 2026 08:12
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>
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