无进展兜底: 40 分钟没有「开始执行/结束执行」就结束任务(I-18)

Browse Source
按 logs-raw 查清两次 5 小时多的空转, 都是上游循环没有上限、不报错、也不再打里程碑日志:
- 11-21 14:01 起 5h20m: 游戏改版后驱动菜单的镜牢入口 home/mirror_dungeons_assets.png 最高 0.41
  (11-18 之前每轮 1.00), 大厅 <-> 驱动来回点 2500 多轮; 上游 V1.6.2 c0e4926 换的正是这张图
- 11-17 00:45 起 5h40m: 全员阵亡后 Mirror.re_start() 的 while True, 画面 5.5 小时一帧没变

install_progress_watchdog: AALC logger 上挂 handler 记最后一条「开始执行/结束执行」,
任务主线程的 match_template / take_screenshot 里检查, 超时抛 TaskAbort(退出码 4, finally 照常写回配置),
记 [ERROR] 和 decisions progress/stall。LCP_PROGRESS_STALL_MIN 可调, 0 关闭。
20 份原始日志回放: 17 轮正常运行最长空档约 20 分钟、不会误停; 三次卡住都在最后一条之后 40 分钟停下。

单测: 779 passed(新增 test_progress_watchdog 10 例)。

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
yws
2026-11-22 01:53:50 +00:00
co-authored by Claude Opus 5.5
parent 0fd5b66d80
commit 08f86dc932
6 changed files with 266 additions and 7 deletions
+3 -2
View File
@@ -14,8 +14,8 @@ from .aalc_engine import bootstrap
from .aalc_patches import (TaskAbort, WindowGuard, driver_click_tasks, headless_hdr_warning, from .aalc_patches import (TaskAbort, WindowGuard, driver_click_tasks, headless_hdr_warning,
install_back_button_result, install_default_battle_team, install_event_choices, install_back_button_result, install_default_battle_team, install_event_choices,
install_exact_team_match, install_gift_confirm_guard, install_gift_preference, install_exact_team_match, install_gift_confirm_guard, install_gift_preference,
install_image_error_guard, install_key_hold, install_rabbit_hole, install_image_error_guard, install_key_hold, install_progress_watchdog,
install_robust_set_foreground, install_shop_audit, install_shop_by_name, install_rabbit_hole, install_robust_set_foreground, install_shop_audit, install_shop_by_name,
install_system_team_selection, install_team_screen_guard, install_system_team_selection, install_team_screen_guard,
install_theme_pack_audit, install_theme_pack_refresh_click, install_theme_pack_systems, install_theme_pack_audit, install_theme_pack_refresh_click, install_theme_pack_systems,
install_typed_keyboard_road, load_rabbit_hole, mirror_progress, stop_driver_click) install_typed_keyboard_road, load_rabbit_hole, mirror_progress, stop_driver_click)
@@ -146,6 +146,7 @@ def _run(task, params):
decisions.open() # TaskRunner 给的 .decisions.jsonl; 直接运行时不写 decisions.open() # TaskRunner 给的 .decisions.jsonl; 直接运行时不写
install_exact_team_match(auto, log) install_exact_team_match(auto, log)
install_robust_set_foreground(screen, log=log) install_robust_set_foreground(screen, log=log)
install_progress_watchdog(log=log) # 40 分钟没有「开始执行/结束执行」就结束(11-17/11-21 各空转 5 小时多)
if not cfg.simulator: if not cfg.simulator:
install_key_hold(log=log) # 前台按键带扫描码、各模式按住再松开(ISSUES I-05) install_key_hold(log=log) # 前台按键带扫描码、各模式按住再松开(ISSUES I-05)
# 日常本(经验/纽本)不翻队伍列表: 队伍是自定义名字时按名字找必然失败, # 日常本(经验/纽本)不翻队伍列表: 队伍是自定义名字时按名字找必然失败,