Skip to content

处理爬塔和御魂本的御魂溢出 - #1937

Merged
runhey merged 3 commits into
runhey:devfrom
davidyangkunlong:YuhunOverflow
Oct 15, 2026
Merged

runhey merged 3 commits into
runhey:devfrom
davidyangkunlong:YuhunOverflow

Conversation

@davidyangkunlong

@davidyangkunlong davidyangkunlong commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

1 处理爬塔的御魂溢出,
在interupt循环内部处理,success里面判断遇到御魂溢出,直接退出循环,重新再interupt循环里面处理御魂溢出。排除区域里面增加【去清理】按钮区域,不排除可能直接进入清理,打断循环。
2 处理御魂本的御魂溢出提示
直接修改御魂任务,里面重写的部分。

Sourcery 摘要

处理塔楼和 Orochi 战斗中的灵魂溢出提示,避免奖励处理循环卡住。

错误修复:

  • 在塔楼战斗和 Orochi 灵魂奖励处理期间处理灵魂溢出提示,以便在确认溢出后继续进行游戏。

功能增强:

  • 将溢出处理集成到通用的战斗完成和中断流程中,包括清理操作区域。
Original summary in English

Summary by Sourcery

Handle soul overflow prompts across tower and Orochi battles to prevent reward-processing loops from getting stuck.

Bug Fixes:

  • Handle soul overflow prompts during tower battles and Orochi soul-reward processing so runs can continue after overflow is acknowledged.

Enhancements:

  • Integrate overflow handling into the shared battle completion and interruption flow, including the cleanup action area.

1 点击御魂溢出的提示
2 测试过在interupt里面增加,无法生效。
1 爬塔活动处理御魂溢出。
2 刷御魂处理御魂溢出。

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

嘿——我发现了 4 个问题

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

## 各项评论

### 评论 1
<location path="tasks/Component/GeneralBattle/battle_wait.py" line_range="161" />
<code_context>
         'C_END_BUFF_AREA_2', 'C_END_SOUL_RECORD', 'C_END_SOUL_DETAILS',
         'C_END_1_1', 'C_END_1_2', 'C_END_1_3', 'C_END_1_4',
-        'C_END_1_5', 'C_END_1_6',
+        'C_END_1_5', 'C_END_1_6', "C_OVERFLOW_GHOST",
     ])

</code_context>
<issue_to_address>
**随机点击导致离开战斗**

胜利后第一次随机点击时,如果溢出清理按钮处于可见状态,`_bw_success_default` 会根据 `excludes_1` 构造 `click_stage_1`,但其中缺少 `C_OVERFLOW_GHOST`,因此在处理溢出之前,随机点击可能会选中“前往清理”,从而离开奖励结算界面。

将 `C_OVERFLOW_GHOST` 添加到 `excludes_1`,这样胜利后的第一次随机点击就会避开清理按钮。
</issue_to_address>

### 评论 2
<location path="tasks/Orochi/script_task.py" line_range="437-438" />
<code_context>
                 while 1:
                     self.screenshot()
+                    # 处理御魂溢出
+                    if self.appear_then_click(self.I_OVER_GHOST):
+                        continue
+
                     action_click = random.choice([self.C_REWARD_1, self.C_REWARD_2, self.C_REWARD_3])
</code_context>
<issue_to_address>
**大蛇任务卡住**

如果溢出提示在检测到任一奖励指示器之前出现,或遮挡了两个奖励指示器,`battle_wait` 只会在奖励循环中检查 `I_OVER_GHOST`。而外层循环只有在检测到 `I_GREED_GHOST` 或 `I_REWARD` 后才会进入奖励循环,因此它永远不会关闭该提示,大蛇任务也就会一直卡住。

在外层循环中、根据奖励指示器进行分支判断之前,检查并关闭 `I_OVER_GHOST`。

`tasks/Orochi/script_task.py:452-454` 处也有同样的问题。
</issue_to_address>

### 评论 3
<location path="tasks/Component/GeneralBattle/battle_wait.py" line_range="1157" />
<code_context>
         # 比如 御魂溢出
+
+        # 结算的时候御魂溢出提示,点击【知道了】
+        self.appear_then_click(self.I_OVER_GHOST)
+
         return HookSignal.CONTINUE
</code_context>
<issue_to_address>
**旧版战斗流程未处理溢出**

使用旧版 `GeneralBattle.battle_wait` 路径的任务遇到溢出提示时,`GeneralBattle.battle_wait` 会覆盖由钩子驱动的等待循环,而 `run_general_battle` 会调用这个覆盖实现,因此这些调用方永远不会执行 `_bw_interrupt_default`。如果这类战斗中出现溢出提示,新增的处理逻辑不会关闭它,调用方就会卡在被阻塞的奖励流程中。

也应在旧版战斗等待的奖励流程中加入溢出提示关闭逻辑,或者让这些调用方改用由钩子驱动的实现。
</issue_to_address>

### 评论 4
<location path="tasks/Component/GeneralBattle/battle_wait.py" line_range="1157" />
<code_context>
         # 比如 御魂溢出
+
+        # 结算的时候御魂溢出提示,点击【知道了】
+        self.appear_then_click(self.I_OVER_GHOST)
+
         return HookSignal.CONTINUE
</code_context>
<issue_to_address>
**武斗会爬塔时未关闭溢出提示**

武斗大会爬塔在战斗结算期间遇到溢出提示时,`Foot.battle_wait_daily_training` 和 `Foot.battle_wait_cultivation_drills` 会覆盖共享的战斗等待流程,因此它们不会调用此中断处理程序;它们的结果循环也不会关闭 `I_OVER_GHOST`,导致武斗大会爬塔卡在溢出提示界面。

在武斗大会的战斗等待覆盖实现中加入溢出提示检测和关闭逻辑,或者让该任务改用共享的中断流程。
</issue_to_address>

Sourcery 评估

等待批准。 请先处理这 4 项发现。

阻塞性发现:tasks/Component/GeneralBattle/battle_wait.py:161、tasks/Orochi/script_task.py:438、tasks/Component/GeneralBattle/battle_wait.py:1157、tasks/Component/GeneralBattle/battle_wait.py:1157


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

Hey - I've found 4 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="161" />
<code_context>
         'C_END_BUFF_AREA_2', 'C_END_SOUL_RECORD', 'C_END_SOUL_DETAILS',
         'C_END_1_1', 'C_END_1_2', 'C_END_1_3', 'C_END_1_4',
-        'C_END_1_5', 'C_END_1_6',
+        'C_END_1_5', 'C_END_1_6', "C_OVERFLOW_GHOST",
     ])

</code_context>
<issue_to_address>
**Random click leaves battle**

When the overflow cleanup button is visible during the first post-win random click, `_bw_success_default` builds `click_stage_1` from `excludes_1`, which lacks `C_OVERFLOW_GHOST`, so the random click can select “Go Clean” before overflow handling runs and navigate away from reward settlement.

Add `C_OVERFLOW_GHOST` to `excludes_1` so the first post-win random click avoids the cleanup button.
</issue_to_address>

### Comment 2
<location path="tasks/Orochi/script_task.py" line_range="437-438" />
<code_context>
                 while 1:
                     self.screenshot()
+                    # 处理御魂溢出
+                    if self.appear_then_click(self.I_OVER_GHOST):
+                        continue
+
                     action_click = random.choice([self.C_REWARD_1, self.C_REWARD_2, self.C_REWARD_3])
</code_context>
<issue_to_address>
**Orochi task remains stuck**

When the overflow prompt appears before either reward indicator is detected, or obscures both indicators, `battle_wait` only checks `I_OVER_GHOST` inside reward loops, which the outer loop enters after detecting `I_GREED_GHOST` or `I_REWARD`; it therefore never dismisses the prompt and the Orochi task remains stuck.

Check and dismiss `I_OVER_GHOST` in the outer loop before branching on the reward indicators.

Also at `tasks/Orochi/script_task.py:452-454`.
</issue_to_address>

### Comment 3
<location path="tasks/Component/GeneralBattle/battle_wait.py" line_range="1157" />
<code_context>
         # 比如 御魂溢出
+
+        # 结算的时候御魂溢出提示,点击【知道了】
+        self.appear_then_click(self.I_OVER_GHOST)
+
         return HookSignal.CONTINUE
</code_context>
<issue_to_address>
**Legacy battle flow skips overflow handling**

When a task using the legacy `GeneralBattle.battle_wait` path encounters an overflow prompt, `GeneralBattle.battle_wait` overrides the hook-driven wait loop, and `run_general_battle` calls that override, so those callers never execute `_bw_interrupt_default`. When an overflow prompt appears during one of these battles, the added handler does not dismiss it and the caller remains on the blocked reward flow.

