Skip to content

fix(BetterGI): 合并 9 个 BetterGI 相关 PR(#756/#759/#765/#766/#767/#768/#771/#779/#780) - #787

Open
TCddddd wants to merge 29 commits into
AUTO-MAS-Project:devfrom
TCddddd:combine-bettergi-prs
Open

TCddddd wants to merge 29 commits into
AUTO-MAS-Project:devfrom
TCddddd:combine-bettergi-prs

Conversation

@TCddddd

@TCddddd TCddddd commented Sep 15, 2026

Copy link
Copy Markdown
Contributor

概述

将以下 9 个 BetterGI 相关 PR 合并为一个分支统一提交:
#756 #759 #765 #766 #767 #768 #771 #779 #780

注:#768 的提交历史已内含 #765#766,故以 #768 一次性带入三者,避免重复应用。

主要改动(用户可见)

  • 通知统一走 AUTO-MAS 通知编排
  • 掉落统计开启时强制打开首领讨伐奖励识别
  • 执行层运行也留下运行记录;一条龙执行层改为单次启动,按左栏队列顺序执行
  • 修复未选择首领时自动首领讨伐被静默跳过、整轮仍显示完成
  • 地脉花策略设置现在生效
  • 首领改为必填校验;直控配置来源与原生配置写入分离
  • Plan 到原生键反向映射补充单测
  • 修复一条龙战斗组开关关闭后仍运行
  • 修复自定义分组脚本配置下拉框无法展开选项

Sourcery 摘要

统一 BetterGI 的执行、配置、通知和报告行为,同时修复任务启用和验证相关问题。

新功能:

  • 添加 BetterGI 掉落统计配置,并在通知和 HTML 报告中包含聚合后的奖励识别结果。
  • 在单次有序启动中运行 BetterGI 执行层任务,同时记录执行层结果并支持自定义任务分段。

错误修复:

  • 防止已禁用的 BetterGI 战斗组回退到原生一条龙执行。
  • 将缺少必需 Boss 配置的情况报告为失败且可见的执行,而不是静默跳过。
  • 使地脉花战斗策略和已清空队伍设置生效。
  • 将直接控制配置的所有权与临时原生配置写入分离,并安全恢复被修改的配置。
  • 修复自定义分组设置下拉框,使其选项能够正常展开。

改进:

  • 通过共享的 AUTO-MAS 通知编排机制发送 BetterGI 通知。
  • 添加从计划战斗设置到 BetterGI 原生配置键的反向映射,并集中处理自定义分组解析。

测试:

  • 添加针对战斗组所有权、掉落统计解析、原生计划设置映射以及基于队列的分组启用功能的回归测试。

杂项:

  • 将 BetterGI 相关更改整合到单个发布条目中。
Original summary in English

Summary by Sourcery

Unify BetterGI execution, configuration, notification, and reporting behavior while fixing task enablement and validation issues.

New Features:

  • Add BetterGI drop-statistics configuration and include aggregated reward-recognition results in notifications and HTML reports.
  • Run BetterGI execution-layer tasks in a single ordered launch while recording execution-layer results and supporting custom task segments.

Bug Fixes:

  • Prevent disabled BetterGI combat groups from falling back to native one-dragon execution.
  • Report missing required boss configuration as a failed, visible execution instead of silently skipping it.
  • Make Ley Line Outcrop combat strategies and cleared team settings take effect.
  • Separate direct-control configuration ownership from temporary native-config writes and safely restore modified configurations.
  • Fix custom group settings dropdowns so their options can be opened.

Enhancements:

  • Route BetterGI notifications through the shared AUTO-MAS notification orchestration.
  • Add reverse mapping from Plan combat settings to BetterGI native configuration keys and centralize custom-group resolution.

Tests:

  • Add regression coverage for combat-group ownership, drop-statistics parsing, native Plan-setting mappings, and queue-based group enablement.

Chores:

  • Consolidate the BetterGI-related changes into a single release entry.

TCddddd and others added 29 commits September 14, 2026 19:50
- 统计信息分支不再自己判渠道、直调传输层,改为 dispatch + statistic_targets:
  补上系统通知、Koishi、微信(iLink)、QQ 官方机器人四类渠道,并按全局 + 用户
  目标发送;同时修复会向已禁用的自定义 Webhook 推送(中央 _webhooks 过滤
  Info.Enabled,原先遍历 MultipleConfig.values() 未过滤)
- 代理结果分支改用 notify_core.push_proxy_result,删掉内联重复实现
- 渠道正文分流保持原样:邮件 HTML 完整版;ServerChan 完整版、超 30KB 回退简略版;
  聊天机器人 Webhook 简略版。_signed() 只承载这两处渠道级覆盖
- 前端通知区改用共享组件 UserNotifyConfig,与其余 11 个专项一致
- notify_core 收敛名单补上 BetterGI
- 数据源为 BGI「奖励识别」的逐轮日志(自动秘境/自动首领讨伐:本轮奖励识别结果 …),
  新增 drop_statistics 解析模块,按物品跨轮、跨来源累加,日志文案属上游对外契约
- 用户级开关 Notify.IfSendDropStatistics 默认开启;开启后运行前强制打开识别:
  写全局 autoDomainConfig.rewardRecognitionEnabled(秘境 Param 的 SetDefault() 从该段
  拷贝,一条龙与执行层两条路径全覆盖)+ 槽位 AutoBossRewardRecognitionEnabled(首领
  原生路径)+ Plan.settings(首领执行层);该叶子已在运行时快照集合内,结束自动还原
- 统计通知正文与 general_statistics.html 新增「掉落物品 / 数量」两列表格(条件渲染,
  不影响共用该模板的其它专项);聊天机器人 Webhook 仍用简略版,不塞表
- 前端复用共享组件 UserNotifyConfig 的开关(与 MAA 六星同款 showSixStar 模式),补三语词条
- 补单测 tests/task/test_bettergi_drop_statistics.py(5 例)
BGI 把「本轮奖励识别结果」的明细段整体包在一对 ASCII 双引号里(实测 2026-09-14
日志,首领那行的来源名也带引号),解析时未剥引号,导致:

- 每行第一条物品名带上前导引号,通知里会显示成 `"好感经验`;
- 同一物品处于首位与非首位时被拆成两个键(`"好感经验` 与 `好感经验`),
  数量合不到一起、统计偏小。

改为对解析出的物品名统一剥掉两端引号类字符;不把「」计入剥离集合,避免破坏
`「久雨莲」的种子` 这类以「开头的名字。测试采样行同步改为实测的带引号格式,
并补充「首条剥引号」「跨来源同名合并」「方括号不被误剥」三条用例。
按 tests/AGENTS.md「功能边界或 bug 边界的测试不提交」,撤下上一提交新增的三条
回归用例(首条剥引号、跨来源同名合并、方括号不被误剥),本地验证结果记入 PR 正文。

采样行仍保留实测的带引号格式:原样例是无引号的臆测格式,不改则测试验证的是
现实中并不存在的输入。
- main.js 新增战斗步骤必填项前置校验:缺 bossName 时不进 BGI,改打
  MAS_STEP_MISSING_CONFIG 标记并跳过该步,避免落回 AutoBossParam 无参构造
  读取 BGI 全局 autoBossConfig 的旧首领
- AutoProxy 识别该标记判负,并把「自动首领讨伐:未选择首领」推到调度台与日志
- main.js 四项战斗步骤的队伍改为无条件赋值:空即明确传空串,由 BGI 侧
  「空 = 不切换队伍」的原生守卫生效;此前用 if (x) 守卫跳过赋值,会留下
  Param 构造时 SetDefault() 从全局 config.json 读来的旧队伍
- 地脉花好感队随战斗队伍一起清空,避免空战斗队伍下仍切好感队
- 通用战斗策略留空时解析为「根据队伍自动选择」并写入全局叶子(新增
  autoBossConfig.strategyName,补齐首领执行层无通用策略来源的缺口),
  不再跳过写入而让 BGI 沿用配置里的旧策略
- main.js 地脉花在 Param 无 setCombatStrategyPath 的版本改直接写
  FightConfig.StrategyName,使右栏单独为地脉花选择的策略真正生效
  (此前只打 MAS_LEYLINE_STRATEGY_UNSUPPORTED 日志,设置被静默忽略)
- _apply_leaves 不再跳过空值;apply_global_battle_team 在通用队伍为空时
  把 autoLeyLineOutcropConfig.Team / autoStygianOnslaughtConfig.fightTeamName
  清成空串,避免原生路径(地脉花/幽境危战直读全局段)沿用 BGI 旧队伍;
  写入仍受快照保护,运行结束由 restore_global_battle_config 还原
- CHANGELOG 条目合并为一条,覆盖本分支两组修复
原先战斗 4 项(MAS一条龙)与自定义配置组(MAS-{短id}-自定义配置组N)分两次
启动 BetterGI,各自杀进程、启动、监控、收尾;队列顺序也无法跨越这两批。

现改为「切段 + 一次 --startGroups」:
- one_dragon_bridge.build_execution_segments 按左栏队列顺序把执行层切成若干「段」,
  write_execution_groups 每段写一个配置组文件,再由一次
  `--startGroups <段1 段2 ...>` 顺序跑完(BGI 的 OnStartMultiScriptGroupWithNamesAsync
  按传入顺序 foreach 执行)。
- 战斗 4 项整体一段(内部仍由 main.js 按 Plan 编排,保留树脂耗尽短路等批次语义),
  插在队列中第一个被接管的战斗项处;js/pathing/keymouse 类与相邻项合并成段
  (其组级 config 由 MAS 合成、无用户语义);
  scriptgroup 类独立成段 —— BGI 的 Pathing/Shell 项目只读**组级** config
  (ScriptGroupProject.Run 用 GroupInfo.Config.PathingConfig),合并会丢掉
  用户配置组的队伍/自动拾取等设置,故必须保真。
- one_dragon 新增 resolve_custom_group,把「自定义项 → 可执行配置组」的解析
  统一到一处,materialize_user_script_groups 与切段共用,消除重复分支。
- 执行层接管时不再逐项物化,改为把这些项的名字并进 exclude_task_names 从原生
  副本剔除;段组文件与历史残留由 _restore_one_dragon_config /
  cleanup_leftover_execution_groups 清理。
- 删除已被取代的 write_one_dragon_group / remove_one_dragon_group 与
  _run_plan_custom,_run_plan_combat 泛化为 _run_execution_layer(等待所有段的
  执行结束标记)。
- 原生副本剔除战斗组的门控从 plan_mode(是否存在启用项)改为 use_execution_layer +
  Plan 归属:全部战斗行都关掉时 plan_mode 为假,原来战斗项会整体落回原生副本照跑,
  与界面「已关」不符(2026-09-12 实机排障)
- 新增 one_dragon_plan.plan_combat_bases():只看归属(Plan 中配过实例)不看启停,
  与 build_combat_steps() 的分工是「谁负责」与「这次跑谁」
- Plan 中没有实例的战斗组仍留在原生副本,宁可多跑一次也不静默丢任务
- 同步 step-enabled 接口与前端服务层文档:enabled=false 的语义是「本次不跑」,
  不是「退回原生一条龙跑」
- 补单测 tests/task/test_bettergi_combat_scope.py(4 例)
_run_execution_layer 跑完 BetterGI 后不写 log_record:战斗/自定义项全部由执行层完成、
原生一条龙又无启用任务时,整轮结果显示「未开始运行」(UserItem.result 对空记录的兜底),
并且不写历史日志、不发「统计信息」通知、分步报告与掉落统计无数据可解析。

改为执行层启动时新建 log_record 并把执行层日志写进去,收尾按成败写入状态(成功用项目
契约 "Success!",失败写具体原因:命中致命日志 / 进程在结束标记前退出 / 空闲超时 /
执行异常 / 必填配置缺失);同时把 log_start_time / cur_user_log 指向它,使执行层阶段的
on_crash 异常写入与「运行异常」通知也能生效。没有需要接管的段时不建记录。
本 PR 重建到当前 dev 后按新规范登记:碎片固定用 changelog.d/,不再改
CHANGELOG.md 与 res/version.json(重做时已从提交里剔除这两处生成物改动)。
本分支为自洽而包含了 AUTO-MAS-Project#766 的提交(执行层判负逻辑依赖它引入的 _missing_config_reasons),
但「一条 PR 恰好一个碎片」,重复登记会被 CI 判失败。故此处移除该碎片:它在 AUTO-MAS-Project#766 里保留。
待 AUTO-MAS-Project#766 合入后,本分支 rebase 到新的 dev 即可让这段重复代码一并消失。
…tatistics

# Conflicts:
#	app/task/BetterGI/AutoProxy.py
#	app/task/BetterGI/tools/one_dragon.py
本分支为自洽而包含 AUTO-MAS-Project#756 的提交(掉落统计经由统一通知编排推送),但「一条 PR 恰好一个
碎片」,重复登记会被 CI 判失败,故移除该碎片;它在 AUTO-MAS-Project#756 里保留。

待 AUTO-MAS-Project#756 合入后需在本分支恢复该碎片:届时 dev 已有它,本分支缺失会被显示成「删除他人
碎片」,恢复后本分支与 dev 完全一致、diff 归零。
直控(脚本直控)的语义是「用 BGI 所选原生配置启动、MAS 不接管」,此前被快速配置
耦合破坏:use_mas_config / masConfigEnabled 都写成「来源 ≠ 直控 或 快速配置」,而快速
配置默认开,于是直控被算成仍由 MAS 接管——前端不切到原生控件、「一条龙名称」被锁成
MAS 槽位名,后端也改用 MAS 槽位启动。

改回按来源判定(快速配置不参与「用哪份配置启动」这件事):

- AutoProxy / ScriptConfig:use_mas_config = 来源 ≠ 直控
  → 直控下一律用 Task.OneDragonConfigName 指向的 BGI 原生配置启动
- BetterGIUserEdit:masConfigEnabled = 来源 ≠ 直控
  → 直控下显示「一条龙名称(可选原生配置)+ 配置 BetterGI」、隐藏 MAS 面板,
  并禁用快速配置开关(其语义见下一步)、直控说明常显

验证:py_compile 通过;pytest tests/task/test_direct_control_gates.py
tests/task/test_quick_config_runtime_gates.py
tests/task/test_bettergi_one_dragon_read_failure.py 共 38 passed。

后续(同一 PR):直控 + 快速配置开启时,把面板值写入该原生配置、结束恢复现场。
第二步:直控来源下的快速配置不再是没有效果的开关——开启时把面板值(组开关、队列
顺序、领取奖励队伍、战斗队伍/策略)写入 Task.OneDragonConfigName 指向的那份 BGI
原生配置,并把通用的队伍/策略全局叶子一并补写;运行前对整份原生配置做快照,
运行/异常结束还原,且还原前比对内容——运行期间被外部改过的配置保留外部改动。

- one_dragon 新增 read_native_one_dragon / write_native_one_dragon:种子是该原生配置
  自身(保留用户的一条龙结构与自定义组定义),写回同一个文件,不建 MAS 槽位、
  不物化 MAS- 前缀配置组
- AutoProxy 新增 writes_native_config 判定与 _write_native_one_dragon;
  _backup/_restore_one_dragon_config 在直控分支下接管原生配置的快照与还原
- 前端:直控下快速配置开关恢复可用(语义即「把面板值写入该原生配置」)

验证:py_compile 通过;pytest tests/task/test_direct_control_gates.py
tests/task/test_quick_config_runtime_gates.py
tests/task/test_bettergi_one_dragon_read_failure.py 共 38 passed;
scripts/changelog.py check 通过。未做实机验证。
用户编辑页此前有两个指向同一个 Info.IfQuickConfig 的入口:模式选择器里的
「是否启用快速配置」与一个裸开关旁的「快速配置」,分不清哪个才是真实开关。

现统一走 GeneralConfigModeSelector 的表单项(带说明 tooltip,与 Okww 等专项一致),
删除裸开关与「快速配置」文案;新增 handleQuickConfigChange 负责保存该字段。
第三步:四项战斗组的 per-任务设置(树脂模式与次数、奖励识别、秘境名、首领名、队伍/
策略等可对齐字段)此前只存在于 Plan、仅由执行层消费,直控下不生效。

- one_dragon_plan 新增 plan_steps_to_native_settings():按 RIGHTBAR_TO_PLAN 反向映射
  Plan settings → 原生键,只收白名单键、且只收非空值(留空保持原生配置现有值)
- write_native_one_dragon 增加 native_step_settings:首领讨伐/地脉花合并进一条龙文件,
  秘境/幽境分别经 write_global_domain_settings / write_global_stygian_settings 落全局段
  (两者自带白名单过滤;叶子快照已由 snapshot_global_battle_config 覆盖)
- AutoProxy._write_native_one_dragon 传入 plan_combat_steps 的映射结果

结构化/全局共享字段(秘境每周表、地脉花每工作日 country/type、maxArtifactStar)
按 one_dragon_plan 的约定留在原生存储,不参与对齐。

验证:py_compile 通过;映射函数抽样正确;pytest 直控门控 / 快速配置运行时门控 /
读配置失败 共 38 passed。未做实机验证。
锁住 plan_steps_to_native_settings 的对外行为(8 例,实测通过):
- 四项战斗组各自的原生键名(AutoBossName / AutoBossRunCount / AutoBossSpecifyRunCount /
  AutoBossReviveRetryCount / AutoBossRewardRecognitionEnabled / specifyResinUse /
  condensedResinUseCount / DomainName / SundayEverySelectedValue / LeyLineRunCount /
  country / bossNum / fightTeamName)
- 空值过滤:留空字段不得进入原生配置(否则会灌空值)
- 白名单过滤:未登记的键(如 weeklyDomain)不产出
- 同名多实例(自动秘境-副本A)按基名归集,原生单值语义下后写者胜
- 未知组、非 dict settings、非 dict 步骤、None 输入一律忽略
apply_groups 在队列模式下对战斗 4 项(秘境/地脉花/幽境危战/首领讨伐)仅按
Groups 纳入判定启停,忽略队列条目的 enabled。前端关闭战斗组开关只把队列条目
enabled 置 false、基名仍保留在 Groups,导致「界面关了、原生一条龙仍跑」。

改为战斗 4 项启停由「Groups 纳入」与「队列条目 enabled」共同决定,并补回归
测试。

Co-Authored-By: Claude <noreply@anthropic.com>
- controlTypeOf 按 BetterGI 官方 type 枚举补全别名归一与结构兜底,避免开关/下拉/多选项被误识别为文本框
- a-select 增加 getPopupContainer,避免被父容器 overflow 裁剪导致选项列表不可见
# Conflicts:
#	app/task/BetterGI/tools/notify.py
# Conflicts:
#	app/task/BetterGI/AutoProxy.py
#	app/task/BetterGI/tools/one_dragon.py
#	res/templates/BetterGI/MASOneDragon/main.js
# Conflicts:
#	app/task/BetterGI/AutoProxy.py

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

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

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

@TCddddd TCddddd changed the title Combine bettergi prs fix(BetterGI): 合并 9 个 BetterGI 相关 PR(#756/#759/#765/#766/#767/#768/#771/#779/#780) Sep 15, 2026
@sourcery-ai

sourcery-ai Bot commented Sep 15, 2026

Copy link
Copy Markdown

审查者指南

整合了九个围绕队列顺序、单次启动执行层的 BetterGI PR;分离原生配置与 MAS 配置的所有权,并通过安全的临时写入机制进行管理;新增必填字段验证、掉落统计报告、统一通知、UI 修复和回归测试。

BetterGI 队列顺序执行时序图

sequenceDiagram
    participant AutoProxyTask
    participant one_dragon_bridge
    participant BetterGI
    participant LogMonitor
    participant LogRecord
    participant NativeOneDragon

    AutoProxyTask->>one_dragon_bridge: build_execution_segments()
    one_dragon_bridge-->>AutoProxyTask: exec_group_names
    AutoProxyTask->>one_dragon_bridge: write_execution_groups()
    AutoProxyTask->>BetterGI: open_process(--startGroups, ...group_names)
    BetterGI-->>LogMonitor: ordered execution logs
    LogMonitor->>LogRecord: update content and status
    LogMonitor-->>AutoProxyTask: group completion or failure markers
    AutoProxyTask->>NativeOneDragon: run remaining enabled tasks
    AutoProxyTask->>one_dragon_bridge: remove_execution_groups()
Loading

BetterGI 配置所有权与恢复时序图

sequenceDiagram
    participant AutoProxyTask
    participant NativeConfig
    participant one_dragon
    participant BetterGI

    AutoProxyTask->>AutoProxyTask: read_config_source()
    alt MAS configuration source
        AutoProxyTask->>one_dragon: write_user_one_dragon()
        one_dragon-->>BetterGI: temporary MAS slot and execution groups
    else Direct configuration with quick config
        AutoProxyTask->>NativeConfig: read_native_one_dragon()
        AutoProxyTask->>one_dragon: write_native_one_dragon()
        one_dragon-->>NativeConfig: temporary panel values
    end
    AutoProxyTask->>BetterGI: execute configured tasks
    AutoProxyTask->>NativeConfig: read_file()
    alt configuration unchanged
        AutoProxyTask->>NativeConfig: write_file(snapshot)
    else externally modified
        AutoProxyTask->>NativeConfig: retain external changes
    end
Loading

BetterGI 掉落统计通知时序图

sequenceDiagram
    participant BetterGI
    participant LogMonitor
    participant AutoProxyTask
    participant parse_drop_lines
    participant push_notification
    participant dispatch
    participant NotificationChannels

    BetterGI-->>LogMonitor: reward recognition log lines
    LogMonitor->>AutoProxyTask: execution LogRecord
    AutoProxyTask->>parse_drop_lines: parse_drop_lines(log lines)
    parse_drop_lines-->>AutoProxyTask: drop_statistics
    AutoProxyTask->>push_notification: push_notification(统计信息)
    push_notification->>dispatch: dispatch(NotifyPayload, statistic_targets)
    dispatch->>NotificationChannels: deliver unified notification
Loading

BetterGI 必填配置验证流程图

flowchart TD
    A[Plan step is scheduled today] --> B{Required fields present?}
    B -->|No| C[masLog MAS_STEP_MISSING_CONFIG]
    C --> D[Skip step]
    D --> E[Execution layer reports failure and reason]
    B -->|Yes| F[dispatchCombat]
    F --> G[BetterGI executes step]
    G --> H{Runtime failure?}
    H -->|Yes| I[Skip failed step and continue]
    H -->|No| J[Mark step complete]
Loading

文件级变更

变更 详细信息 文件
重构 BetterGI 执行层编排,构建临时执行分段,并按照左侧面板队列顺序在单个 BetterGI 进程中运行,同时保留每次运行的记录并执行可靠清理。
  • 将战斗 Plan 步骤和受支持的自定义项目合并为有序的临时分组。
  • 将执行层所有权与启用状态分离,确保已配置但被禁用的战斗分组会从原生执行中移除,而不会被意外运行。
  • 新增完成、超时、致命错误和缺少必填配置的处理,包括明确的 Auto Boss 验证失败处理。
  • 记录执行层日志/状态,用于历史记录、通知和崩溃处理。
app/task/BetterGI/AutoProxy.py
app/task/BetterGI/tools/one_dragon_bridge.py
app/task/BetterGI/tools/one_dragon_plan.py
res/templates/BetterGI/MASOneDragon/main.js
分离直接控制配置选择与临时 MAS 配置写入,并新增安全的原生配置往返处理。
  • 无论快速配置状态如何,直接控制模式都会使用所选的原生 BetterGI 配置。
  • 仅在 MAS 写入原生配置时创建快照并进行恢复,同时保留执行期间产生的外部修改。
  • 新增 Plan 到原生键的反向映射,并将每个步骤的设置应用到原生文件/全局区段。
  • 修正全局队伍、策略、奖励识别和地脉策略的传递,包括明确的空值语义。
app/task/BetterGI/AutoProxy.py
app/task/BetterGI/ScriptConfig.py
app/task/BetterGI/tools/one_dragon.py
app/task/BetterGI/tools/one_dragon_plan.py
新增 BetterGI 掉落统计收集,并通过共享的 AUTO-MAS 通知流水线发送 BetterGI 通知。
  • 新增对每轮奖励识别日志行的解析和聚合。
  • 新增可由用户配置的掉落统计输出,支持文本、HTML 和通知报告。
  • 启用掉落统计时强制进行奖励识别,并将执行层记录纳入报告数据。
  • 使用共享的 dispatch 和代理结果辅助函数替代 BetterGI 专用的发送逻辑。
app/models/config.py
app/models/schema.py
app/task/BetterGI/tools/drop_statistics.py
app/task/BetterGI/tools/notify.py
app/task/notify_core.py
res/html/general_statistics.html
frontend/src/components/UserNotifyConfig.vue
frontend/src/views/EditView/User/BetterGIUserEdit.vue
frontend/src/i18n/locales/en-US.ts
frontend/src/i18n/locales/ja-JP.ts
frontend/src/i18n/locales/zh-CN.ts
改进 BetterGI 配置分组编辑,并修正队列/分组启用行为。
  • 使战斗分组的启用状态同时遵循分组包含状态和队列行启用状态。
  • 统一原生配置生成和执行层分段中的自定义分组解析。
  • 通过将弹出窗口挂载到父容器中,修复自定义分组选择和多选弹窗的渲染问题。
  • 将快速配置控件整合到配置模式选择器中。
app/task/BetterGI/tools/one_dragon.py
frontend/src/components/UserNotifyConfig.vue
frontend/src/views/EditView/User/BettergiGroupProjectBody.vue
frontend/src/views/EditView/User/BetterGIUserEdit.vue
app/api/scripts.py
frontend/src/api/services/BetterGiService.ts
frontend/src/api/services/Service.ts
新增针对战斗所有权、通知掉落解析、原生 Plan 映射和分组启用的回归测试。
  • 测试已禁用与归属明确的战斗步骤,以及带后缀的实例。
  • 测试奖励解析、聚合、格式化,以及空日志/无关日志。
  • 测试反向映射白名单、空值过滤和多实例行为。
  • 测试战斗和非战斗分组的启用语义。
tests/task/test_bettergi_combat_scope.py
tests/task/test_bettergi_drop_statistics.py
tests/task/test_bettergi_one_dragon_apply_groups.py
tests/task/test_bettergi_plan_native_settings.py
在项目变更日志中记录整合后的 BetterGI 变更。
  • 记录合并的九个 PR 及其对用户可见的行为变更。
changelog.d/fix-bettergi-combined-prs.fix.md

可能关联的问题

  • #系统清理全仓死代码、重复实现与格式问题:该 PR 直接覆盖 Issue 下一阶段的 core.notify 通知统一和 BetterGI UserEdit 通知组件复用。

提示和命令

与 Sourcery 交互

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

自定义使用体验

访问你的控制面板以:

  • 启用或禁用审查功能,例如 Sourcery 生成的 pull request 摘要、审查者指南等。
  • 更改审查语言。
  • 添加、删除或编辑自定义审查指令。
  • 调整其他审查设置。

获取帮助

Original review guide in English

Reviewer's Guide

Consolidates nine BetterGI PRs around a queue-ordered, single-launch execution layer; separates native versus MAS configuration ownership with safe temporary writes; adds required-field validation, drop-statistics reporting, unified notifications, UI fixes, and regression tests.

Sequence diagram for BetterGI queue-ordered execution

sequenceDiagram
    participant AutoProxyTask
    participant one_dragon_bridge
    participant BetterGI
    participant LogMonitor
    participant LogRecord
    participant NativeOneDragon

    AutoProxyTask->>one_dragon_bridge: build_execution_segments()
    one_dragon_bridge-->>AutoProxyTask: exec_group_names
    AutoProxyTask->>one_dragon_bridge: write_execution_groups()
    AutoProxyTask->>BetterGI: open_process(--startGroups, ...group_names)
    BetterGI-->>LogMonitor: ordered execution logs
    LogMonitor->>LogRecord: update content and status
    LogMonitor-->>AutoProxyTask: group completion or failure markers
    AutoProxyTask->>NativeOneDragon: run remaining enabled tasks
    AutoProxyTask->>one_dragon_bridge: remove_execution_groups()
Loading

Sequence diagram for BetterGI configuration ownership and restoration

sequenceDiagram
    participant AutoProxyTask
    participant NativeConfig
    participant one_dragon
    participant BetterGI

    AutoProxyTask->>AutoProxyTask: read_config_source()
    alt MAS configuration source
        AutoProxyTask->>one_dragon: write_user_one_dragon()
        one_dragon-->>BetterGI: temporary MAS slot and execution groups
    else Direct configuration with quick config
        AutoProxyTask->>NativeConfig: read_native_one_dragon()
        AutoProxyTask->>one_dragon: write_native_one_dragon()
        one_dragon-->>NativeConfig: temporary panel values
    end
    AutoProxyTask->>BetterGI: execute configured tasks
    AutoProxyTask->>NativeConfig: read_file()
    alt configuration unchanged
        AutoProxyTask->>NativeConfig: write_file(snapshot)
    else externally modified
        AutoProxyTask->>NativeConfig: retain external changes
    end
Loading

Sequence diagram for BetterGI drop statistics notification

sequenceDiagram
    participant BetterGI
    participant LogMonitor
    participant AutoProxyTask
    participant parse_drop_lines
    participant push_notification
    participant dispatch
    participant NotificationChannels

    BetterGI-->>LogMonitor: reward recognition log lines
    LogMonitor->>AutoProxyTask: execution LogRecord
    AutoProxyTask->>parse_drop_lines: parse_drop_lines(log lines)
    parse_drop_lines-->>AutoProxyTask: drop_statistics
    AutoProxyTask->>push_notification: push_notification(统计信息)
    push_notification->>dispatch: dispatch(NotifyPayload, statistic_targets)
    dispatch->>NotificationChannels: deliver unified notification
Loading

Flow diagram for BetterGI required configuration validation

flowchart TD
    A[Plan step is scheduled today] --> B{Required fields present?}
    B -->|No| C[masLog MAS_STEP_MISSING_CONFIG]
    C --> D[Skip step]
    D --> E[Execution layer reports failure and reason]
    B -->|Yes| F[dispatchCombat]
    F --> G[BetterGI executes step]
    G --> H{Runtime failure?}
    H -->|Yes| I[Skip failed step and continue]
    H -->|No| J[Mark step complete]
Loading

File-Level Changes

Change Details Files
Reworked BetterGI execution-layer orchestration to build temporary execution segments and run them in one BetterGI process in left-panel queue order, while preserving per-run records and robust cleanup.
  • Combined combat Plan steps and supported custom items into ordered temporary groups.
  • Separated execution-layer ownership from enabled state so disabled configured combat groups are removed from native execution instead of running accidentally.
  • Added completion, timeout, fatal-error, and missing-required-configuration handling, including explicit Auto Boss validation failures.
  • Recorded execution-layer logs/statuses for history, notifications, and crash handling.
app/task/BetterGI/AutoProxy.py
app/task/BetterGI/tools/one_dragon_bridge.py
app/task/BetterGI/tools/one_dragon_plan.py
res/templates/BetterGI/MASOneDragon/main.js
Separated direct-control configuration selection from temporary MAS configuration writes and added safe native-configuration round-tripping.
  • Uses the selected native BetterGI configuration for direct-control mode regardless of quick-config state.
  • Snapshots and restores native configuration only when MAS writes it, preserving external changes made during execution.
  • Added reverse Plan-to-native-key mapping and applied per-step settings to native files/global sections.
  • Corrected global team, strategy, reward-recognition, and Leyline strategy propagation, including explicit empty-value semantics.
app/task/BetterGI/AutoProxy.py
app/task/BetterGI/ScriptConfig.py
app/task/BetterGI/tools/one_dragon.py
app/task/BetterGI/tools/one_dragon_plan.py
Added BetterGI drop-statistics collection and routed BetterGI notifications through the shared AUTO-MAS notification pipeline.
  • Introduced parsing and aggregation of per-round reward-recognition log lines.
  • Added user-configurable drop-statistics output to text, HTML, and notification reports.
  • Forces reward recognition when drop statistics are enabled and includes execution-layer records in report data.
  • Replaced BetterGI-specific delivery logic with shared dispatch and proxy-result helpers.
app/models/config.py
app/models/schema.py
app/task/BetterGI/tools/drop_statistics.py
app/task/BetterGI/tools/notify.py
app/task/notify_core.py
res/html/general_statistics.html
frontend/src/components/UserNotifyConfig.vue
frontend/src/views/EditView/User/BetterGIUserEdit.vue
frontend/src/i18n/locales/en-US.ts
frontend/src/i18n/locales/ja-JP.ts
frontend/src/i18n/locales/zh-CN.ts
Improved BetterGI configuration-group editing and corrected queue/group enablement behavior.
  • Makes combat-group enablement honor both group inclusion and queue-row enabled state.
  • Unifies custom-group resolution across native materialization and execution-layer segments.
  • Fixes custom-group select and multi-select popup rendering by mounting popups within the parent container.
  • Consolidates the quick-config control into the configuration-mode selector.
app/task/BetterGI/tools/one_dragon.py
frontend/src/components/UserNotifyConfig.vue
frontend/src/views/EditView/User/BettergiGroupProjectBody.vue
frontend/src/views/EditView/User/BetterGIUserEdit.vue
app/api/scripts.py
frontend/src/api/services/BetterGiService.ts
frontend/src/api/services/Service.ts
Added regression coverage for combat ownership, notification drop parsing, native Plan mapping, and group enablement.
  • Tests disabled-versus-owned combat steps and suffix instances.
  • Tests reward parsing, aggregation, formatting, and empty/unrelated logs.
  • Tests reverse mapping whitelist, empty-value filtering, and multi-instance behavior.
  • Tests combat and non-combat group enablement semantics.
tests/task/test_bettergi_combat_scope.py
tests/task/test_bettergi_drop_statistics.py
tests/task/test_bettergi_one_dragon_apply_groups.py
tests/task/test_bettergi_plan_native_settings.py
Documented the consolidated BetterGI changes in the project changelog.
  • Records the nine merged PRs and their user-visible behavior changes.
changelog.d/fix-bettergi-combined-prs.fix.md

Possibly linked issues

  • #系统清理全仓死代码、重复实现与格式问题: PR 直接覆盖 Issue 下一阶段的 core.notify 通知统一和 BetterGI UserEdit 通知组件复用。

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

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