Skip to content

feat(maaend): 支持直控、支持额外的送货和自动采集安排 - #588

Merged
HarcoChen merged 11 commits into
AUTO-MAS-Project:devfrom
HarcoChen:feat/maaend-deliver-mode-v2
Sep 7, 2026
Merged

feat(maaend): 支持直控、支持额外的送货和自动采集安排#588
HarcoChen merged 11 commits into
AUTO-MAS-Project:devfrom
HarcoChen:feat/maaend-deliver-mode-v2

Conversation

@HarcoChen

@HarcoChen HarcoChen commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

摘要

  • 新增 MaaEnd 脚本直控模式(配置来源:脚本/用户/直控)
  • 抢委托送货独立为送货阶段,可单独配置接取价格与委托接收点
  • 自动采集独立为三日周期阶段,支持分散/集中安排与区域/通用两类路线
  • 用户配置页重构为锚点导航加分区的卡片布局,并修复修改送货配置时输入不稳定的问题

专项适配基线模板已拆分至 #587,可先行合并。

Sourcery 总结

扩展 MaaEnd 配置和自动化功能,支持直接控制、独立的派送与自动收取阶段,并提升用户配置体验的可靠性。

新功能:

  • 新增直接控制 MaaEnd 配置,同时支持共享脚本和按用户配置模式。
  • 将派送和自动收取作为独立的 MaaEnd 阶段运行,并支持配置派送阈值、委托来源、收取计划和路线。

错误修复:

  • 在并发自动保存期间保留待处理的用户字段更新,避免派送设置输入不稳定以及更改丢失。
  • 在直接控制会话结束或发生故障后,安全恢复 MaaEnd 工作配置。

改进:

  • 重构 MaaEnd 自动化功能,使其能够独立选择并执行日常、派送和自动收取阶段,同时支持三日路线计划和旧版配置兼容。
  • 将 MaaEnd 用户编辑器重构为带锚点的卡片分区,并新增专用的派送和自动收取配置面板。
  • 扩展 MaaEnd 配置架构、验证逻辑、API 默认值以及本地化标签,以支持新的模式和任务设置。
Original summary in English

Sourcery 摘要

扩展 MaaEnd 的配置来源和自动化阶段,并提升任务执行可靠性与用户配置体验。

新功能:

  • 为 MaaEnd 增加脚本共享、用户独立和脚本直控三种配置来源。
  • 将送货和自动采集拆分为独立运行阶段,并支持送货门槛与委托接收点、三日采集计划及区域和通用路线配置。

错误修复:

  • 改进用户配置自动保存,保留并合并并发期间的字段更新,避免输入抖动和修改丢失。
  • 在直控配置会话结束或异常时恢复原有工作配置,并在开发环境手动停止任务时保留游戏进程。

改进:

  • 重构 MaaEnd 自动代理的阶段调度、任务筛选和旧版配置兼容逻辑。
  • 重构 MaaEnd 用户配置页为带锚点导航的分区卡片布局,并新增送货和自动采集配置面板。
  • 扩展 MaaEnd 配置模型、校验、API 默认值和本地化内容,以覆盖新增任务设置。

构建:

  • 将 pytest 添加为开发依赖组。

文档:

  • 更新测试开发说明,明确开发依赖安装方式和专项测试规则。

杂项:

  • 同步更新前后端 MaaEnd 任务与路线选项定义。
Original summary in English

Sourcery 总结

扩展 MaaEnd 的配置来源和阶段化自动化能力,并提升配置编辑与任务执行的可靠性。

新功能:

  • 支持 MaaEnd 脚本共享、用户独立和脚本直控三种配置来源。
  • 将送货和自动采集拆分为独立运行阶段,支持送货门槛与委托接收点,以及三日周期、区域和通用采集路线安排。
  • 支持阶段间可选重启游戏或仅重启 MaaEnd,并在直控配置会话中保留原生配置变更。

问题修复:

  • 改进用户配置自动保存,合并并发期间的字段更新,避免输入抖动和修改丢失。
  • 增强 MaaEnd 配置会话异常后的配置恢复,并区分开发环境手动停止任务时的进程清理行为。
  • 为带阶段前缀的运行结果提供正确的成功统计和历史记录展示。

改进:

  • 重构 MaaEnd 自动代理的阶段调度、任务筛选、路线选择和旧版配置兼容逻辑。
  • 重构 MaaEnd 用户配置页为带锚点导航的分区卡片布局,并新增送货与自动采集配置面板。
  • 扩展前后端 MaaEnd 配置模型、校验、默认值、类型定义和本地化内容。

构建:

  • 将 pytest 添加到开发依赖组。

文档:

  • 更新测试开发说明,明确开发依赖安装方式和专项测试规则。

杂项:

  • 同步前后端 MaaEnd 任务与路线选项定义。
Original summary in English

Sourcery 摘要

扩展 MaaEnd 的配置来源和阶段化自动化能力,并提升配置编辑与任务执行的可靠性。

新功能:

  • 支持 MaaEnd 脚本共享、用户独立和脚本直控三种配置来源。
  • 将送货和自动采集拆分为独立运行阶段,并提供送货条件、三日采集周期及区域和通用路线配置。
  • 支持阶段间可选重启游戏或仅重启 MaaEnd,并记录每日仅执行一次的任务。

错误修复:

  • 改进用户配置自动保存,合并并发期间的字段更新以避免输入抖动和修改丢失。
  • 增强 MaaEnd 配置会话异常后的配置恢复,并保留直控模式下成功写回的原生配置。
  • 修正带阶段结果前缀的历史记录统计和展示。

改进:

  • 重构 MaaEnd 自动代理的阶段调度、任务筛选、路线选择和旧版配置兼容逻辑。
  • 重构 MaaEnd 用户配置页为带锚点导航的分区卡片布局,并新增送货与自动采集配置面板。
  • 同步扩展前后端 MaaEnd 配置模型、校验、默认值、类型定义和本地化内容。

构建:

  • 将 pytest 添加到开发依赖组。

文档:

  • 更新测试开发说明,明确开发依赖安装方式和专项测试规则。

杂项:

  • 同步前后端 MaaEnd 任务与路线选项定义。
Original summary in English

Sourcery 摘要

扩展 MaaEnd 的配置来源和阶段化自动化能力,同时提升任务执行可靠性与用户配置体验。

新功能:

  • 为 MaaEnd 增加脚本共享、用户独立和脚本直控三种配置来源。
  • 将送货和自动采集拆分为独立运行阶段,并支持送货条件、委托接收点、三日采集计划及区域和通用路线配置。
  • 支持阶段间选择仅重启 MaaEnd 或同时重启游戏,并记录每日仅执行一次的任务。

错误修复:

  • 改进用户配置自动保存,合并并发期间的字段更新,避免输入抖动和修改丢失。
  • 增强直控配置会话异常后的配置恢复,并修正阶段结果历史记录及成功统计展示。
  • 开发模式下手动停止任务时保留游戏进程。

改进:

  • 重构 MaaEnd 自动代理的阶段调度、任务筛选、路线选择和旧版配置兼容逻辑。
  • 重构 MaaEnd 用户配置页为带锚点导航的分区卡片布局,并新增送货和自动采集配置面板。
  • 同步扩展前后端 MaaEnd 配置模型、校验、默认值、类型定义和本地化内容。

构建:

  • 将 pytest 添加到开发依赖组。

文档:

  • 更新测试开发说明,明确开发依赖安装方式和专项测试规则。

杂项:

  • 同步更新前后端 MaaEnd 任务与路线选项定义。
Original summary in English

Sourcery 摘要

扩展 MaaEnd 的配置来源与阶段化自动化能力,同时提升任务执行可靠性和用户配置体验。

新功能:

  • 为 MaaEnd 增加脚本共享、用户独立和脚本直控三种配置来源。
  • 将送货和自动采集拆分为独立阶段,支持送货条件、三日采集计划、区域与通用路线配置。
  • 支持阶段切换时仅重启 MaaEnd 或同时重启游戏,并提供每日仅执行一次的任务安排。

错误修复:

  • 改进用户配置自动保存,合并并发期间的字段更新,避免输入抖动和修改丢失。
  • 增强直控配置会话异常后的工作配置恢复,并修正阶段化运行结果的历史记录与成功统计展示。
  • 开发模式下手动停止任务时保留游戏进程。

改进:

  • 重构 MaaEnd 自动代理的阶段调度、任务筛选、路线选择及旧版配置兼容逻辑。
  • 重构 MaaEnd 用户配置页为带锚点导航的分区卡片布局,并新增送货和自动采集配置面板。
  • 同步扩展前后端 MaaEnd 配置模型、校验、默认值、类型定义和本地化内容。

构建:

  • 将 pytest 添加到开发依赖组。

文档:

  • 更新测试开发说明,明确开发依赖安装方式和专项测试规则。

测试:

  • 补充每日任务配置 JSON 字符串契约的模型校验测试。

杂项:

  • 同步更新前后端 MaaEnd 任务与路线选项定义。
Original summary in English

Sourcery 摘要

扩展 MaaEnd 的配置来源与阶段化自动化能力,同时提升任务执行可靠性和用户配置体验。

New Features:

  • 为 MaaEnd 增加脚本共享、用户独立和脚本直控三种配置来源。
  • 将送货和自动采集拆分为独立运行阶段,支持送货条件、三日采集周期及区域和通用路线配置。
  • 支持阶段切换时仅重启 MaaEnd 或同时重启游戏,并提供每日仅执行一次的任务安排。

Bug Fixes:

  • 改进用户配置自动保存,合并并发期间的字段更新,避免输入抖动和修改丢失。
  • 增强直控配置会话异常后的配置恢复,并修正阶段化运行结果的历史记录与成功统计展示。
  • 开发模式下手动停止任务时保留游戏进程。

Enhancements:

  • 重构 MaaEnd 自动代理的阶段调度、任务筛选、路线选择及旧版配置兼容逻辑。
  • 重构 MaaEnd 用户配置页为带锚点导航的分区卡片布局,并新增送货与自动采集配置面板。
  • 同步扩展前后端 MaaEnd 配置模型、校验、默认值、类型定义和本地化内容。

Build:

  • 将 pytest 添加到开发依赖组。

Documentation:

  • 更新测试开发说明,明确开发依赖安装方式和专项测试规则。

Tests:

  • 补充 MaaEnd 配置来源兼容性和每日任务配置 JSON 契约的模型校验测试。

Chores:

  • 同步更新前后端 MaaEnd 任务与路线选项定义。
Original summary in English

Summary by Sourcery

扩展 MaaEnd 的配置来源与阶段化自动化能力,同时提升任务执行可靠性和用户配置体验。

New Features:

  • 为 MaaEnd 增加脚本共享、用户独立和脚本直控三种配置来源。
  • 将送货和自动采集拆分为独立运行阶段,支持送货条件、三日采集周期及区域和通用路线配置。
  • 支持阶段切换时仅重启 MaaEnd 或同时重启游戏,并提供每日仅执行一次的任务安排。

Bug Fixes:

  • 改进用户配置自动保存,合并并发期间的字段更新,避免输入抖动和修改丢失。
  • 增强直控配置会话异常后的配置恢复,并修正阶段化运行结果的历史记录与成功统计展示。
  • 开发模式下手动停止任务时保留游戏进程。

Enhancements:

  • 重构 MaaEnd 自动代理的阶段调度、任务筛选、路线选择及旧版配置兼容逻辑。
  • 重构 MaaEnd 用户配置页为带锚点导航的分区卡片布局,并新增送货与自动采集配置面板。
  • 同步扩展前后端 MaaEnd 配置模型、校验、默认值、类型定义和本地化内容。

Build:

  • 将 pytest 添加到开发依赖组。

Documentation:

  • 更新测试开发说明,明确开发依赖安装方式和专项测试规则。

Tests:

  • 补充 MaaEnd 配置来源兼容性和每日任务配置 JSON 契约的模型校验测试。

Chores:

  • 同步更新前后端 MaaEnd 任务与路线选项定义。

@sourcery-ai

sourcery-ai Bot commented Sep 6, 2026

Copy link
Copy Markdown

审查者指南

该 PR 将 MaaEnd 配置扩展为脚本共享、用户独立和脚本直控三种来源,并在后端实现送货、日常、自动采集三阶段调度及三日路线筛选;前端则以分区卡片和锚点导航重构用户配置页,新增送货/采集配置及串行字段保存机制。

MaaEnd 三阶段代理执行时序图

sequenceDiagram
    participant AutoProxyTask
    participant Config as UserConfig
    participant MaaEnd as MaaEndProcess
    participant LogMonitor

    AutoProxyTask->>Config: _mode_has_enabled_tasks(Delivery)
    AutoProxyTask->>Config: _mode_has_enabled_tasks(Routine)
    AutoProxyTask->>Config: _mode_has_enabled_tasks(AutoCollect)
    loop Each enabled stage
        AutoProxyTask->>AutoProxyTask: get_task_book_name(task)
        AutoProxyTask->>MaaEnd: launch stage task configuration
        MaaEnd-->>LogMonitor: completion or update status
        LogMonitor-->>AutoProxyTask: check_log()
    end
    AutoProxyTask->>AutoProxyTask: execute_script_task()
Loading

MaaEnd 自动采集路线调度流程图

flowchart LR
    A[AutoCollectMode] --> B{Three-day schedule}
    B -->|Distributed| C[Select routes where index % 3 matches cycle]
    B -->|Concentrated| D[Select all enabled routes on cycle day]
    C --> E[Regional routes]
    C --> F[Common routes]
    D --> E
    D --> F
    E --> G[Write AutoCollectRoutes]
    F --> H[Write AutoCollectCommonRoutes]
Loading

文件级变更

变更 详细信息 文件
扩展 MaaEnd 配置模型,新增直控配置来源及送货、自动采集阶段的完整参数校验与类型定义。
  • 新增“脚本/用户/直控”模式并兼容旧配置名称
  • 增加送货价格、委托接收点、自动采集周期及路线选项
  • 将抢委托和自动采集从常规任务配置中拆出
app/models/config.py
app/models/schema.py
app/utils/constants.py
frontend/src/types/script.ts
frontend/src/utils/maaEndProtocolSpace.ts
重构 MaaEnd 自动代理的配置选择、阶段调度和任务覆盖逻辑。
  • 按配置来源选择共享、用户独立或 Temp 直控配置文件
  • 按送货、日常、自动采集顺序执行阶段并分别处理空阶段、重试和完成状态
  • 根据东四区三日周期筛选自动采集路线,并写入送货及采集任务参数
  • 增加配置更新退出后的日志锁释放与异常清理
app/task/MaaEnd/AutoProxy.py
app/task/MaaEnd/ScriptConfig.py
app/task/MaaEnd/manager.py
新增 MaaEnd 直控配置会话的保存、隔离和恢复机制。
  • 直控模式直接使用 MaaEnd 原生 GUI 配置
  • 非直控任务运行前后通过临时目录保护并恢复脚本配置
  • 配置任务成功时保留直控写回,异常时清理临时文件、解锁脚本并恢复持久化状态
app/task/MaaEnd/ScriptConfig.py
app/task/MaaEnd/manager.py
重构 MaaEnd 用户配置页面并增加送货、自动采集交互配置。
  • 将页面改为分区卡片与锚点导航布局
  • 新增送货开关、最低价格、接收点和自动采集模式、区域路线、通用路线控件
  • 通过待保存字段队列合并并串行化自动保存,减少输入闪动和更新丢失
frontend/src/views/EditView/User/MaaEndUserEdit.vue
frontend/src/views/MaaEndUserEdit/BasicInfoSection.vue
frontend/src/views/MaaEndUserEdit/TaskConfigSection.vue
frontend/src/views/MaaEndUserEdit/DeliveryConfigSection.vue
frontend/src/views/MaaEndUserEdit/AutoCollectConfigSection.vue
同步前端 API 映射、组件复用能力和本地化文案。
  • 为新增字段提供默认值、白名单归一化和类型安全选项
  • 允许 MaaEnd 非脚本模式显示用户配置入口
  • 支持外层卡片隐藏子组件标题并补充中英文路线与配置文案
frontend/src/composables/useScriptApi.ts
frontend/src/components/ScriptTable.vue
frontend/src/components/ExtraScriptSection.vue
frontend/src/components/UserNotifyConfig.vue
frontend/src/i18n/locales/en-US.ts
frontend/src/i18n/locales/zh-CN.ts

提示与命令

与 Sourcery 交互

  • 触发新的审查: 在拉取请求中评论 @sourcery-ai review
  • 继续讨论: 直接回复 Sourcery 的审查评论。
  • 根据审查评论生成 GitHub issue: 回复审查评论,请 Sourcery 根据该评论创建 issue。你也可以使用 @sourcery-ai issue 回复审查评论,以从中创建 issue。
  • 生成拉取请求标题: 在拉取请求标题的任意位置写入 @sourcery-ai,即可随时生成标题。你也可以在拉取请求中评论 @sourcery-ai title,以随时重新生成标题。
  • 生成拉取请求摘要: 在拉取请求正文的任意位置写入 @sourcery-ai summary,即可在指定位置随时生成 PR 摘要。你也可以在拉取请求中评论 @sourcery-ai summary,以随时重新生成摘要。
  • 生成审查者指南: 在拉取请求中评论 @sourcery-ai guide,即可随时重新生成审查者指南。
  • 解决所有 Sourcery 评论: 在拉取请求中评论 @sourcery-ai resolve,即可解决所有 Sourcery 评论。如果你已经处理完所有评论且不想再看到它们,这一功能会很有用。
  • 忽略所有 Sourcery 审查: 在拉取请求中评论 @sourcery-ai dismiss,即可忽略所有现有的 Sourcery 审查。如果你想以新的审查重新开始,这一功能尤其有用——别忘了评论 @sourcery-ai review 来触发新的审查!

自定义使用体验

访问你的控制面板以:

  • 启用或禁用审查功能,例如 Sourcery 生成的拉取请求摘要、审查者指南等。
  • 更改审查语言。
  • 添加、移除或编辑自定义审查说明。
  • 调整其他审查设置。

获取帮助

Original review guide in English

Reviewer's Guide

该 PR 将 MaaEnd 配置扩展为脚本共享、用户独立和脚本直控三种来源,并在后端实现送货、日常、自动采集三阶段调度及三日路线筛选;前端则以分区卡片和锚点导航重构用户配置页,新增送货/采集配置及串行字段保存机制。

Sequence diagram for MaaEnd three-stage proxy execution

sequenceDiagram
    participant AutoProxyTask
    participant Config as UserConfig
    participant MaaEnd as MaaEndProcess
    participant LogMonitor

    AutoProxyTask->>Config: _mode_has_enabled_tasks(Delivery)
    AutoProxyTask->>Config: _mode_has_enabled_tasks(Routine)
    AutoProxyTask->>Config: _mode_has_enabled_tasks(AutoCollect)
    loop Each enabled stage
        AutoProxyTask->>AutoProxyTask: get_task_book_name(task)
        AutoProxyTask->>MaaEnd: launch stage task configuration
        MaaEnd-->>LogMonitor: completion or update status
        LogMonitor-->>AutoProxyTask: check_log()
    end
    AutoProxyTask->>AutoProxyTask: execute_script_task()
Loading

Flow diagram for MaaEnd auto-collect route scheduling

flowchart LR
    A[AutoCollectMode] --> B{Three-day schedule}
    B -->|Distributed| C[Select routes where index % 3 matches cycle]
    B -->|Concentrated| D[Select all enabled routes on cycle day]
    C --> E[Regional routes]
    C --> F[Common routes]
    D --> E
    D --> F
    E --> G[Write AutoCollectRoutes]
    F --> H[Write AutoCollectCommonRoutes]
Loading

File-Level Changes

Change Details Files
扩展 MaaEnd 配置模型,新增直控配置来源及送货、自动采集阶段的完整参数校验与类型定义。
  • 新增“脚本/用户/直控”模式并兼容旧配置名称
  • 增加送货价格、委托接收点、自动采集周期及路线选项
  • 将抢委托和自动采集从常规任务配置中拆出
app/models/config.py
app/models/schema.py
app/utils/constants.py
frontend/src/types/script.ts
frontend/src/utils/maaEndProtocolSpace.ts
重构 MaaEnd 自动代理的配置选择、阶段调度和任务覆盖逻辑。
  • 按配置来源选择共享、用户独立或 Temp 直控配置文件
  • 按送货、日常、自动采集顺序执行阶段并分别处理空阶段、重试和完成状态
  • 根据东四区三日周期筛选自动采集路线,并写入送货及采集任务参数
  • 增加配置更新退出后的日志锁释放与异常清理
app/task/MaaEnd/AutoProxy.py
app/task/MaaEnd/ScriptConfig.py
app/task/MaaEnd/manager.py
新增 MaaEnd 直控配置会话的保存、隔离和恢复机制。
  • 直控模式直接使用 MaaEnd 原生 GUI 配置
  • 非直控任务运行前后通过临时目录保护并恢复脚本配置
  • 配置任务成功时保留直控写回,异常时清理临时文件、解锁脚本并恢复持久化状态
app/task/MaaEnd/ScriptConfig.py
app/task/MaaEnd/manager.py
重构 MaaEnd 用户配置页面并增加送货、自动采集交互配置。
  • 将页面改为分区卡片与锚点导航布局
  • 新增送货开关、最低价格、接收点和自动采集模式、区域路线、通用路线控件
  • 通过待保存字段队列合并并串行化自动保存,减少输入闪动和更新丢失
frontend/src/views/EditView/User/MaaEndUserEdit.vue
frontend/src/views/MaaEndUserEdit/BasicInfoSection.vue
frontend/src/views/MaaEndUserEdit/TaskConfigSection.vue
frontend/src/views/MaaEndUserEdit/DeliveryConfigSection.vue
frontend/src/views/MaaEndUserEdit/AutoCollectConfigSection.vue
同步前端 API 映射、组件复用能力和本地化文案。
  • 为新增字段提供默认值、白名单归一化和类型安全选项
  • 允许 MaaEnd 非脚本模式显示用户配置入口
  • 支持外层卡片隐藏子组件标题并补充中英文路线与配置文案
frontend/src/composables/useScriptApi.ts
frontend/src/components/ScriptTable.vue
frontend/src/components/ExtraScriptSection.vue
frontend/src/components/UserNotifyConfig.vue
frontend/src/i18n/locales/en-US.ts
frontend/src/i18n/locales/zh-CN.ts

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

您好——我发现了 1 个问题

面向 AI Agent 的提示
请处理本次代码审查中的评论:

## 单独评论

### 评论 1
<location path="frontend/src/composables/useScriptApi.ts" line_range="625-639" />
<code_context>
-                        IfSeizeEntrustTask:
-                          maaEndUserData.Task?.IfSeizeEntrustTask != null
-                            ? maaEndUserData.Task.IfSeizeEntrustTask
+                        IfSeizeDeliveryJobs:
+                          maaEndUserData.Task?.IfSeizeDeliveryJobs != null
+                            ? maaEndUserData.Task.IfSeizeDeliveryJobs
</code_context>
<issue_to_address>
**问题 (bug_risk):** 前端访问了新添加的 `MaaEndUserConfig_Task` 字段,但已提交的生成文件 `frontend/src/api/models/MaaEndUserConfig_Task.ts` 仍然只声明旧的 `IfSeizeEntrustTask` 字段,并且没有配送或自动收取相关字段。因此,TypeScript 编译会因 `IfSeizeDeliveryJobs``SeizeDeliveryJobsReward``SeizeDeliveryJobsCommissionSource``AutoCollectMode``AutoCollectRoutes``AutoCollectCommonRoutes` 存在未知属性而失败。

**建议修复:** 重新生成并提交 OpenAPI TypeScript 模型,或者根据新架构一致地更新生成的任务和信息模型。
</issue_to_address>

Sourcery 评估

需要人工审查。 有 1 个发现需要优先处理,而且此次更改会修改持久化的 MaaEnd 配置选择并写入任务设置,同时添加多阶段执行流程。因此,错误的模式或任务筛选条件可能会运行错误的自动化操作,并遗留配置更改。回滚可以阻止后续运行,但无法撤销已经执行的操作;保存的配置本身范围有限,可以恢复或重新计算。

阻塞性发现:frontend/src/composables/useScriptApi.ts:639


Sourcery 对开源项目免费——如果您喜欢我们的审查,请考虑分享 ✨
Original comment in English

Hey - I've found 1 issue

Prompt for AI Agents
Please address the comments from this code review:

## Individual Comments

### Comment 1
<location path="frontend/src/composables/useScriptApi.ts" line_range="625-639" />
<code_context>
-                        IfSeizeEntrustTask:
-                          maaEndUserData.Task?.IfSeizeEntrustTask != null
-                            ? maaEndUserData.Task.IfSeizeEntrustTask
+                        IfSeizeDeliveryJobs:
+                          maaEndUserData.Task?.IfSeizeDeliveryJobs != null
+                            ? maaEndUserData.Task.IfSeizeDeliveryJobs
</code_context>
<issue_to_address>
**issue (bug_risk):** The frontend accesses the newly added `MaaEndUserConfig_Task` fields, but the checked-in generated `frontend/src/api/models/MaaEndUserConfig_Task.ts` still declares only the old `IfSeizeEntrustTask` field and has no delivery or auto-collect fields. TypeScript compilation therefore fails with unknown-property errors for `IfSeizeDeliveryJobs`, `SeizeDeliveryJobsReward`, `SeizeDeliveryJobsCommissionSource`, `AutoCollectMode`, `AutoCollectRoutes`, and `AutoCollectCommonRoutes`.

**Suggested fix:** Regenerate and commit the OpenAPI TypeScript models, or update the generated task and info models consistently with the new schema.
</issue_to_address>

Sourcery assessment

Needs a human reviewer. 1 finding to address first, and this changes persistent MaaEnd configuration selection and writes task settings while adding a multi-stage execution flow, so an incorrect mode or task filter could run the wrong automation and leave configuration changes behind. Reverting would stop future runs, but it would not undo actions already performed; the saved configuration itself is bounded and can be restored or recomputed.

Blocking findings: frontend/src/composables/useScriptApi.ts:639


Sourcery is free for open source - if you like our reviews please consider sharing them ✨

Comment on lines +625 to 639
IfSeizeDeliveryJobs:
maaEndUserData.Task?.IfSeizeDeliveryJobs != null
? maaEndUserData.Task.IfSeizeDeliveryJobs
: true,
SeizeDeliveryJobsReward:
maaEndUserData.Task?.SeizeDeliveryJobsReward != null
? maaEndUserData.Task.SeizeDeliveryJobsReward
: 15.9,
SeizeDeliveryJobsCommissionSource:
maaEndUserData.Task?.SeizeDeliveryJobsCommissionSource != null
? maaEndUserData.Task.SeizeDeliveryJobsCommissionSource
: 'Unlimited',
IfAutoEcoFarm:
maaEndUserData.Task?.IfAutoEcoFarm != null
? maaEndUserData.Task.IfAutoEcoFarm

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

问题 (bug_risk): 前端访问了新添加的 MaaEndUserConfig_Task 字段,但已提交的生成文件 frontend/src/api/models/MaaEndUserConfig_Task.ts 仍然只声明旧的 IfSeizeEntrustTask 字段,并且没有配送或自动收取相关字段。因此,TypeScript 编译会因 IfSeizeDeliveryJobsSeizeDeliveryJobsRewardSeizeDeliveryJobsCommissionSourceAutoCollectModeAutoCollectRoutesAutoCollectCommonRoutes 存在未知属性而失败。

建议修复: 重新生成并提交 OpenAPI TypeScript 模型,或者根据新架构一致地更新生成的任务和信息模型。

Original comment in English

issue (bug_risk): The frontend accesses the newly added MaaEndUserConfig_Task fields, but the checked-in generated frontend/src/api/models/MaaEndUserConfig_Task.ts still declares only the old IfSeizeEntrustTask field and has no delivery or auto-collect fields. TypeScript compilation therefore fails with unknown-property errors for IfSeizeDeliveryJobs, SeizeDeliveryJobsReward, SeizeDeliveryJobsCommissionSource, AutoCollectMode, AutoCollectRoutes, and AutoCollectCommonRoutes.

Suggested fix: Regenerate and commit the OpenAPI TypeScript models, or update the generated task and info models consistently with the new schema.

@HarcoChen

Copy link
Copy Markdown
Contributor Author

@sourcery-ai review

@sourcery-ai

sourcery-ai Bot commented Sep 7, 2026

Copy link
Copy Markdown

Sorry @HarcoChen, you've used your own review budget of 250,000 diff characters for the last 7 days.

You can request another review in 6 days and 12 hours by commenting @sourcery-ai review. Upgrade to get a review now.

@HarcoChen
HarcoChen merged commit 139e807 into AUTO-MAS-Project:dev Sep 7, 2026
3 checks 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.

1 participant