Add overflow dismissal to the legacy battle-wait reward flow as well, or route those callers through the hook-driven implementation.
</issue_to_address>

### Comment 4
<location path="tasks/Component/GeneralBattle/battle_wait.py" line_range="1157" />
<code_context>
         # 比如 御魂溢出
+
+        # 结算的时候御魂溢出提示,点击【知道了】
+        self.appear_then_click(self.I_OVER_GHOST)
+
         return HookSignal.CONTINUE
</code_context>
<issue_to_address>
**Budokai tower leaves overflow prompt**

When a Budokai Tournament climb encounters the overflow prompt during battle settlement, `Foot.battle_wait_daily_training` and `Foot.battle_wait_cultivation_drills` override the shared battle-wait flow, so they never call this interrupt handler; their result loops do not dismiss `I_OVER_GHOST`, leaving the Budokai climb stuck on the overflow prompt.

Add overflow detection and dismissal to the Budokai Tournament battle-wait override, or route that task through the shared interrupt flow.
</issue_to_address>

Sourcery assessment

Approval pending. 4 findings to address first.

Blocking findings: tasks/Component/GeneralBattle/battle_wait.py:161, tasks/Orochi/script_task.py:438, tasks/Component/GeneralBattle/battle_wait.py:1157, tasks/Component/GeneralBattle/battle_wait.py:1157


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

'C_END_BUFF_AREA_2', 'C_END_SOUL_RECORD', 'C_END_SOUL_DETAILS',
'C_END_1_1', 'C_END_1_2', 'C_END_1_3', 'C_END_1_4',
'C_END_1_5', 'C_END_1_6',
'C_END_1_5', 'C_END_1_6', "C_OVERFLOW_GHOST",

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Medium · 随机点击导致离开战斗

胜利后第一次随机点击时,如果溢出清理按钮处于可见状态,_bw_success_default 会根据 excludes_1 构造 click_stage_1,但其中缺少 C_OVERFLOW_GHOST,因此在处理溢出之前,随机点击可能会选中“前往清理”,从而离开奖励结算界面。

将 C_OVERFLOW_GHOST 添加到 excludes_1,这样胜利后的第一次随机点击就会避开清理按钮。

给 AI 代理的提示
在 `tasks/Component/GeneralBattle/battle_wait.py` 第 161 行:

**随机点击导致离开战斗**

胜利后第一次随机点击时,如果溢出清理按钮处于可见状态,`_bw_success_default` 会根据 `excludes_1` 构造 `click_stage_1`,但其中缺少 `C_OVERFLOW_GHOST`,因此在处理溢出之前,随机点击可能会选中“前往清理”,从而离开奖励结算界面。

将 `C_OVERFLOW_GHOST` 添加到 `excludes_1`,这样胜利后的第一次随机点击就会避开清理按钮。
Original comment in English

🟡 Medium · Random click leaves battle

When the overflow cleanup button is visible during the first post-win random click, _bw_success_default builds click_stage_1 from excludes_1, which lacks C_OVERFLOW_GHOST, so the random click can select “Go Clean” before overflow handling runs and navigate away from reward settlement.

Add C_OVERFLOW_GHOST to excludes_1 so the first post-win random click avoids the cleanup button.

Prompt for AI agents
In `tasks/Component/GeneralBattle/battle_wait.py` at line 161:

**Random click leaves battle**

When the overflow cleanup button is visible during the first post-win random click, `_bw_success_default` builds `click_stage_1` from `excludes_1`, which lacks `C_OVERFLOW_GHOST`, so the random click can select “Go Clean” before overflow handling runs and navigate away from reward settlement.

Add `C_OVERFLOW_GHOST` to `excludes_1` so the first post-win random click avoids the cleanup button.

Comment on lines +437 to +438
if self.appear_then_click(self.I_OVER_GHOST):
continue

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟠 High · 大蛇任务卡住

如果溢出提示在检测到任一奖励指示器之前出现,或遮挡了两个奖励指示器,battle_wait 只会在奖励循环中检查 I_OVER_GHOST。而外层循环只有在检测到 I_GREED_GHOST 或 I_REWARD 后才会进入奖励循环,因此它永远不会关闭该提示,大蛇任务也就会一直卡住。

在外层循环中、根据奖励指示器进行分支判断之前,检查并关闭 I_OVER_GHOST。

tasks/Orochi/script_task.py:452-454 处也有同样的问题。

给 AI 代理的提示
在 `tasks/Orochi/script_task.py` 第 437-438 行:

**大蛇任务卡住**

如果溢出提示在检测到任一奖励指示器之前出现,或遮挡了两个奖励指示器,`battle_wait` 只会在奖励循环中检查 `I_OVER_GHOST`。而外层循环只有在检测到 `I_GREED_GHOST` 或 `I_REWARD` 后才会进入奖励循环,因此它永远不会关闭该提示,大蛇任务也就会一直卡住。

在外层循环中、根据奖励指示器进行分支判断之前,检查并关闭 `I_OVER_GHOST`。

`tasks/Orochi/script_task.py:452-454` 处也有同样的问题。
Original comment in English

🟠 High · Orochi task remains stuck

When the overflow prompt appears before either reward indicator is detected, or obscures both indicators, battle_wait only checks I_OVER_GHOST inside reward loops, which the outer loop enters after detecting I_GREED_GHOST or I_REWARD; it therefore never dismisses the prompt and the Orochi task remains stuck.

Check and dismiss I_OVER_GHOST in the outer loop before branching on the reward indicators.

Also at tasks/Orochi/script_task.py:452-454.

Prompt for AI agents
In `tasks/Orochi/script_task.py` at lines 437-438:

**Orochi task remains stuck**

When the overflow prompt appears before either reward indicator is detected, or obscures both indicators, `battle_wait` only checks `I_OVER_GHOST` inside reward loops, which the outer loop enters after detecting `I_GREED_GHOST` or `I_REWARD`; it therefore never dismisses the prompt and the Orochi task remains stuck.

Check and dismiss `I_OVER_GHOST` in the outer loop before branching on the reward indicators.

Also at `tasks/Orochi/script_task.py:452-454`.

# 比如 御魂溢出

# 结算的时候御魂溢出提示,点击【知道了】
self.appear_then_click(self.I_OVER_GHOST)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Medium · 旧版战斗流程未处理溢出

使用旧版 GeneralBattle.battle_wait 路径的任务遇到溢出提示时,GeneralBattle.battle_wait 会覆盖由钩子驱动的等待循环,而 run_general_battle 会调用这个覆盖实现,因此这些调用方永远不会执行 _bw_interrupt_default。如果这类战斗中出现溢出提示,新增的处理逻辑不会关闭它,调用方就会卡在被阻塞的奖励流程中。

也应在旧版战斗等待的奖励流程中加入溢出提示关闭逻辑,或者让这些调用方改用由钩子驱动的实现。

给 AI 代理的提示
在 `tasks/Component/GeneralBattle/battle_wait.py` 第 1157 行:

**旧版战斗流程未处理溢出**

使用旧版 `GeneralBattle.battle_wait` 路径的任务遇到溢出提示时,`GeneralBattle.battle_wait` 会覆盖由钩子驱动的等待循环,而 `run_general_battle` 会调用这个覆盖实现,因此这些调用方永远不会执行 `_bw_interrupt_default`。如果这类战斗中出现溢出提示,新增的处理逻辑不会关闭它,调用方就会卡在被阻塞的奖励流程中。

也应在旧版战斗等待的奖励流程中加入溢出提示关闭逻辑,或者让这些调用方改用由钩子驱动的实现。
Original comment in English

🟡 Medium · Legacy battle flow skips overflow handling

When a task using the legacy GeneralBattle.battle_wait path encounters an overflow prompt, GeneralBattle.battle_wait overrides the hook-driven wait loop, and run_general_battle calls that override, so those callers never execute _bw_interrupt_default. When an overflow prompt appears during one of these battles, the added handler does not dismiss it and the caller remains on the blocked reward flow.

Add overflow dismissal to the legacy battle-wait reward flow as well, or route those callers through the hook-driven implementation.

Prompt for AI agents
In `tasks/Component/GeneralBattle/battle_wait.py` at line 1157:

**Legacy battle flow skips overflow handling**

When a task using the legacy `GeneralBattle.battle_wait` path encounters an overflow prompt, `GeneralBattle.battle_wait` overrides the hook-driven wait loop, and `run_general_battle` calls that override, so those callers never execute `_bw_interrupt_default`. When an overflow prompt appears during one of these battles, the added handler does not dismiss it and the caller remains on the blocked reward flow.

Add overflow dismissal to the legacy battle-wait reward flow as well, or route those callers through the hook-driven implementation.

# 比如 御魂溢出

# 结算的时候御魂溢出提示,点击【知道了】
self.appear_then_click(self.I_OVER_GHOST)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟠 High · 武斗会爬塔时未关闭溢出提示

武斗大会爬塔在战斗结算期间遇到溢出提示时,Foot.battle_wait_daily_training 和 Foot.battle_wait_cultivation_drills 会覆盖共享的战斗等待流程,因此它们不会调用此中断处理程序;它们的结果循环也不会关闭 I_OVER_GHOST,导致武斗大会爬塔卡在溢出提示界面。

在武斗大会的战斗等待覆盖实现中加入溢出提示检测和关闭逻辑,或者让该任务改用共享的中断流程。

给 AI 代理的提示
在 `tasks/Component/GeneralBattle/battle_wait.py` 第 1157 行:

**武斗会爬塔时未关闭溢出提示**

武斗大会爬塔在战斗结算期间遇到溢出提示时,`Foot.battle_wait_daily_training` 和 `Foot.battle_wait_cultivation_drills` 会覆盖共享的战斗等待流程,因此它们不会调用此中断处理程序;它们的结果循环也不会关闭 `I_OVER_GHOST`,导致武斗大会爬塔卡在溢出提示界面。

在武斗大会的战斗等待覆盖实现中加入溢出提示检测和关闭逻辑,或者让该任务改用共享的中断流程。
Original comment in English

🟠 High · Budokai tower leaves overflow prompt

When a Budokai Tournament climb encounters the overflow prompt during battle settlement, Foot.battle_wait_daily_training and Foot.battle_wait_cultivation_drills override the shared battle-wait flow, so they never call this interrupt handler; their result loops do not dismiss I_OVER_GHOST, leaving the Budokai climb stuck on the overflow prompt.

Add overflow detection and dismissal to the Budokai Tournament battle-wait override, or route that task through the shared interrupt flow.

Prompt for AI agents
In `tasks/Component/GeneralBattle/battle_wait.py` at line 1157:

**Budokai tower leaves overflow prompt**

When a Budokai Tournament climb encounters the overflow prompt during battle settlement, `Foot.battle_wait_daily_training` and `Foot.battle_wait_cultivation_drills` override the shared battle-wait flow, so they never call this interrupt handler; their result loops do not dismiss `I_OVER_GHOST`, leaving the Budokai climb stuck on the overflow prompt.

Add overflow detection and dismissal to the Budokai Tournament battle-wait override, or route that task through the shared interrupt flow.

@github-actions

Copy link
Copy Markdown
Contributor

Findings

  • C2 [风险]
    位置:tasks/Component/GeneralBattle/battle_wait.py:_bw_success_default、_bw_interrupt_default
    原因:_bw_success_default 中对 self.I_OVER_GHOST 的两次判断连续出现,第一次命中即 return,后面的点击分支不可达;同时多个 while 通过 continue 重试,没有明确的失败退出或超时保护。
    修改:合并为单一的“检测并处理”分支,明确处理后的状态转移;为持续检测增加最大重试次数、超时或显式失败返回。
  • C7 [风险]
    位置:tasks/Component/GeneralBattle/battle_wait.py:OptionSuccessDefault、_bw_success_default、_bw_interrupt_default
    原因:改动下沉到通用战斗流程,会影响所有复用该组件的任务,但当前没有限定御魂溢出提示的适用场景;固定坐标资源和全局自动点击可能误触其他页面或改变既有结算流程。
    修改:确认并限制该处理只在对应战斗/页面状态生效,优先复用可靠的页面或弹窗状态判定;补充其他通用战斗场景的回归验证。

Warning

Firewall blocked 1 domain

The following domain was blocked by the firewall during workflow execution:

  • ab.chatgpt.com

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "ab.chatgpt.com"

See Network Configuration for more information.

Generated by PR Review Checklist for #1937 · codex · gpt56 · 11.9 AIC · ⌖ 3.26 AIC · ⊞ 12.1K · ◷

@runhey

runhey commented Oct 15, 2026

Copy link
Copy Markdown
Owner

good

@runhey
runhey merged commit 12048ca into runhey:dev Oct 15, 2026
6 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants