Conversation
feat(Component):增加幕间“花札幕台”
…s-roi-dev 修复契光水境式神录识别区域
fix(Duel_Try): 添加队伍试用图像资源及相关规则
- define hook-based battle plans with configurable execution sequences - support decorator and context manager overrides for battle wait strategies - add default handlers for battle completion, settlement, failure, and idle actions
- 点击/滑动拟人化: 坐标均匀分布改为高斯(向按钮中心聚集); minitouch/scrcpy/ nemu_ipc 点击加真实按压时长+抬起前微动+压力抖动(压力钳制到设备范围), 滑动改为变节奏。修掉每次点击 dwell≈0、压力恒定这类可识别特征。 - 新增全局作息约束(默认关): 睡眠时间窗/累计活跃上限/强制休息。在调度器取任务处 加 gate 抬高唤醒时间, 复用现有空闲策略关游戏/模拟器, 支持跨午夜与配置热重载。 - 结界蹭卡新增可选的最小再运行间隔(默认0=不改现状), 压制过高的蹭卡频率。 - 新增一键诊断导出: /home/export_diagnostic 打包脱敏后的关键配置与最近日志成 zip, 便于反馈排查风控问题(脱敏账号/token/密码/手机号)。
- add hook signals and dynamic battle wait plan overrides - integrate strategy-based battle waiting into GeneralBattle - migrate ActivityShikigami battle handling to the new strategy framework
feat: 防风控加固与一键诊断导出
There was a problem hiding this comment.
嘿——我发现了 2 个问题
面向 AI Agent 的提示
请处理这次代码审查中的评论:
## 单独评论
### 评论 1
<location path="tasks/Component/GeneralBattle/battle_wait.py" line_range="247-261" />
<code_context>
+ if kwargs:
</code_context>
<issue_to_address>
**issue (bug_risk):** 装饰器在调用被包装的战斗等待方法时丢弃了位置参数。`GeneralBattle.run_general_battle` 以位置参数方式调用 `self.battle_wait(config.random_click_swipt_enable)`,但 `inner` 忽略了 `args`,仅使用 `battle_wait_plan` 调用被包装函数,因此针对 `random_click_swipt_enable` 的 ActivityShikigami 兼容性处理永远不会被激活,请求的随机点击行为也会丢失。
**触发条件:** 当使用现有的位置参数 `random_click_swipt_enable` 调用 `battle_wait` 时。
**建议修复:** 保留并传递位置参数,或者在应用兼容性覆盖逻辑之前,明确将第一个位置参数映射到 `random_click_swipt_enable`。
</issue_to_address>
### 评论 2
<location path="tasks/Component/GeneralBattle/battle_wait.py" line_range="357-361" />
<code_context>
+ def _bw_success_soul(self, bw_ctx: BattleWaitContext) -> HookSignal:
+ if self.appear_then_click(self.I_WIN, interval=0.8):
+ return HookSignal.CONTINUE
+ appear_ghost, appear_reward, appear_gold, appear_skin = (
+ self.appear(self.I_GREED_GHOST),
+ self.appear(self.I_REWARD),
+ self.appear(self.I_REWARD_GOLD),
+ self.appear(self.I_REWARD_GOLD_SNAKE_SKIN)
+ )
+ if not any([appear_ghost, appear_reward, appear_gold, appear_skin]):
</code_context>
<issue_to_address>
**issue (broader_impact):** 魂战成功处理器不再识别 `I_REWARD_PURPLE_SNAKE_SKIN`,尽管被替换的 ActivityShikigami 实现会处理该奖励。当显示紫色蛇皮奖励时,`_bw_success_soul` 会使 `bw_ctx.completion` 保持为 false,外层战斗循环会无限继续,而不是领取奖励并结束。
**触发条件:** 当战斗产生紫色蛇皮奖励时。
**建议修复:** 在两个奖励检测元组中都加入 `I_REWARD_PURPLE_SNAKE_SKIN`,或者提供等效的自定义奖励钩子。
</issue_to_address>Sourcery 评估
需要人工审查。 需要先处理 2 个发现;此外,新的未认证诊断端点会创建包含配置和近期日志的持久 ZIP 压缩包,而正则清理器可能会遗漏凭据或其他敏感值;即使回滚代码,也不会删除已经创建的压缩包或已经下载的副本。战斗等待重构以及调度器/输入变更也会广泛改变运行时行为,但这些故障通常可以通过回滚代码来恢复。
阻塞性发现:tasks/Component/GeneralBattle/battle_wait.py:261、tasks/Component/GeneralBattle/battle_wait.py:361
帮我变得更有用!请在每条评论上点击 👍 或 👎,我会利用反馈来改进审查结果。
Original comment in English
Hey - I've found 2 issues
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location path="tasks/Component/GeneralBattle/battle_wait.py" line_range="247-261" />
<code_context>
+ if kwargs:
</code_context>
<issue_to_address>
**issue (bug_risk):** The decorator drops positional arguments when invoking the wrapped battle-wait method. `GeneralBattle.run_general_battle` calls `self.battle_wait(config.random_click_swipt_enable)` positionally, but `inner` ignores `args` and calls the wrapped function only with `battle_wait_plan`, so the ActivityShikigami compatibility handling for `random_click_swipt_enable` is never activated and the requested random-click behavior is lost.
**Triggers:** When `battle_wait` is called with the existing positional `random_click_swipt_enable` argument.
**Suggested fix:** Preserve and forward positional arguments, or explicitly map the first positional argument to `random_click_swipt_enable` before applying the compatibility override.
</issue_to_address>
### Comment 2
<location path="tasks/Component/GeneralBattle/battle_wait.py" line_range="357-361" />
<code_context>
+ def _bw_success_soul(self, bw_ctx: BattleWaitContext) -> HookSignal:
+ if self.appear_then_click(self.I_WIN, interval=0.8):
+ return HookSignal.CONTINUE
+ appear_ghost, appear_reward, appear_gold, appear_skin = (
+ self.appear(self.I_GREED_GHOST),
+ self.appear(self.I_REWARD),
+ self.appear(self.I_REWARD_GOLD),
+ self.appear(self.I_REWARD_GOLD_SNAKE_SKIN)
+ )
+ if not any([appear_ghost, appear_reward, appear_gold, appear_skin]):
</code_context>
<issue_to_address>
**issue (broader_impact):** The soul battle success handler no longer recognizes `I_REWARD_PURPLE_SNAKE_SKIN`, although the replaced ActivityShikigami implementation handled that reward. When the purple snake-skin reward is displayed, `_bw_success_soul` leaves `bw_ctx.completion` false and the outer battle loop continues indefinitely instead of collecting the reward and finishing.
**Triggers:** When a battle produces the purple snake-skin reward.
**Suggested fix:** Include `I_REWARD_PURPLE_SNAKE_SKIN` in both reward-detection tuples, or provide an equivalent custom reward hook.
</issue_to_address>Sourcery assessment
Needs a human reviewer. 2 findings to address first, and the new unauthenticated diagnostic endpoint creates persistent ZIP archives containing configuration and recent logs, and the regex scrubber can miss credentials or other sensitive values; reverting the code would not remove archives already created or copies already downloaded. The battle-wait refactor and scheduler/input changes also alter runtime behavior broadly, but those failures are normally reversible with a code rollback.
Blocking findings: tasks/Component/GeneralBattle/battle_wait.py:261, tasks/Component/GeneralBattle/battle_wait.py:361
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
| if kwargs: | ||
| override_kwargs = {} | ||
| override_args = list() | ||
| for key, value in kwargs.items(): | ||
| if key == 'random_click_swipt_enable' and value: | ||
| override_kwargs['randomclick'] = 'default' | ||
| override_args.append('randomclick_default') | ||
| battle_wait_strategy.battle_wait_plan =\ | ||
| battle_wait_strategy.battle_wait_plan.override(*override_args) | ||
| # ----------------------------------------------------------------------- | ||
| # kwargs.setdefault( | ||
| # 'battle_wait_plan', | ||
| # self.battle_wait_plan, | ||
| # ) | ||
| return func(owner, battle_wait_plan=battle_wait_strategy.battle_wait_plan) |
There was a problem hiding this comment.
issue (bug_risk): 装饰器在调用被包装的战斗等待方法时丢弃了位置参数。GeneralBattle.run_general_battle 以位置参数方式调用 self.battle_wait(config.random_click_swipt_enable),但 inner 忽略了 args,仅使用 battle_wait_plan 调用被包装函数,因此针对 random_click_swipt_enable 的 ActivityShikigami 兼容性处理永远不会被激活,请求的随机点击行为也会丢失。
触发条件: 当使用现有的位置参数 random_click_swipt_enable 调用 battle_wait 时。
建议修复: 保留并传递位置参数,或者在应用兼容性覆盖逻辑之前,明确将第一个位置参数映射到 random_click_swipt_enable。
Original comment in English
issue (bug_risk): The decorator drops positional arguments when invoking the wrapped battle-wait method. GeneralBattle.run_general_battle calls self.battle_wait(config.random_click_swipt_enable) positionally, but inner ignores args and calls the wrapped function only with battle_wait_plan, so the ActivityShikigami compatibility handling for random_click_swipt_enable is never activated and the requested random-click behavior is lost.
Triggers: When battle_wait is called with the existing positional random_click_swipt_enable argument.
Suggested fix: Preserve and forward positional arguments, or explicitly map the first positional argument to random_click_swipt_enable before applying the compatibility override.
| appear_ghost, appear_reward, appear_gold, appear_skin = ( | ||
| self.appear(self.I_GREED_GHOST), | ||
| self.appear(self.I_REWARD), | ||
| self.appear(self.I_REWARD_GOLD), | ||
| self.appear(self.I_REWARD_GOLD_SNAKE_SKIN) |
There was a problem hiding this comment.
issue (broader_impact): 魂战成功处理器不再识别 I_REWARD_PURPLE_SNAKE_SKIN,尽管被替换的 ActivityShikigami 实现会处理该奖励。当显示紫色蛇皮奖励时,_bw_success_soul 会使 bw_ctx.completion 保持为 false,外层战斗循环会无限继续,而不是领取奖励并结束。
触发条件: 当战斗产生紫色蛇皮奖励时。
建议修复: 在两个奖励检测元组中都加入 I_REWARD_PURPLE_SNAKE_SKIN,或者提供等效的自定义奖励钩子。
Original comment in English
issue (broader_impact): The soul battle success handler no longer recognizes I_REWARD_PURPLE_SNAKE_SKIN, although the replaced ActivityShikigami implementation handled that reward. When the purple snake-skin reward is displayed, _bw_success_soul leaves bw_ctx.completion false and the outer battle loop continues indefinitely instead of collecting the reward and finishing.
Triggers: When a battle produces the purple snake-skin reward.
Suggested fix: Include I_REWARD_PURPLE_SNAKE_SKIN in both reward-detection tuples, or provide an equivalent custom reward hook.
Automated PR created by GitHub Actions. Merge dev into master
Sourcery 摘要
提升自动化操作的真实性和调度安全性,同时扩展诊断、战斗处理和游戏内容支持。
新功能:
错误修复:
改进:
杂项:
Original summary in English
Summary by Sourcery
Improve automation realism and scheduling safeguards while expanding diagnostics, battle handling, and game-content support.
New Features:
Bug Fixes:
Enhancements:
Chores: