Skip to content

道馆开启尝试移到查找循环之前 - #1976

Merged
runhey merged 1 commit into
runhey:devfrom
weirj2016-ai:fix/dokan-create-on-entry-dev
Oct 28, 2026
Merged

runhey merged 1 commit into
runhey:devfrom
weirj2016-ai:fix/dokan-create-on-entry-dev

Conversation

@weirj2016-ai

@weirj2016-ai weirj2016-ai commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

变更

#1975 上个PR把周一创建道馆的限制删除后,由于创建位于查找阴阳寮循环的开头,如果选择挑战的阴阳寮被攻破,会循环 创建道馆-尝试攻破失败-回到查找阴阳寮循环-创建 ,由于上个pr已被合并,故新提了PR,把创建道馆独立于查找循环前。

  • 道馆场景导航完成后重新识别当前场景。
  • 仅在“寻找道馆”、try_start_dokan 开启且剩余挑战次数大于 0 时,在主循环前尝试开启道馆一次。
  • 移除寻找道馆循环内的创建调用,避免场景未切换时每轮重复点击。
  • 保留候选选择和列表刷新逻辑。

验证

  • git diff --check 通过。
  • 未运行自动化测试。

Sourcery 总结

在进入寻找道场的循环之前,先尝试打开一次符合条件的道场。

Bug 修复:

  • 防止在寻找道场的场景尚未变化时重复尝试创建道场。

增强功能:

  • 导航至道场后重新检测场景,并在符合条件时将首次打开道场的尝试移至主搜索循环之前。
Original summary in English

Summary by Sourcery

Attempt to open an eligible dojo once before entering the dojo-finding loop.

Bug Fixes:

  • Prevent repeated dojo-creation attempts while the dojo-finding scene has not changed.

Enhancements:

  • Retry scene detection after navigating to the dojo and move the initial dojo-opening attempt before the main search loop when eligible.

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

嗨——我发现了 1 个问题

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

## 单条评论

### 评论 1
<location path="tasks/Dokan/script_task.py" line_range="97-99" />
<code_context>
+            in_dokan, current_scene = self.get_current_scene(True)
+
+        # 进入道馆寻找界面后,在主循环前仅尝试一次开启道馆
+        if (in_dokan and
+                current_scene == DokanScene.RYOU_DOKAN_SCENE_FINDING_DOKAN and
+                cfg.dokan_config.try_start_dokan):
+            count = self.update_remain_attack_count()
+            if count > 0:
</code_context>
<issue_to_address>
**道馆创建尝试被跳过**

如果任务启动时已经处于道馆界面,但缓存的截图已过时,未显示寻找道馆场景,那么 `get_current_scene(True)` 可能会将缓存帧判定为非寻找场景,因此此条件判断会跳过 `creat_dokan()`。主循环稍后会获取新帧并处理寻找道馆场景,但此时不再尝试创建道馆;用户会发现配置的开场尝试被跳过。

请在判断此条件前刷新截图,或者在主循环重新检测到寻找道馆场景后再进行这次单次尝试。
</issue_to_address>

Sourcery 评估

等待批准。 请先处理 1 个问题。

阻塞性问题:tasks/Dokan/script_task.py:99


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

Hey - I've found 1 issue

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

## Individual Comments

### Comment 1
<location path="tasks/Dokan/script_task.py" line_range="97-99" />
<code_context>
+            in_dokan, current_scene = self.get_current_scene(True)
+
+        # 进入道馆寻找界面后,在主循环前仅尝试一次开启道馆
+        if (in_dokan and
+                current_scene == DokanScene.RYOU_DOKAN_SCENE_FINDING_DOKAN and
+                cfg.dokan_config.try_start_dokan):
+            count = self.update_remain_attack_count()
+            if count > 0:
</code_context>
<issue_to_address>
**道馆创建尝试被跳过**

When the task starts already in a Dokan screen while the cached screenshot is stale and does not show the finding scene, `get_current_scene(True)` can classify a cached frame as a non-finding scene, so this guard skips `creat_dokan()`. The main loop later captures a fresh frame and handles the finding scene, but no longer attempts creation there; users see the configured opening attempt skipped.

Refresh the screenshot before evaluating this guard, or make the one-shot attempt after the main loop has freshly detected the finding scene.
</issue_to_address>

Sourcery assessment

Approval pending. 1 finding to address first.

Blocking findings: tasks/Dokan/script_task.py:99


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

Comment on lines +97 to +99
if (in_dokan and
current_scene == DokanScene.RYOU_DOKAN_SCENE_FINDING_DOKAN and
cfg.dokan_config.try_start_dokan):

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 中等 · 道馆创建尝试被跳过

如果任务启动时已经处于道馆界面,但缓存的截图已过时,未显示寻找道馆场景,那么 get_current_scene(True) 可能会将缓存帧判定为非寻找场景,因此此条件判断会跳过 creat_dokan()。主循环稍后会获取新帧并处理寻找道馆场景,但此时不再尝试创建道馆;用户会发现配置的开场尝试被跳过。

请在判断此条件前刷新截图,或者在主循环重新检测到寻找道馆场景后再进行这次单次尝试。

给 AI 智能体的提示
在 `tasks/Dokan/script_task.py` 第 97-99 行:

**道馆创建尝试被跳过**

如果任务启动时已经处于道馆界面,但缓存的截图已过时,未显示寻找道馆场景,那么 `get_current_scene(True)` 可能会将缓存帧判定为非寻找场景,因此此条件判断会跳过 `creat_dokan()`。主循环稍后会获取新帧并处理寻找道馆场景,但此时不再尝试创建道馆;用户会发现配置的开场尝试被跳过。

请在判断此条件前刷新截图,或者在主循环重新检测到寻找道馆场景后再进行这次单次尝试。
Original comment in English

🟡 Medium · 道馆创建尝试被跳过

When the task starts already in a Dokan screen while the cached screenshot is stale and does not show the finding scene, get_current_scene(True) can classify a cached frame as a non-finding scene, so this guard skips creat_dokan(). The main loop later captures a fresh frame and handles the finding scene, but no longer attempts creation there; users see the configured opening attempt skipped.

Refresh the screenshot before evaluating this guard, or make the one-shot attempt after the main loop has freshly detected the finding scene.

Prompt for AI agents
In `tasks/Dokan/script_task.py` at lines 97-99:

**道馆创建尝试被跳过**

When the task starts already in a Dokan screen while the cached screenshot is stale and does not show the finding scene, `get_current_scene(True)` can classify a cached frame as a non-finding scene, so this guard skips `creat_dokan()`. The main loop later captures a fresh frame and handles the finding scene, but no longer attempts creation there; users see the configured opening attempt skipped.

Refresh the screenshot before evaluating this guard, or make the one-shot attempt after the main loop has freshly detected the finding scene.

@github-actions

Copy link
Copy Markdown
Contributor

Findings

  • C1 [不确定]
    位置:.github/workflows/shared/review-checklist.md(基准提交 63b0d6d33ed32910e058bc7d7ae9bf25ca2f1340)
    原因:GitHub MCP 只能确认文件存在,读取正文被访问策略拦截,无法核对 C1 的具体要求及本 PR 是否通过。
    修改:恢复该清单文件的可读性后,按 C1 原文重新核验并补充明确结论。
  • C2 [不确定]
    位置:.github/workflows/shared/review-checklist.md(基准提交 63b0d6d33ed32910e058bc7d7ae9bf25ca2f1340)
    原因:无法读取 C2 原文,不能可靠判断 tasks/Dokan/script_task.py:run 的改动是否满足该条规则。
    修改:提供清单正文或修复 GitHub MCP 文件读取权限后重新审查 C2。
  • C3 [不确定]
    位置:.github/workflows/shared/review-checklist.md(基准提交 63b0d6d33ed32910e058bc7d7ae9bf25ca2f1340)
    原因:无法读取 C3 原文,当前 diff 证据不足以完成该条的合规判断。
    修改:恢复清单读取后,依据 C3 要求检查 run 中新增场景识别和开启调用。
  • C4 [不确定]
    位置:.github/workflows/shared/review-checklist.md(基准提交 63b0d6d33ed32910e058bc7d7ae9bf25ca2f1340)
    原因:无法读取 C4 原文,不能确认本次循环位置调整是否满足该条规则。
    修改:恢复清单读取后,按 C4 原文检查循环、状态刷新和重复调用行为。
  • C5 [风险]
    位置:tasks/Dokan/script_task.py:run,新增道馆开启分支
    原因:PR 说明明确未运行自动化测试,且当前检查中 Run 已失败,改动后的场景切换与一次性开启行为尚未得到验证。
    修改:补充覆盖“已在道馆寻找界面”“导航后进入寻找界面”“开启后场景变化”及剩余次数为 0 的测试,并修复失败检查。
  • C6 [不确定]
    位置:.github/workflows/shared/review-checklist.md(基准提交 63b0d6d33ed32910e058bc7d7ae9bf25ca2f1340)
    原因:无法读取 C6 原文,不能可靠判断该 PR 是否满足其要求。
    修改:恢复清单读取后按 C6 原文复核,并在必要时补充对应代码或测试。
  • C7 [不确定]
    位置:.github/workflows/shared/review-checklist.md(基准提交 63b0d6d33ed32910e058bc7d7ae9bf25ca2f1340)
    原因:无法读取 C7 原文,当前仅凭 diff 无法完成该项判断。
    修改:恢复清单读取后按 C7 原文核验配置条件、状态判断和副作用。
  • C8 [不确定]
    位置:.github/workflows/shared/review-checklist.md(基准提交 63b0d6d33ed32910e058bc7d7ae9bf25ca2f1340)
    原因:无法读取 C8 原文,且当前 head 的部分检查仍在运行,无法完成最终状态核验。
    修改:恢复清单读取并等待 CI 完成后,按 C8 原文重新确认。

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 #1976 · codex · gpt56 · 10.2 AIC · ⌖ 2.36 AIC · ⊞ 12.1K · ◷

@runhey
runhey merged commit c6c724a into runhey:dev Oct 28, 2026
7 of 8 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