Skip to content

提供了一种自动合成以太电池和高保真母盘的实现#4

Open
luoyrair wants to merge 7 commits into
OneDragon-Anything:mainfrom
luoyrair:auto_synthetic
Open

提供了一种自动合成以太电池和高保真母盘的实现#4
luoyrair wants to merge 7 commits into
OneDragon-Anything:mainfrom
luoyrair:auto_synthetic

Conversation

@luoyrair
Copy link
Copy Markdown
Collaborator

@luoyrair luoyrair commented Apr 5, 2026

Summary by CodeRabbit

  • 新功能
    • 新增自动合成功能,支持高保真母盘和以太电池的自动合成
    • 提供灵活的设置选项,可独立启用或禁用各类合成功能
    • 以太电池合成支持自定义合成数量选择(全部、四个、三个、二个、一个)

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 5, 2026

Warning

Rate limit exceeded

@luoyrair has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 56 minutes and 15 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 56 minutes and 15 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 904cbaa1-dc72-4760-8020-55c8a0ed8232

📥 Commits

Reviewing files that changed from the base of the PR and between ad4ac42 and f2f253e.

📒 Files selected for processing (1)
  • plugins/auto_synthetic/auto_synthetic_app.py
📝 Walkthrough

Walkthrough

新增一个完整的自动合成插件实现,包括主应用程序、工厂类、配置管理、UI设置和两个合成操作流程(高保真母盘和以太电池),配合屏幕交互配置定义。

Changes

Cohort / File(s) Summary
核心应用程序
plugins/auto_synthetic/auto_synthetic_app.py, plugins/auto_synthetic/auto_synthetic_app_factory.py
实现应用程序编排主体和工厂类,支持配置驱动的任务队列管理、顺序执行两个合成操作及完成后的返回逻辑。
配置与常量
plugins/auto_synthetic/auto_synthetic_config.py, plugins/auto_synthetic/auto_synthetic_const.py, plugins/auto_synthetic/auto_synthetic_run_record.py
定义应用配置属性(母盘/电池开关、合成数量枚举)、插件元数据常量及运行记录类。
UI设置组件
plugins/auto_synthetic/auto_synthetic_app_setting.py, plugins/auto_synthetic/auto_synthetic_setting_flyout.py
提供设置界面入口和具体实现,包含三个配置卡片(母盘开关、电池开关、合成数量下拉)及联动控制逻辑。
操作实现
plugins/auto_synthetic/operations/hifi_master_synthesis_op.py, plugins/auto_synthetic/operations/ether_battery_synthesis_op.py
实现两个完整的UI自动化工作流,包含导航、OCR识别、点击交互、数量计算和状态转移逻辑。
屏幕配置
plugins/auto_synthetic/screen_info/video_shop.yml, plugins/auto_synthetic/screen_info/storage_materials_tools.yml, plugins/auto_synthetic/screen_info/manage_item.yml
定义三个游戏UI屏幕的区域检测配置,包括文本识别、按钮定位和导航关系。

Sequence Diagram(s)

sequenceDiagram
    participant App as AutoSyntheticApp
    participant Config as AutoSyntheticConfig
    participant CheckCfg as check_config节点
    participant HifiOp as HifiMasterSynthesisOp
    participant BatteryOp as EtherBatterySynthesisOp
    participant Final as final_return节点
    participant World as BackToNormalWorld

    App->>Config: 加载配置(母盘、电池开关)
    App->>CheckCfg: execute()
    CheckCfg->>CheckCfg: 根据config构建任务队列
    
    alt 有任务
        CheckCfg->>CheckCfg: 返回第一个任务状态
        
        alt 母盘合成
            CheckCfg->>HifiOp: 转移至hifi_master节点
            HifiOp->>HifiOp: 执行母盘合成流程
            HifiOp-->>CheckCfg: 成功→增加任务索引
        end
        
        alt 以太电池合成
            CheckCfg->>BatteryOp: 转移至source_ether_battery节点
            BatteryOp->>Config: 读取合成数量配置
            BatteryOp->>BatteryOp: 执行电池合成流程
            BatteryOp-->>CheckCfg: 成功→增加任务索引
        end
        
        CheckCfg->>Final: 任务全部完成→转移
    else 无任务
        CheckCfg->>Final: 直接转移至完成节点
    end
    
    Final->>World: 执行BackToNormalWorld
    World-->>App: 返回最终结果
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 49.02% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed 标题准确概括了PR的主要变更:实现自动合成以太电池和高保真母盘的完整功能,与所有文件变更高度相关。
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 13

🧹 Nitpick comments (3)
plugins/auto_synthetic/auto_synthetic_app.py (1)

23-23: 请补齐类型注解:operation_class__debug 返回类型。

这两处目前未满足“函数/方法必须有类型注解”的规则。

As per coding guidelines 所有函数和方法必须有类型注解.

Also applies to: 105-105

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@plugins/auto_synthetic/auto_synthetic_app.py` at line 23, The method
signatures in auto_synthetic_app.py lack type annotations: add a type for the
operation_class parameter in __init__ (e.g. operation_class: Type[BaseOperation]
or operation_class: Any if no base type is available) and add an explicit return
annotation for __debug (e.g. def __debug(self) -> bool). Also import typing.Type
or typing.Any as needed and update the other occurrence referenced (the __debug
definition around line 105) to match the same return type annotation.
plugins/auto_synthetic/auto_synthetic_run_record.py (1)

8-8: 运行记录 app_id 建议避免硬编码。

这里直接写死 'auto_synthetic',与常量源分离;后续若 APP_ID 调整会产生隐性不一致。建议改为引用常量。

建议修改
+from zzz_od.plugins.auto_synthetic.auto_synthetic_const import APP_ID
+
 class AutoSyntheticRunRecord(AppRunRecord):
     def __init__(self, instance_idx: int | None = None, game_refresh_hour_offset: int = 0) -> None:
         AppRunRecord.__init__(
             self,
-            'auto_synthetic',
+            APP_ID,
             instance_idx=instance_idx,
             game_refresh_hour_offset=game_refresh_hour_offset
         )
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@plugins/auto_synthetic/auto_synthetic_run_record.py` at line 8, The list
currently contains a hardcoded app id string 'auto_synthetic'; change this to
reference the canonical constant (e.g., APP_ID) instead of a literal. Import the
APP_ID constant from the module that defines application constants (for example
the plugin's constants module) and replace the literal in the list with that
symbol so code in auto_synthetic_run_record.py uses APP_ID consistently (update
any surrounding code that builds or exports this list to use the imported
APP_ID).
plugins/auto_synthetic/auto_synthetic_setting_flyout.py (1)

15-15: _setup_ui 的参数需要补齐类型注解。

layout 当前缺少类型注解,不满足仓库的函数/方法注解要求。

As per coding guidelines 所有函数和方法必须有类型注解.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@plugins/auto_synthetic/auto_synthetic_setting_flyout.py` at line 15, The
_setup_ui method is missing a type annotation for its layout parameter; update
the method signature def _setup_ui(self, layout) -> None: to include a concrete
type (e.g., use typing.Any as a safe default) like def _setup_ui(self, layout:
Any) -> None:, add the corresponding import from typing (import Any) at the top
of the module, and if this overrides or implements a base/abstract method ensure
the annotation matches the declared signature for _setup_ui in related
classes/interfaces.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@plugins/auto_synthetic/auto_synthetic_app_factory.py`:
- Around line 9-13: Replace the relative imports in this factory module with
absolute package imports using the zzz_od.plugins.auto_synthetic path: import
auto_synthetic_const, AutoSyntheticApp, AutoSyntheticConfig, and
AutoSyntheticRunRecord from zzz_od.plugins.auto_synthetic (e.g. from
zzz_od.plugins.auto_synthetic import auto_synthetic_const and from
zzz_od.plugins.auto_synthetic.auto_synthetic_app import AutoSyntheticApp, etc.),
ensuring all four symbols (auto_synthetic_const, AutoSyntheticApp,
AutoSyntheticConfig, AutoSyntheticRunRecord) are imported via absolute imports
to comply with the import guideline.

In `@plugins/auto_synthetic/auto_synthetic_app_setting.py`:
- Line 5: Replace the relative import of APP_ID from auto_synthetic_const with
an absolute import using the repository plugin namespace; locate the statement
referencing APP_ID (from .auto_synthetic_const import APP_ID) in
auto_synthetic_app_setting and change it to import APP_ID from
zzz_od.plugins.auto_synthetic.auto_synthetic_const, and do the same for the
other occurrence that uses a relative import (the similar import at the other
spot referenced in the review).

In `@plugins/auto_synthetic/auto_synthetic_app.py`:
- Around line 11-13:
当前模块使用了相对导入(auto_synthetic_const、EtherBatterySynthesisOp、HifiMasterSynthesisOp);按仓库规范将这些改为绝对导入,替换
from . import auto_synthetic_const 和 from .operations... 导入为以
zzz_od.plugins.auto_synthetic 开头的绝对路径(例如引用
auto_synthetic_const、operations.ether_battery_synthesis_op.EtherBatterySynthesisOp、operations.hifi_master_synthesis_op.HifiMasterSynthesisOp),保持名称不变并确保导入路径与包结构一致。
- Around line 88-95: The loop always returns self.round_success(status='全部完成')
regardless of op.execute() outcome, causing failures to be reported as success;
wrap the call to op.execute() (in the block that sets task.result and advances
self.current_task_index) in a try/except or check the returned result status,
set task.result and task.status ('success'/'failed') accordingly, and if a
failure or exception occurs immediately return self.round_failure(...) with a
descriptive status (and possibly include error details), otherwise continue
incrementing self.current_task_index and only call self.round_success(...) after
all tasks truly succeed.

In `@plugins/auto_synthetic/auto_synthetic_config.py`:
- Around line 46-50: The property source_ether_battery_auto_synthetic_quantity
currently returns a ConfigItem object instead of a string which breaks enum
construction in get_battery_click_count; change its default to
SourceEtherBatteryAutoSyntheticQuantity.ALL.value.value and keep the property
return type as str so it always returns the raw string value, then update
get_battery_click_count to safely map the string to the enum (use try:
SourceEtherBatteryAutoSyntheticQuantity(self.source_ether_battery_auto_synthetic_quantity)
except ValueError: fallback to SourceEtherBatteryAutoSyntheticQuantity.ALL) so
invalid values don’t raise and cause the method to return 0.

In `@plugins/auto_synthetic/auto_synthetic_setting_flyout.py`:
- Around line 9-10: Replace the relative imports in
auto_synthetic_setting_flyout.py with absolute imports: instead of "from .
import auto_synthetic_const" and "from .auto_synthetic_config import
SourceEtherBatteryAutoSyntheticQuantity, AutoSyntheticConfig", import the
symbols from the package root (e.g. use "from zzz_od.plugins.auto_synthetic
import auto_synthetic_const" and "from
zzz_od.plugins.auto_synthetic.auto_synthetic_config import
SourceEtherBatteryAutoSyntheticQuantity, AutoSyntheticConfig") so the module
follows the repository's absolute-import convention.

In `@plugins/auto_synthetic/operations/ether_battery_synthesis_op.py`:
- Around line 137-147: The failure branch "未找到数量增加按钮" is unreachable because
_click_increase_button(number) always returns True; either implement real
existence/click-failure detection in _click_increase_button (e.g., verify the
button exists before clicking, check click result/response, return False on any
failure, and surface that to the caller) or remove the caller's conditional that
returns round_retry when _click_increase_button is False; update or remove
references to EtherBatteryCoordinate.BTN_INCREASE and ensure
ctx.controller.click uses a validated target and error handling so
_click_increase_button accurately reflects success/failure.
- Around line 15-20: Replace all relative imports in this module with absolute
package imports: change occurrences like "from .common_areas import
EtherBatteryCoordinate" and "from ..auto_synthetic_config import
AutoSyntheticConfig" (and any other "from ...." or "from ....." around lines
~15-20 and ~190-193) to their absolute equivalents (e.g., import from the full
package path starting with plugins.auto_synthetic...), updating the references
EtherBatteryCoordinate and AutoSyntheticConfig accordingly so the module uses
absolute imports throughout.
- Around line 180-183: The back() method ignores the result of
self.round_by_click_area("画面-通用", "返回") and always returns round_success, so
clicking may fail silently; update back to capture the
boolean/OperationRoundResult from round_by_click_area (or its success flag), and
only return self.round_success(wait=1) when the click succeeded—otherwise return
an appropriate failure result (e.g., self.round_failure(...) or propagate the
error) so the flow does not proceed on a failed click; reference the back method
and the round_by_click_area/round_success/round_failure helpers when making this
change.
- Around line 187-190: Both goto_world and __debug are missing return type
annotations; add explicit types: annotate goto_world with the same return type
as round_by_find_and_click_area (e.g., -> bool or the exact type from
round_by_find_and_click_area) and annotate __debug as a no-return helper (->
None) or the appropriate type if it returns something; update the function
signatures for goto_world and __debug to include these return type annotations
and import typing.Any if the exact type is unknown.

In `@plugins/auto_synthetic/operations/hifi_master_synthesis_op.py`:
- Around line 23-24: Add explicit return type annotations to the two methods
missing them: annotate the constructor method __init__(self, ctx: ZContext) with
-> None and annotate the private method __debug(...) with -> None (or the
correct non-None return type if it actually returns a value). Update the
function signatures for __init__ and __debug in the HifiMasterSynthesisOp class
to include these return type annotations to comply with the project rule that
all functions and methods must have type hints.
- Around line 122-125: In return_to_world, the click result from
round_by_click_area("画面-通用", "返回") is ignored; change it to capture the result
(e.g., success = self.round_by_click_area(...)), validate that it succeeded, and
only call and return self.round_success(wait=1) when success is truthy; if the
click failed, return an appropriate failure result (e.g.,
self.round_failed(...)) or trigger a retry/cleanup so the operation doesn't
report success on a failed "返回" click.
- Line 14: 当前在 plugins/auto_synthetic/operations/hifi_master_synthesis_op.py 中对
HifiMasterCoordinate 使用了相对导入(from .common_areas import
HifiMasterCoordinate);请改为插件的绝对模块导入,例如从插件包根模块导入 common_areas 中的
HifiMasterCoordinate(替换相对导入为绝对导入模块路径并保留符号
HifiMasterCoordinate),以遵守导入规范并避免路径不一致问题。

---

Nitpick comments:
In `@plugins/auto_synthetic/auto_synthetic_app.py`:
- Line 23: The method signatures in auto_synthetic_app.py lack type annotations:
add a type for the operation_class parameter in __init__ (e.g. operation_class:
Type[BaseOperation] or operation_class: Any if no base type is available) and
add an explicit return annotation for __debug (e.g. def __debug(self) -> bool).
Also import typing.Type or typing.Any as needed and update the other occurrence
referenced (the __debug definition around line 105) to match the same return
type annotation.

In `@plugins/auto_synthetic/auto_synthetic_run_record.py`:
- Line 8: The list currently contains a hardcoded app id string
'auto_synthetic'; change this to reference the canonical constant (e.g., APP_ID)
instead of a literal. Import the APP_ID constant from the module that defines
application constants (for example the plugin's constants module) and replace
the literal in the list with that symbol so code in auto_synthetic_run_record.py
uses APP_ID consistently (update any surrounding code that builds or exports
this list to use the imported APP_ID).

In `@plugins/auto_synthetic/auto_synthetic_setting_flyout.py`:
- Line 15: The _setup_ui method is missing a type annotation for its layout
parameter; update the method signature def _setup_ui(self, layout) -> None: to
include a concrete type (e.g., use typing.Any as a safe default) like def
_setup_ui(self, layout: Any) -> None:, add the corresponding import from typing
(import Any) at the top of the module, and if this overrides or implements a
base/abstract method ensure the annotation matches the declared signature for
_setup_ui in related classes/interfaces.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: d2862b53-6974-439b-9d3e-04adb3f2931c

📥 Commits

Reviewing files that changed from the base of the PR and between 7276a6f and cbb3588.

📒 Files selected for processing (12)
  • plugins/auto_synthetic/__init__.py
  • plugins/auto_synthetic/auto_synthetic_app.py
  • plugins/auto_synthetic/auto_synthetic_app_factory.py
  • plugins/auto_synthetic/auto_synthetic_app_setting.py
  • plugins/auto_synthetic/auto_synthetic_config.py
  • plugins/auto_synthetic/auto_synthetic_const.py
  • plugins/auto_synthetic/auto_synthetic_run_record.py
  • plugins/auto_synthetic/auto_synthetic_setting_flyout.py
  • plugins/auto_synthetic/operations/__init__.py
  • plugins/auto_synthetic/operations/common_areas.py
  • plugins/auto_synthetic/operations/ether_battery_synthesis_op.py
  • plugins/auto_synthetic/operations/hifi_master_synthesis_op.py
📜 Review details
🧰 Additional context used
📓 Path-based instructions (1)
plugins/**/*.py

⚙️ CodeRabbit configuration file

plugins/**/*.py: ## 项目背景
这是 ZZZ-OneDragon (绝区零一条龙) 的插件仓库。
插件会被安装到主仓库的 zzz_od/plugins/ 目录下运行。

代码规范 (Coding Standards)

  • Python 版本: 3.11+
  • 使用现代类型注解: list[str] 而非 List[str]X | None 而非 Optional[X]
  • 所有函数和方法必须有类型注解
  • 路径处理优先使用 pathlib
  • 字符串格式化使用 f-string
  • 避免不必要的 try-catch

插件开发规范

文件命名

  • 工厂文件必须以 _factory.py 结尾
  • 常量文件必须以 _const.py 结尾

必需常量 (xxx_const.py)

  • APP_ID: 插件唯一标识
  • APP_NAME: 插件显示名称
  • DEFAULT_GROUP: 是否出现在一条龙列表

推荐元数据 (xxx_const.py)

  • PLUGIN_AUTHOR: 作者名
  • PLUGIN_HOMEPAGE: 项目主页
  • PLUGIN_VERSION: 版本号
  • PLUGIN_DESCRIPTION: 描述

导入规范 (重要!)

✅ 正确: from zzz_od.plugins.my_plugin import my_plugin_const
❌ 错误: from . import my_plugin_const (禁止相对导入)

审查指南

环境假设

  • 目标平台: 1080p 分辨率 + PC
  • 允许硬编码像素坐标 (基于 1080p)
  • 允许硬编码键盘按键 (如 '`', 'esc')

审查重点 (只关注这些)

  • 严重的逻辑错误
  • 死循环
  • 潜在的运行时崩溃 (Runtime Error)
  • 资源泄漏 (如未关闭的文件句柄)

忽略/不要建议

  • 缩进、空行、空格等格式问题 (由 Ruff 处理)
  • 简单逻辑中的 Magic Number
  • 分辨率适配或控制器类型检查
  • 过度工程化的"最佳实践"
  • 非必要的抽象

Files:

  • plugins/auto_synthetic/auto_synthetic_app_setting.py
  • plugins/auto_synthetic/auto_synthetic_run_record.py
  • plugins/auto_synthetic/auto_synthetic_const.py
  • plugins/auto_synthetic/auto_synthetic_app_factory.py
  • plugins/auto_synthetic/auto_synthetic_setting_flyout.py
  • plugins/auto_synthetic/auto_synthetic_config.py
  • plugins/auto_synthetic/operations/common_areas.py
  • plugins/auto_synthetic/operations/hifi_master_synthesis_op.py
  • plugins/auto_synthetic/operations/ether_battery_synthesis_op.py
  • plugins/auto_synthetic/auto_synthetic_app.py
🪛 Ruff (0.15.9)
plugins/auto_synthetic/auto_synthetic_app_setting.py

[warning] 14-14: Comment contains ambiguous (FULLWIDTH COMMA). Did you mean , (COMMA)?

(RUF003)

plugins/auto_synthetic/operations/ether_battery_synthesis_op.py

[warning] 53-53: String contains ambiguous (FULLWIDTH COLON). Did you mean : (COLON)?

(RUF001)


[warning] 65-65: Comment contains ambiguous (FULLWIDTH COMMA). Did you mean , (COMMA)?

(RUF003)


[warning] 84-84: Comment contains ambiguous (FULLWIDTH COMMA). Did you mean , (COMMA)?

(RUF003)


[warning] 85-85: Comment contains ambiguous (FULLWIDTH COMMA). Did you mean , (COMMA)?

(RUF003)


[warning] 85-85: Comment contains ambiguous (FULLWIDTH COMMA). Did you mean , (COMMA)?

(RUF003)


[warning] 122-122: String contains ambiguous (FULLWIDTH COLON). Did you mean : (COLON)?

(RUF001)


[warning] 130-130: String contains ambiguous (FULLWIDTH COLON). Did you mean : (COLON)?

(RUF001)

plugins/auto_synthetic/auto_synthetic_app.py

[warning] 52-52: Docstring contains ambiguous (FULLWIDTH COMMA). Did you mean , (COMMA)?

(RUF002)

🔇 Additional comments (2)
plugins/auto_synthetic/operations/common_areas.py (1)

4-21: 坐标枚举拆分清晰,可维护性良好。

两个场景的区域坐标集中定义,便于后续识别逻辑复用与维护。

plugins/auto_synthetic/auto_synthetic_const.py (1)

1-9: 常量文件结构完整,符合插件元数据约定。

APP_ID / APP_NAME / DEFAULT_GROUP 以及推荐元数据均已提供,落地良好。

Comment on lines +9 to +13
from . import auto_synthetic_const
from .auto_synthetic_app import AutoSyntheticApp
from .auto_synthetic_config import AutoSyntheticConfig
from .auto_synthetic_run_record import AutoSyntheticRunRecord

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion | 🟠 Major

工厂模块建议统一为绝对导入。

当前相对导入与插件导入规范不一致,建议改为 zzz_od.plugins.auto_synthetic 绝对路径导入。

As per coding guidelines 导入规范 (重要!): ✅ 正确: from zzz_od.plugins.my_plugin import my_plugin_const / ❌ 错误: from . import my_plugin_const (禁止相对导入).

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@plugins/auto_synthetic/auto_synthetic_app_factory.py` around lines 9 - 13,
Replace the relative imports in this factory module with absolute package
imports using the zzz_od.plugins.auto_synthetic path: import
auto_synthetic_const, AutoSyntheticApp, AutoSyntheticConfig, and
AutoSyntheticRunRecord from zzz_od.plugins.auto_synthetic (e.g. from
zzz_od.plugins.auto_synthetic import auto_synthetic_const and from
zzz_od.plugins.auto_synthetic.auto_synthetic_app import AutoSyntheticApp, etc.),
ensuring all four symbols (auto_synthetic_const, AutoSyntheticApp,
AutoSyntheticConfig, AutoSyntheticRunRecord) are imported via absolute imports
to comply with the import guideline.

AppSettingProvider,
SettingType,
)
from .auto_synthetic_const import APP_ID
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion | 🟠 Major

请改为绝对导入,避免相对导入在插件运行上下文中的不确定性。

当前相对导入不符合仓库插件导入约束,建议统一改为 from zzz_od.plugins.auto_synthetic ... 形式。

As per coding guidelines 导入规范 (重要!): ✅ 正确: from zzz_od.plugins.my_plugin import my_plugin_const / ❌ 错误: from . import my_plugin_const (禁止相对导入).

Also applies to: 14-14

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@plugins/auto_synthetic/auto_synthetic_app_setting.py` at line 5, Replace the
relative import of APP_ID from auto_synthetic_const with an absolute import
using the repository plugin namespace; locate the statement referencing APP_ID
(from .auto_synthetic_const import APP_ID) in auto_synthetic_app_setting and
change it to import APP_ID from
zzz_od.plugins.auto_synthetic.auto_synthetic_const, and do the same for the
other occurrence that uses a relative import (the similar import at the other
spot referenced in the review).

Comment on lines +11 to +13
from . import auto_synthetic_const
from .operations.ether_battery_synthesis_op import EtherBatterySynthesisOp
from .operations.hifi_master_synthesis_op import HifiMasterSynthesisOp
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion | 🟠 Major

应用主模块也需要改为绝对导入。

相对导入与仓库插件导入规范不一致,建议统一改为 zzz_od.plugins.auto_synthetic...

As per coding guidelines 导入规范 (重要!): ✅ 正确: from zzz_od.plugins.my_plugin import my_plugin_const / ❌ 错误: from . import my_plugin_const (禁止相对导入).

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@plugins/auto_synthetic/auto_synthetic_app.py` around lines 11 - 13,
当前模块使用了相对导入(auto_synthetic_const、EtherBatterySynthesisOp、HifiMasterSynthesisOp);按仓库规范将这些改为绝对导入,替换
from . import auto_synthetic_const 和 from .operations... 导入为以
zzz_od.plugins.auto_synthetic 开头的绝对路径(例如引用
auto_synthetic_const、operations.ether_battery_synthesis_op.EtherBatterySynthesisOp、operations.hifi_master_synthesis_op.HifiMasterSynthesisOp),保持名称不变并确保导入路径与包结构一致。

Comment on lines +88 to +95
result = op.execute()
task.result = result

# 移动到下一个任务
self.current_task_index += 1

# 所有任务执行完毕
return self.round_success(status='全部完成')
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

任务执行结果未参与流程分支,失败会被误报为“全部完成”。

当前循环里无论 op.execute() 成功或失败,最后都直接 round_success(status='全部完成')。这会掩盖实际失败结果并影响后续调度与统计。

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@plugins/auto_synthetic/auto_synthetic_app.py` around lines 88 - 95, The loop
always returns self.round_success(status='全部完成') regardless of op.execute()
outcome, causing failures to be reported as success; wrap the call to
op.execute() (in the block that sets task.result and advances
self.current_task_index) in a try/except or check the returned result status,
set task.result and task.status ('success'/'failed') accordingly, and if a
failure or exception occurs immediately return self.round_failure(...) with a
descriptive status (and possibly include error details), otherwise continue
incrementing self.current_task_index and only call self.round_success(...) after
all tasks truly succeed.

Comment on lines +46 to +50
def source_ether_battery_auto_synthetic_quantity(self) -> str:
return self.get(
'source_ether_battery_auto_synthetic_quantity',
SourceEtherBatteryAutoSyntheticQuantity.ALL.value
)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# 只读验证:确认 ConfigItem 结构、同仓库同类枚举写法、以及当前字段实际存储形态
set -euo pipefail

echo "== ConfigItem 定义 =="
fd -i "config_item.py" | xargs -r rg -n "class ConfigItem|def __init__|value"

echo
echo "== 全仓库: Enum 成员使用 ConfigItem 的模式 =="
rg -n "Enum\\):|=\\s*ConfigItem\\(" -C2 --type=py

echo
echo "== 全仓库: 这类配置字段如何落盘/读取(是否为字符串) =="
rg -n "source_ether_battery_auto_synthetic_quantity|get_battery_click_count|get\\(|update\\(" -C2 --type=py

Repository: Usagi-wusaqi/zzz-onedragon-plugins

Length of output: 11028


🏁 Script executed:

# 查找 ConfigItem 的导入来源
rg -n "from|import.*ConfigItem" plugins/auto_synthetic/ -B2

# 查看完整的 auto_synthetic_config.py 文件
cat -n plugins/auto_synthetic/auto_synthetic_config.py | head -80

# 查找 ComboBoxSettingCard 和 adapter 的定义
rg -n "class ComboBoxSettingCard|get_prop_adapter|class.*Adapter" --type=py -A5

Repository: Usagi-wusaqi/zzz-onedragon-plugins

Length of output: 24220


🏁 Script executed:

# 检查 ApplicationConfig 基类的 get() 方法
rg -n "class ApplicationConfig|def get\(" --type=py -A5 | head -60

# 检查 ComboBoxSettingCard 如何处理 enum 值
rg -n "class ComboBoxSettingCard|options_enum" --type=py -A10 | head -80

# 查找 adapter 如何处理值的转换
rg -n "get_prop_adapter|class.*Adapter|def get\(" --type=py -A5 | head -100

Repository: Usagi-wusaqi/zzz-onedragon-plugins

Length of output: 3139


🏁 Script executed:

# 确认枚举构造的参数机制
rg -n "SourceEtherBatteryAutoSyntheticQuantity\(" plugins/auto_synthetic/ -B2 -A2

# 确认 setter 和 getter 的值流向
rg -n "source_ether_battery_auto_synthetic_quantity" plugins/auto_synthetic/ -B1 -A1

Repository: Usagi-wusaqi/zzz-onedragon-plugins

Length of output: 3466


枚举成员值类型与 Enum 构造参数不匹配,get_battery_click_count() 会因异常始终返回 0。

这里的问题在于:

  • 枚举成员值都是 ConfigItem 对象(Line 7-11),访问字符串值需要 .value.value(参考 Line 22)
  • 属性声明返回 str(Line 46),但默认值为 SourceEtherBatteryAutoSyntheticQuantity.ALL.value,这是一个 ConfigItem 对象,不是字符串
  • get_battery_click_count() 中直接用 SourceEtherBatteryAutoSyntheticQuantity(self.source_ether_battery_auto_synthetic_quantity) 构造枚举,期望参数为字符串,但枚举成员值是 ConfigItem,构造会失败
  • 异常被捕获后返回硬编码 0,导致合成点击次数始终为 0

需修复:

  1. 默认值改为 SourceEtherBatteryAutoSyntheticQuantity.ALL.value.value(获取字符串值)
  2. 重写枚举查找逻辑,正确处理字符串到枚举的映射:
修复方案
 `@property`
 def source_ether_battery_auto_synthetic_quantity(self) -> str:
     return self.get(
         'source_ether_battery_auto_synthetic_quantity',
-        SourceEtherBatteryAutoSyntheticQuantity.ALL.value
+        SourceEtherBatteryAutoSyntheticQuantity.ALL.value.value
     )

 def get_battery_click_count(self, max_available: int) -> int:
     """获取电池合成需要点击的次数"""
-    try:
-        quantity = SourceEtherBatteryAutoSyntheticQuantity(
-            self.source_ether_battery_auto_synthetic_quantity
-        )
-        return quantity.get_click_count(max_available - 1)
-    except ValueError:
-        return 0
+    raw = self.source_ether_battery_auto_synthetic_quantity
+    for quantity in SourceEtherBatteryAutoSyntheticQuantity:
+        if quantity.value.value == raw:
+            return quantity.get_click_count(max(0, max_available - 1))
+    return 0
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@plugins/auto_synthetic/auto_synthetic_config.py` around lines 46 - 50, The
property source_ether_battery_auto_synthetic_quantity currently returns a
ConfigItem object instead of a string which breaks enum construction in
get_battery_click_count; change its default to
SourceEtherBatteryAutoSyntheticQuantity.ALL.value.value and keep the property
return type as str so it always returns the raw string value, then update
get_battery_click_count to safely map the string to the enum (use try:
SourceEtherBatteryAutoSyntheticQuantity(self.source_ether_battery_auto_synthetic_quantity)
except ValueError: fallback to SourceEtherBatteryAutoSyntheticQuantity.ALL) so
invalid values don’t raise and cause the method to return 0.

Comment thread plugins/auto_synthetic/operations/ether_battery_synthesis_op.py Outdated
Comment thread plugins/auto_synthetic/operations/ether_battery_synthesis_op.py Outdated
Comment thread plugins/auto_synthetic/operations/hifi_master_synthesis_op.py Outdated
Comment thread plugins/auto_synthetic/operations/hifi_master_synthesis_op.py Outdated
Comment thread plugins/auto_synthetic/operations/hifi_master_synthesis_op.py Outdated
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

♻️ Duplicate comments (7)
plugins/auto_synthetic/operations/hifi_master_synthesis_op.py (2)

23-24: ⚠️ Potential issue | 🟠 Major

补全 __init__ 的返回类型注解。

Line 23 这里还缺 -> None,和仓库强制类型注解规则不一致。

建议修改
-    def __init__(self, ctx: ZContext):
+    def __init__(self, ctx: ZContext) -> None:

As per coding guidelines「所有函数和方法必须有类型注解」。

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@plugins/auto_synthetic/operations/hifi_master_synthesis_op.py` around lines
23 - 24, The __init__ method is missing a return type annotation; update the
signature of __init__(self, ctx: ZContext) in the class that calls
ZOperation.__init__(..., op_name='母盘合成') to include "-> None" so it becomes def
__init__(self, ctx: ZContext) -> None:, keeping the existing call to
ZOperation.__init__ unchanged.

14-14: ⚠️ Potential issue | 🟠 Major

请改为插件绝对导入。

这里仍在使用相对导入;插件安装到主仓库后应统一改成 zzz_od.plugins.auto_synthetic...,避免包路径解析不一致。

建议修改
-from .common_areas import HifiMasterCoordinate
+from zzz_od.plugins.auto_synthetic.operations.common_areas import HifiMasterCoordinate

As per coding guidelines「导入规范 (重要!): ✅ 正确: from zzz_od.plugins.my_plugin import my_plugin_const / ❌ 错误: from . import my_plugin_const (禁止相对导入)」。

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@plugins/auto_synthetic/operations/hifi_master_synthesis_op.py` at line 14,
当前文件使用了相对导入 "from .common_areas import
HifiMasterCoordinate";请改成插件的绝对导入,例如将该导入替换为 "from
zzz_od.plugins.auto_synthetic.common_areas import
HifiMasterCoordinate"(并检查同一模块中是否还有其他相对导入一并替换),以符合导入规范并避免包路径解析不一致。
plugins/auto_synthetic/operations/ether_battery_synthesis_op.py (3)

15-19: ⚠️ Potential issue | 🟠 Major

请统一改为绝对导入。

当前文件的运行时导入、TYPE_CHECKING 导入和 __debug() 里的导入都还是相对路径,和插件导入规范不一致。

建议修改
-from .common_areas import EtherBatteryCoordinate
+from zzz_od.plugins.auto_synthetic.operations.common_areas import EtherBatteryCoordinate

 if TYPE_CHECKING:
     from zzz_od.context.zzz_context import ZContext
-    from ..auto_synthetic_config import AutoSyntheticConfig
+    from zzz_od.plugins.auto_synthetic.auto_synthetic_config import AutoSyntheticConfig
@@
 def __debug() -> None:
     from zzz_od.context.zzz_context import ZContext
-    from ..auto_synthetic_config import AutoSyntheticConfig
+    from zzz_od.plugins.auto_synthetic.auto_synthetic_config import AutoSyntheticConfig

As per coding guidelines「导入规范 (重要!): ✅ 正确: from zzz_od.plugins.my_plugin import my_plugin_const / ❌ 错误: from . import my_plugin_const (禁止相对导入)」。

Also applies to: 192-194

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@plugins/auto_synthetic/operations/ether_battery_synthesis_op.py` around lines
15 - 19, 当前文件使用了相对导入(例如 from .common_areas import EtherBatteryCoordinate 以及
TYPE_CHECKING 中的相对路径和 __debug() 内部导入),请把所有相对导入改为插件规范要求的绝对导入:替换
EtherBatteryCoordinate 的导入为绝对路径(例如 from
zzz_od.plugins.auto_synthetic.common_areas import EtherBatteryCoordinate),并同样修改
TYPE_CHECKING 中的 ZContext / AutoSyntheticConfig 引入以及 __debug()
里的任何导入,确保运行时导入、类型检查导入和调试分支均使用绝对导入且引用正确的模块名(保留原有符号名
EtherBatteryCoordinate、ZContext、AutoSyntheticConfig 不变)。

189-190: ⚠️ Potential issue | 🟠 Major

补全 goto_world 的返回类型注解。

Line 189 这里仍缺 -> OperationRoundResult,和仓库强制类型注解规则不一致。

建议修改
-    def goto_world(self):
+    def goto_world(self) -> OperationRoundResult:

As per coding guidelines「所有函数和方法必须有类型注解」。

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@plugins/auto_synthetic/operations/ether_battery_synthesis_op.py` around lines
189 - 190, The method goto_world is missing a return type annotation; update its
signature to declare a return type of OperationRoundResult (e.g., def
goto_world(self) -> OperationRoundResult:) so it follows the repo's
type-annotation rule; ensure the annotated method still returns the result of
calling round_by_find_and_click_area(self.last_screenshot, '画面-通用', '左上角-街区')
and import or reference OperationRoundResult if needed.

137-147: ⚠️ Potential issue | 🟠 Major

未找到数量增加按钮 分支当前不可达。

Line 137 依赖 _click_increase_button() 返回 False,但 Line 142-147 永远返回 True。现在即使增加按钮没点到,流程也会继续执行,失败状态永远不会出现。

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@plugins/auto_synthetic/operations/ether_battery_synthesis_op.py` around lines
137 - 147, The branch checking `_click_increase_button()` is unreachable because
`_click_increase_button` always returns True; change
`_click_increase_button(number: int) -> bool` to detect whether the increase
button exists/was actually clicked (e.g., use self.ctx.controller.find/exists on
EtherBatteryCoordinate.BTN_INCREASE or verify a post-click state) and return
False if not found or click failed, and keep the caller logic that calls
`round_retry(status='未找到数量增加按钮', wait=1)` when `_click_increase_button` returns
False so the failure branch can be triggered (update references:
`_click_increase_button`, `EtherBatteryCoordinate.BTN_INCREASE`,
`self.ctx.controller.click`, `round_retry`, `round_success`).
plugins/auto_synthetic/auto_synthetic_app.py (2)

88-95: ⚠️ Potential issue | 🟠 Major

任务失败会被误报为“全部完成”。

Line 88 的执行结果只被保存到了 task.result,Line 95 仍无条件返回成功。任一子任务失败时,这里会继续推进 current_task_index,最后还会进入 final_return,把整次执行记成成功。

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@plugins/auto_synthetic/auto_synthetic_app.py` around lines 88 - 95, The loop
unconditionally advances current_task_index and ultimately returns
self.round_success even if a subtask failed; modify the block around
op.execute() so that you (1) catch exceptions from op.execute() and mark the
corresponding task (task.result/task.status) as failed, do NOT increment
self.current_task_index, and immediately return a failure response via a new or
existing method (e.g. self.round_failed or self.round_failure) with a
descriptive status; (2) if op.execute() returns a result object that indicates
failure, detect that failure, set task.result/task.status accordingly, and
return failure instead of continuing; ensure the success return at the end
(self.round_success) is only reached when every task completed successfully,
referencing task.result, current_task_index, and round_success/round_failed to
locate the change.

11-17: ⚠️ Potential issue | 🟠 Major

请统一改为绝对导入。

当前运行时导入和 TYPE_CHECKING 导入都还是相对路径,安装到主仓库后容易出现插件包路径不一致。

建议修改
-from . import auto_synthetic_const
-from .operations.ether_battery_synthesis_op import EtherBatterySynthesisOp
-from .operations.hifi_master_synthesis_op import HifiMasterSynthesisOp
+from zzz_od.plugins.auto_synthetic import auto_synthetic_const
+from zzz_od.plugins.auto_synthetic.operations.ether_battery_synthesis_op import EtherBatterySynthesisOp
+from zzz_od.plugins.auto_synthetic.operations.hifi_master_synthesis_op import HifiMasterSynthesisOp

 if TYPE_CHECKING:
     from zzz_od.context.zzz_context import ZContext
-    from .auto_synthetic_config import AutoSyntheticConfig
+    from zzz_od.plugins.auto_synthetic.auto_synthetic_config import AutoSyntheticConfig

As per coding guidelines「导入规范 (重要!): ✅ 正确: from zzz_od.plugins.my_plugin import my_plugin_const / ❌ 错误: from . import my_plugin_const (禁止相对导入)」。

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@plugins/auto_synthetic/auto_synthetic_app.py` around lines 11 - 17, Replace
all relative imports in this module with absolute imports so the plugin works
when installed: change the imports of auto_synthetic_const,
EtherBatterySynthesisOp, and HifiMasterSynthesisOp to use the package absolute
path instead of leading dots (refer to symbol names auto_synthetic_const,
EtherBatterySynthesisOp, HifiMasterSynthesisOp), and also switch the
TYPE_CHECKING imports to absolute paths for ZContext and AutoSyntheticConfig so
they import from the full package module names rather than relative modules.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@plugins/auto_synthetic/auto_synthetic_app.py`:
- Line 23: 在 Task.__init__ 中给参数 operation_class 补充类型注解为 type[ZOperation]:将 def
__init__(self, name: str, operation_class, enabled: bool = True) -> None 改为使用
operation_class: type[ZOperation],并在文件顶部确保已导入 ZOperation(或使用其完整引用名)以消除未定义引用;保持
enabled 和 name 的现有注解不变以满足“所有函数和方法必须有类型注解”的规范。

In `@plugins/auto_synthetic/operations/ether_battery_synthesis_op.py`:
- Around line 86-100: The code treats any round_by_ocr() miss as "储值电卡数量不足",
which misclassifies OCR/UI issues; update the logic in
ether_battery_synthesis_op.py around round_by_ocr, round_success and
max_synthetic_quantity_from_battery_charge so that an OCR miss triggers a
recovery flow (e.g., retry round_by_ocr a couple times with short delays,
optionally fall back to a template match on IMG_PREPAID_CARD or verify UI
loaded) instead of immediately returning '储值电卡数量不足'; only return '储值电卡数量不足' when
you have confirmed the stored-card quantity check
(max_synthetic_quantity_from_battery_charge < 1) fails, return a distinct status
(or retry/abort) for OCR/UI non-detections, and keep the
click(Rect(*EtherBatteryCoordinate.IMG_PREPAID_CARD.value).center) and
round_success('可合成') path unchanged when round_by_ocr succeeds.

---

Duplicate comments:
In `@plugins/auto_synthetic/auto_synthetic_app.py`:
- Around line 88-95: The loop unconditionally advances current_task_index and
ultimately returns self.round_success even if a subtask failed; modify the block
around op.execute() so that you (1) catch exceptions from op.execute() and mark
the corresponding task (task.result/task.status) as failed, do NOT increment
self.current_task_index, and immediately return a failure response via a new or
existing method (e.g. self.round_failed or self.round_failure) with a
descriptive status; (2) if op.execute() returns a result object that indicates
failure, detect that failure, set task.result/task.status accordingly, and
return failure instead of continuing; ensure the success return at the end
(self.round_success) is only reached when every task completed successfully,
referencing task.result, current_task_index, and round_success/round_failed to
locate the change.
- Around line 11-17: Replace all relative imports in this module with absolute
imports so the plugin works when installed: change the imports of
auto_synthetic_const, EtherBatterySynthesisOp, and HifiMasterSynthesisOp to use
the package absolute path instead of leading dots (refer to symbol names
auto_synthetic_const, EtherBatterySynthesisOp, HifiMasterSynthesisOp), and also
switch the TYPE_CHECKING imports to absolute paths for ZContext and
AutoSyntheticConfig so they import from the full package module names rather
than relative modules.

In `@plugins/auto_synthetic/operations/ether_battery_synthesis_op.py`:
- Around line 15-19: 当前文件使用了相对导入(例如 from .common_areas import
EtherBatteryCoordinate 以及 TYPE_CHECKING 中的相对路径和 __debug()
内部导入),请把所有相对导入改为插件规范要求的绝对导入:替换 EtherBatteryCoordinate 的导入为绝对路径(例如 from
zzz_od.plugins.auto_synthetic.common_areas import EtherBatteryCoordinate),并同样修改
TYPE_CHECKING 中的 ZContext / AutoSyntheticConfig 引入以及 __debug()
里的任何导入,确保运行时导入、类型检查导入和调试分支均使用绝对导入且引用正确的模块名(保留原有符号名
EtherBatteryCoordinate、ZContext、AutoSyntheticConfig 不变)。
- Around line 189-190: The method goto_world is missing a return type
annotation; update its signature to declare a return type of
OperationRoundResult (e.g., def goto_world(self) -> OperationRoundResult:) so it
follows the repo's type-annotation rule; ensure the annotated method still
returns the result of calling round_by_find_and_click_area(self.last_screenshot,
'画面-通用', '左上角-街区') and import or reference OperationRoundResult if needed.
- Around line 137-147: The branch checking `_click_increase_button()` is
unreachable because `_click_increase_button` always returns True; change
`_click_increase_button(number: int) -> bool` to detect whether the increase
button exists/was actually clicked (e.g., use self.ctx.controller.find/exists on
EtherBatteryCoordinate.BTN_INCREASE or verify a post-click state) and return
False if not found or click failed, and keep the caller logic that calls
`round_retry(status='未找到数量增加按钮', wait=1)` when `_click_increase_button` returns
False so the failure branch can be triggered (update references:
`_click_increase_button`, `EtherBatteryCoordinate.BTN_INCREASE`,
`self.ctx.controller.click`, `round_retry`, `round_success`).

In `@plugins/auto_synthetic/operations/hifi_master_synthesis_op.py`:
- Around line 23-24: The __init__ method is missing a return type annotation;
update the signature of __init__(self, ctx: ZContext) in the class that calls
ZOperation.__init__(..., op_name='母盘合成') to include "-> None" so it becomes def
__init__(self, ctx: ZContext) -> None:, keeping the existing call to
ZOperation.__init__ unchanged.
- Line 14: 当前文件使用了相对导入 "from .common_areas import
HifiMasterCoordinate";请改成插件的绝对导入,例如将该导入替换为 "from
zzz_od.plugins.auto_synthetic.common_areas import
HifiMasterCoordinate"(并检查同一模块中是否还有其他相对导入一并替换),以符合导入规范并避免包路径解析不一致。
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 8d4566b1-3c16-430a-bc88-c72d7fff0123

📥 Commits

Reviewing files that changed from the base of the PR and between cbb3588 and fdb4765.

📒 Files selected for processing (4)
  • plugins/auto_synthetic/auto_synthetic_app.py
  • plugins/auto_synthetic/auto_synthetic_config.py
  • plugins/auto_synthetic/operations/ether_battery_synthesis_op.py
  • plugins/auto_synthetic/operations/hifi_master_synthesis_op.py
🚧 Files skipped from review as they are similar to previous changes (1)
  • plugins/auto_synthetic/auto_synthetic_config.py
📜 Review details
🧰 Additional context used
📓 Path-based instructions (1)
plugins/**/*.py

⚙️ CodeRabbit configuration file

plugins/**/*.py: ## 项目背景
这是 ZZZ-OneDragon (绝区零一条龙) 的插件仓库。
插件会被安装到主仓库的 zzz_od/plugins/ 目录下运行。

代码规范 (Coding Standards)

  • Python 版本: 3.11+
  • 使用现代类型注解: list[str] 而非 List[str]X | None 而非 Optional[X]
  • 所有函数和方法必须有类型注解
  • 路径处理优先使用 pathlib
  • 字符串格式化使用 f-string
  • 避免不必要的 try-catch

插件开发规范

文件命名

  • 工厂文件必须以 _factory.py 结尾
  • 常量文件必须以 _const.py 结尾

必需常量 (xxx_const.py)

  • APP_ID: 插件唯一标识
  • APP_NAME: 插件显示名称
  • DEFAULT_GROUP: 是否出现在一条龙列表

推荐元数据 (xxx_const.py)

  • PLUGIN_AUTHOR: 作者名
  • PLUGIN_HOMEPAGE: 项目主页
  • PLUGIN_VERSION: 版本号
  • PLUGIN_DESCRIPTION: 描述

导入规范 (重要!)

✅ 正确: from zzz_od.plugins.my_plugin import my_plugin_const
❌ 错误: from . import my_plugin_const (禁止相对导入)

审查指南

环境假设

  • 目标平台: 1080p 分辨率 + PC
  • 允许硬编码像素坐标 (基于 1080p)
  • 允许硬编码键盘按键 (如 '`', 'esc')

审查重点 (只关注这些)

  • 严重的逻辑错误
  • 死循环
  • 潜在的运行时崩溃 (Runtime Error)
  • 资源泄漏 (如未关闭的文件句柄)

忽略/不要建议

  • 缩进、空行、空格等格式问题 (由 Ruff 处理)
  • 简单逻辑中的 Magic Number
  • 分辨率适配或控制器类型检查
  • 过度工程化的"最佳实践"
  • 非必要的抽象

Files:

  • plugins/auto_synthetic/auto_synthetic_app.py
  • plugins/auto_synthetic/operations/hifi_master_synthesis_op.py
  • plugins/auto_synthetic/operations/ether_battery_synthesis_op.py
🪛 Ruff (0.15.9)
plugins/auto_synthetic/auto_synthetic_app.py

[warning] 52-52: Docstring contains ambiguous (FULLWIDTH COMMA). Did you mean , (COMMA)?

(RUF002)

plugins/auto_synthetic/operations/ether_battery_synthesis_op.py

[warning] 53-53: String contains ambiguous (FULLWIDTH COLON). Did you mean : (COLON)?

(RUF001)


[warning] 65-65: Comment contains ambiguous (FULLWIDTH COMMA). Did you mean , (COMMA)?

(RUF003)


[warning] 84-84: Comment contains ambiguous (FULLWIDTH COMMA). Did you mean , (COMMA)?

(RUF003)


[warning] 85-85: Comment contains ambiguous (FULLWIDTH COMMA). Did you mean , (COMMA)?

(RUF003)


[warning] 85-85: Comment contains ambiguous (FULLWIDTH COMMA). Did you mean , (COMMA)?

(RUF003)


[warning] 122-122: String contains ambiguous (FULLWIDTH COLON). Did you mean : (COLON)?

(RUF001)


[warning] 130-130: String contains ambiguous (FULLWIDTH COLON). Did you mean : (COLON)?

(RUF001)

class Task:
"""任务类"""

def __init__(self, name: str, operation_class, enabled: bool = True) -> None:
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

cat -n plugins/auto_synthetic/auto_synthetic_app.py | head -50

Repository: Usagi-wusaqi/zzz-onedragon-plugins

Length of output: 2166


🏁 Script executed:

# 搜索 ZOperation 定义
rg "class ZOperation" --type py

Repository: Usagi-wusaqi/zzz-onedragon-plugins

Length of output: 60


🏁 Script executed:

# 查看 operation_class 在文件中的使用
rg "operation_class" plugins/auto_synthetic/auto_synthetic_app.py -A 2 -B 2

Repository: Usagi-wusaqi/zzz-onedragon-plugins

Length of output: 862


🏁 Script executed:

# 查看整个 __init__ 方法的实现
ast-grep --pattern $'def __init__($_, operation_class, $_) {
  $$$
}'

Repository: Usagi-wusaqi/zzz-onedragon-plugins

Length of output: 60


🏁 Script executed:

cat plugins/auto_synthetic/operations/hifi_master_synthesis_op.py | head -30

Repository: Usagi-wusaqi/zzz-onedragon-plugins

Length of output: 1162


🏁 Script executed:

cat plugins/auto_synthetic/operations/ether_battery_synthesis_op.py | head -30

Repository: Usagi-wusaqi/zzz-onedragon-plugins

Length of output: 1289


🏁 Script executed:

# Search for operation base classes
rg "from one_dragon" plugins/auto_synthetic/operations/ | head -10

Repository: Usagi-wusaqi/zzz-onedragon-plugins

Length of output: 1353


补全 Task.__init__ 的参数类型注解。

operation_class 参数缺少类型注解,应补充为 type[ZOperation],以符合编码规范「所有函数和方法必须有类型注解」的要求。

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@plugins/auto_synthetic/auto_synthetic_app.py` at line 23, 在 Task.__init__
中给参数 operation_class 补充类型注解为 type[ZOperation]:将 def __init__(self, name: str,
operation_class, enabled: bool = True) -> None 改为使用 operation_class:
type[ZOperation],并在文件顶部确保已导入 ZOperation(或使用其完整引用名)以消除未定义引用;保持 enabled 和 name
的现有注解不变以满足“所有函数和方法必须有类型注解”的规范。

Comment on lines +86 to +100
result = self.round_by_ocr(
self.last_screenshot,
"以太电池",
area=ScreenArea(pc_rect=Rect(*EtherBatteryCoordinate.TEXT_ETHER_BATTERY.value))
)
if result.is_success:
time.sleep(0.5)
self.ctx.controller.click(Rect(*EtherBatteryCoordinate.IMG_PREPAID_CARD.value).center)
return self.round_success(status='可合成')
else:
# 移除了模板匹配电池图片的逻辑
if self.max_synthetic_quantity_from_battery_charge < 1:
return self.round_success(status='电量不足')
else:
return self.round_success(status='储值电卡数量不足')
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

不要把 OCR 未命中直接当成“储值电卡数量不足”。

这里一旦 round_by_ocr() 没识别到 以太电池,就直接返回成功状态 储值电卡数量不足。UI 未加载、OCR 波动或坐标漂移时都会被提前判成“材料不足”,整条合成流程会被直接跳过。

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@plugins/auto_synthetic/operations/ether_battery_synthesis_op.py` around lines
86 - 100, The code treats any round_by_ocr() miss as "储值电卡数量不足", which
misclassifies OCR/UI issues; update the logic in ether_battery_synthesis_op.py
around round_by_ocr, round_success and
max_synthetic_quantity_from_battery_charge so that an OCR miss triggers a
recovery flow (e.g., retry round_by_ocr a couple times with short delays,
optionally fall back to a template match on IMG_PREPAID_CARD or verify UI
loaded) instead of immediately returning '储值电卡数量不足'; only return '储值电卡数量不足' when
you have confirmed the stored-card quantity check
(max_synthetic_quantity_from_battery_charge < 1) fails, return a distinct status
(or retry/abort) for OCR/UI non-detections, and keep the
click(Rect(*EtherBatteryCoordinate.IMG_PREPAID_CARD.value).center) and
round_success('可合成') path unchanged when round_by_ocr succeeds.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

♻️ Duplicate comments (1)
plugins/auto_synthetic/auto_synthetic_app.py (1)

11-13: ⚠️ Potential issue | 🟡 Minor

相对导入还没清干净。

这里的运行时导入和 TYPE_CHECKING 导入都还是 . 开头,插件装入主仓库后建议统一改成 zzz_od.plugins.auto_synthetic... 的绝对路径,避免继续偏离仓库约定。

🔧 建议修改
-from . import auto_synthetic_const
-from .operations.ether_battery_synthesis_op import EtherBatterySynthesisOp
-from .operations.hifi_master_synthesis_op import HifiMasterSynthesisOp
+from zzz_od.plugins.auto_synthetic import auto_synthetic_const
+from zzz_od.plugins.auto_synthetic.operations.ether_battery_synthesis_op import EtherBatterySynthesisOp
+from zzz_od.plugins.auto_synthetic.operations.hifi_master_synthesis_op import HifiMasterSynthesisOp

 if TYPE_CHECKING:
     from zzz_od.context.zzz_context import ZContext
-    from .auto_synthetic_config import AutoSyntheticConfig
+    from zzz_od.plugins.auto_synthetic.auto_synthetic_config import AutoSyntheticConfig

As per coding guidelines 导入规范 (重要!): ✅ 正确: from zzz_od.plugins.my_plugin import my_plugin_const / ❌ 错误: from . import my_plugin_const (禁止相对导入).

Also applies to: 17-17

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@plugins/auto_synthetic/auto_synthetic_app.py` around lines 11 - 13, Replace
the relative imports in auto_synthetic_app.py with absolute imports following
the repository convention: change "from . import auto_synthetic_const" to "from
zzz_od.plugins.auto_synthetic import auto_synthetic_const" and update the
operation imports "from .operations.ether_battery_synthesis_op import
EtherBatterySynthesisOp" and "from .operations.hifi_master_synthesis_op import
HifiMasterSynthesisOp" to "from
zzz_od.plugins.auto_synthetic.operations.ether_battery_synthesis_op import
EtherBatterySynthesisOp" and "from
zzz_od.plugins.auto_synthetic.operations.hifi_master_synthesis_op import
HifiMasterSynthesisOp" respectively; also scan for any other relative imports
(including TYPE_CHECKING blocks) in this module and replace them with the
corresponding zzz_od.plugins.auto_synthetic absolute paths.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@plugins/auto_synthetic/auto_synthetic_app.py`:
- Line 38: The code uses two different attribute names for the task index
(current_task_index vs _current_task_index), causing an AttributeError when
_get_next_task_status() reads _current_task_index while __init__() and
check_config() set current_task_index; unify the attribute name across the class
(choose one consistent identifier, e.g., _current_task_index or
current_task_index) and update all references in __init__, check_config(),
_get_next_task_status(), and any increment logic so reads and writes target the
same attribute.

---

Duplicate comments:
In `@plugins/auto_synthetic/auto_synthetic_app.py`:
- Around line 11-13: Replace the relative imports in auto_synthetic_app.py with
absolute imports following the repository convention: change "from . import
auto_synthetic_const" to "from zzz_od.plugins.auto_synthetic import
auto_synthetic_const" and update the operation imports "from
.operations.ether_battery_synthesis_op import EtherBatterySynthesisOp" and "from
.operations.hifi_master_synthesis_op import HifiMasterSynthesisOp" to "from
zzz_od.plugins.auto_synthetic.operations.ether_battery_synthesis_op import
EtherBatterySynthesisOp" and "from
zzz_od.plugins.auto_synthetic.operations.hifi_master_synthesis_op import
HifiMasterSynthesisOp" respectively; also scan for any other relative imports
(including TYPE_CHECKING blocks) in this module and replace them with the
corresponding zzz_od.plugins.auto_synthetic absolute paths.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 7e951cdb-6613-4ea6-834f-c5722cf01ce1

📥 Commits

Reviewing files that changed from the base of the PR and between fdb4765 and 23899c5.

📒 Files selected for processing (1)
  • plugins/auto_synthetic/auto_synthetic_app.py
📜 Review details
🧰 Additional context used
📓 Path-based instructions (1)
plugins/**/*.py

⚙️ CodeRabbit configuration file

plugins/**/*.py: ## 项目背景
这是 ZZZ-OneDragon (绝区零一条龙) 的插件仓库。
插件会被安装到主仓库的 zzz_od/plugins/ 目录下运行。

代码规范 (Coding Standards)

  • Python 版本: 3.11+
  • 使用现代类型注解: list[str] 而非 List[str]X | None 而非 Optional[X]
  • 所有函数和方法必须有类型注解
  • 路径处理优先使用 pathlib
  • 字符串格式化使用 f-string
  • 避免不必要的 try-catch

插件开发规范

文件命名

  • 工厂文件必须以 _factory.py 结尾
  • 常量文件必须以 _const.py 结尾

必需常量 (xxx_const.py)

  • APP_ID: 插件唯一标识
  • APP_NAME: 插件显示名称
  • DEFAULT_GROUP: 是否出现在一条龙列表

推荐元数据 (xxx_const.py)

  • PLUGIN_AUTHOR: 作者名
  • PLUGIN_HOMEPAGE: 项目主页
  • PLUGIN_VERSION: 版本号
  • PLUGIN_DESCRIPTION: 描述

导入规范 (重要!)

✅ 正确: from zzz_od.plugins.my_plugin import my_plugin_const
❌ 错误: from . import my_plugin_const (禁止相对导入)

审查指南

环境假设

  • 目标平台: 1080p 分辨率 + PC
  • 允许硬编码像素坐标 (基于 1080p)
  • 允许硬编码键盘按键 (如 '`', 'esc')

审查重点 (只关注这些)

  • 严重的逻辑错误
  • 死循环
  • 潜在的运行时崩溃 (Runtime Error)
  • 资源泄漏 (如未关闭的文件句柄)

忽略/不要建议

  • 缩进、空行、空格等格式问题 (由 Ruff 处理)
  • 简单逻辑中的 Magic Number
  • 分辨率适配或控制器类型检查
  • 过度工程化的"最佳实践"
  • 非必要的抽象

Files:

  • plugins/auto_synthetic/auto_synthetic_app.py
🪛 Ruff (0.15.9)
plugins/auto_synthetic/auto_synthetic_app.py

[warning] 42-42: Docstring contains ambiguous (FULLWIDTH COMMA). Did you mean , (COMMA)?

(RUF002)

Comment thread plugins/auto_synthetic/auto_synthetic_app.py
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

♻️ Duplicate comments (1)
plugins/auto_synthetic/auto_synthetic_app.py (1)

37-64: ⚠️ Potential issue | 🔴 Critical

关键崩溃:任务索引属性名不一致仍未修复。

Line 38、53 写入的是 self.current_task_index,而 Line 59、62 读取的是 self._current_task_index(带下划线);Line 76、91 又写回 self.current_task_index。只要任务队列非空,check_config 末尾调用 _get_next_task_status() 立刻触发 AttributeError,整个应用无法启动。之前评审已指出,此处仍未统一。

🐛 建议修改
-        if self._current_task_index >= len(self._task_queue):
+        if self.current_task_index >= len(self._task_queue):
             return self.round_success(status='全部完成')

-        current_task = self._task_queue[self._current_task_index]
+        current_task = self._task_queue[self.current_task_index]

As per coding guidelines「审查重点 (只关注这些): 严重的逻辑错误 / 潜在的运行时崩溃 (Runtime Error)」。

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@plugins/auto_synthetic/auto_synthetic_app.py` around lines 37 - 64, The code
uses two different attribute names for the task index (self.current_task_index
vs self._current_task_index) causing an AttributeError in _get_next_task_status;
unify the attribute name across the class (choose either current_task_index or
_current_task_index) and update all references in check_config and
_get_next_task_status (and any other methods that touch the task index) to use
the same symbol (e.g., update _get_next_task_status to read
self.current_task_index or update assignments in check_config to set
self._current_task_index), ensuring initialization, reads, and writes are
consistent with the chosen name.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Duplicate comments:
In `@plugins/auto_synthetic/auto_synthetic_app.py`:
- Around line 37-64: The code uses two different attribute names for the task
index (self.current_task_index vs self._current_task_index) causing an
AttributeError in _get_next_task_status; unify the attribute name across the
class (choose either current_task_index or _current_task_index) and update all
references in check_config and _get_next_task_status (and any other methods that
touch the task index) to use the same symbol (e.g., update _get_next_task_status
to read self.current_task_index or update assignments in check_config to set
self._current_task_index), ensuring initialization, reads, and writes are
consistent with the chosen name.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 94e387ec-1112-440c-bac5-a445a52e30d5

📥 Commits

Reviewing files that changed from the base of the PR and between 23899c5 and ad4ac42.

📒 Files selected for processing (6)
  • plugins/auto_synthetic/auto_synthetic_app.py
  • plugins/auto_synthetic/operations/ether_battery_synthesis_op.py
  • plugins/auto_synthetic/operations/hifi_master_synthesis_op.py
  • plugins/auto_synthetic/screen_info/manage_item.yml
  • plugins/auto_synthetic/screen_info/storage_materials_tools.yml
  • plugins/auto_synthetic/screen_info/video_shop.yml
✅ Files skipped from review due to trivial changes (3)
  • plugins/auto_synthetic/screen_info/video_shop.yml
  • plugins/auto_synthetic/screen_info/storage_materials_tools.yml
  • plugins/auto_synthetic/screen_info/manage_item.yml
📜 Review details
🧰 Additional context used
📓 Path-based instructions (1)
plugins/**/*.py

⚙️ CodeRabbit configuration file

plugins/**/*.py: ## 项目背景
这是 ZZZ-OneDragon (绝区零一条龙) 的插件仓库。
插件会被安装到主仓库的 zzz_od/plugins/ 目录下运行。

代码规范 (Coding Standards)

  • Python 版本: 3.11+
  • 使用现代类型注解: list[str] 而非 List[str]X | None 而非 Optional[X]
  • 所有函数和方法必须有类型注解
  • 路径处理优先使用 pathlib
  • 字符串格式化使用 f-string
  • 避免不必要的 try-catch

插件开发规范

文件命名

  • 工厂文件必须以 _factory.py 结尾
  • 常量文件必须以 _const.py 结尾

必需常量 (xxx_const.py)

  • APP_ID: 插件唯一标识
  • APP_NAME: 插件显示名称
  • DEFAULT_GROUP: 是否出现在一条龙列表

推荐元数据 (xxx_const.py)

  • PLUGIN_AUTHOR: 作者名
  • PLUGIN_HOMEPAGE: 项目主页
  • PLUGIN_VERSION: 版本号
  • PLUGIN_DESCRIPTION: 描述

导入规范 (重要!)

✅ 正确: from zzz_od.plugins.my_plugin import my_plugin_const
❌ 错误: from . import my_plugin_const (禁止相对导入)

审查指南

环境假设

  • 目标平台: 1080p 分辨率 + PC
  • 允许硬编码像素坐标 (基于 1080p)
  • 允许硬编码键盘按键 (如 '`', 'esc')

审查重点 (只关注这些)

  • 严重的逻辑错误
  • 死循环
  • 潜在的运行时崩溃 (Runtime Error)
  • 资源泄漏 (如未关闭的文件句柄)

忽略/不要建议

  • 缩进、空行、空格等格式问题 (由 Ruff 处理)
  • 简单逻辑中的 Magic Number
  • 分辨率适配或控制器类型检查
  • 过度工程化的"最佳实践"
  • 非必要的抽象

Files:

  • plugins/auto_synthetic/operations/hifi_master_synthesis_op.py
  • plugins/auto_synthetic/auto_synthetic_app.py
  • plugins/auto_synthetic/operations/ether_battery_synthesis_op.py
🪛 GitHub Actions: Lint Check
plugins/auto_synthetic/auto_synthetic_app.py

[error] 1-1: Ruff check failed: I001 Import block is un-sorted or un-formatted

🪛 GitHub Check: lint
plugins/auto_synthetic/auto_synthetic_app.py

[failure] 118-118: ruff (W292)
plugins/auto_synthetic/auto_synthetic_app.py:118:14: W292 No newline at end of file
help: Add trailing newline


[failure] 16-17: ruff (I001)
plugins/auto_synthetic/auto_synthetic_app.py:16:5: I001 Import block is un-sorted or un-formatted
help: Organize imports


[failure] 1-13: ruff (I001)
plugins/auto_synthetic/auto_synthetic_app.py:1:1: I001 Import block is un-sorted or un-formatted
help: Organize imports

🪛 Ruff (0.15.10)
plugins/auto_synthetic/auto_synthetic_app.py

[warning] 42-42: Docstring contains ambiguous (FULLWIDTH COMMA). Did you mean , (COMMA)?

(RUF002)

plugins/auto_synthetic/operations/ether_battery_synthesis_op.py

[warning] 50-50: String contains ambiguous (FULLWIDTH COLON). Did you mean : (COLON)?

(RUF001)


[warning] 62-62: Comment contains ambiguous (FULLWIDTH COMMA). Did you mean , (COMMA)?

(RUF003)


[warning] 77-77: Comment contains ambiguous (FULLWIDTH COMMA). Did you mean , (COMMA)?

(RUF003)


[warning] 78-78: Comment contains ambiguous (FULLWIDTH COMMA). Did you mean , (COMMA)?

(RUF003)


[warning] 78-78: Comment contains ambiguous (FULLWIDTH COMMA). Did you mean , (COMMA)?

(RUF003)


[warning] 110-110: String contains ambiguous (FULLWIDTH COLON). Did you mean : (COLON)?

(RUF001)


[warning] 118-118: String contains ambiguous (FULLWIDTH COLON). Did you mean : (COLON)?

(RUF001)

🔇 Additional comments (5)
plugins/auto_synthetic/operations/ether_battery_synthesis_op.py (3)

14-16: 相对导入仍未修复。

Line 16 的 from ..auto_synthetic_config import AutoSyntheticConfig 及 Line 180 的同名导入仍为相对导入,违反插件导入规范。请改为 from zzz_od.plugins.auto_synthetic.auto_synthetic_config import AutoSyntheticConfig

As per coding guidelines「导入规范 (重要!): ❌ 错误: from . import my_plugin_const (禁止相对导入)」。


86-90: OCR 未命中仍被直接判为“储值电卡数量不足”。

之前评论指出的误判问题未解决:round_by_ocr 未识别到“以太电池”时(UI 未加载/OCR 波动/坐标漂移)直接返回成功状态 储值电卡数量不足,会跳过整条合成流程。建议增加重试或模板回退再判定。


125-135: _click_increase_button 仍恒返回 True,未找到数量增加按钮 分支不可达。

Line 132-135 无失败检测,Line 125 的失败分支永远进不去。建议在 round_by_click_area 返回值上做判断并向上传递,或移除该误导性失败分支。

plugins/auto_synthetic/auto_synthetic_app.py (1)

11-17: 相对导入仍未修复。

Line 11-13 的 from . import auto_synthetic_constfrom .operations.ether_battery_synthesis_op ...from .operations.hifi_master_synthesis_op ...,以及 Line 17 TYPE_CHECKING 块的 from .auto_synthetic_config 均为相对导入,违反插件规范,也会触发 Ruff I001 报错。请统一改为 zzz_od.plugins.auto_synthetic... 绝对路径。

As per coding guidelines「导入规范 (重要!): ❌ 错误: from . import my_plugin_const (禁止相对导入)」。

plugins/auto_synthetic/operations/hifi_master_synthesis_op.py (1)

1-115: LGTM!

之前评审提出的相对导入(common_areas 已在本文件删除)、__init__/__debug 返回类型注解、return_to_world 点击结果未校验等问题均已修复。

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