Repository navigation
fix(Delegation): 修复误触勾玉立即完成及返回按钮死循环 #1940
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -56,22 +56,44 @@ def ui_click(click, stop): | |
| if not self.ocr_appear(self.O_D_NAME): | ||
| logger.warning(f'Delegation: {name} not found') | ||
| return False | ||
| enter_timer = Timer(15).start() | ||
| while 1: | ||
| self.screenshot() | ||
| if self.appear(self.I_D_START): | ||
| break | ||
| if enter_timer.reached(): | ||
| logger.warning(f'Delegation: {name} enter timeout') | ||
| return False | ||
|
|
||
| # 检测到弹出的勾玉确认框,优先点击取消保护勾玉 | ||
| if self.appear_then_click(self.I_UI_CANCEL, interval=1): | ||
|
Comment on lines
62
to
+69
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🟠 High · 确认弹窗会阻止委派 当确认弹窗遮挡 请在两个循环中,检查开始或返回指示器之前先检查并关闭 另请查看 给 AI 代理的提示在 `tasks/Delegation/script_task.py` 第 62–69 行:
**确认弹窗会阻止委派**
当确认弹窗遮挡 `I_D_BACK`,或其后方仍能检测到 `I_D_START` 时,循环会先检查开始或返回指示器,再检查 `I_UI_CANCEL`,因此可能在未关闭弹窗的情况下退出,后续任务处理也会在被阻挡的屏幕上继续进行。
请在两个循环中,检查开始或返回指示器之前先检查并关闭 `I_UI_CANCEL`。
另请查看 `tasks/Delegation/script_task.py:79-85`。Original comment in English🟠 High · Confirmation modal blocks delegation When a confirmation modal obscures Check and dismiss Also at Prompt for AI agentsIn `tasks/Delegation/script_task.py` at lines 62-69:
**Confirmation modal blocks delegation**
When a confirmation modal obscures `I_D_BACK` or leaves `I_D_START` detectable behind it, the loops test the start or back indicator before `I_UI_CANCEL`, so they exit without dismissing the modal and subsequent task handling continues on a blocked screen.
Check and dismiss `I_UI_CANCEL` before testing the start or back indicators in both loops.
Also at `tasks/Delegation/script_task.py:79-85`. |
||
| continue | ||
|
|
||
| # 如果出现’召回‘ ’返回‘ 说明这个是现在委派中 | ||
| # 需要退出 | ||
| if self.appear(self.I_D_BACK): | ||
| logger.warning(f'Delegation: {name} is in delegation') | ||
| self.ui_click_until_disappear(self.I_D_BACK) | ||
| self.wait_until_appear(self.I_REWARDS_MIN) | ||
| back_timer = Timer(6).start() | ||
| while 1: | ||
| self.screenshot() | ||
| if not self.appear(self.I_D_BACK): | ||
| break | ||
| if back_timer.reached(): | ||
| logger.warning('Exit delegation detail timeout') | ||
| break | ||
| # 若此时被取消弹窗遮挡返回,优先点取消 | ||
| if self.appear_then_click(self.I_UI_CANCEL, interval=1): | ||
| continue | ||
| if self.appear_then_click(self.I_D_BACK, interval=1.2): | ||
| continue | ||
| self.wait_until_appear(self.I_REWARDS_MIN, wait_time=3) | ||
| return False | ||
| if self.appear_then_click(self.I_D_SKIP, interval=0.8): | ||
| continue | ||
| if self.appear_then_click(self.I_D_CONFIRM, interval=0.8): | ||
| continue | ||
| if self.ocr_appear_click(self.O_D_NAME, interval=1): | ||
| # 点击委派任务名:防抖由 1s 提升至 3s,杜绝跨页面过渡时误触右上角"完成(30勾玉)" | ||
| if self.ocr_appear_click(self.O_D_NAME, interval=3): | ||
| continue | ||
| # 进入委派 fefe e fe | ||
| logger.info(f'Enter Delegation: {name}') | ||
|
|
@@ -81,10 +103,14 @@ def ui_click(click, stop): | |
| ui_click(self.C_D_4, self.I_D_SELECT_4) | ||
| # 委派开始 | ||
| logger.info(f'Delegation: {name} start') | ||
| start_timer = Timer(10).start() | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🟡 Medium · 委派可能无限期挂起 如果始终没有出现队伍选择指示器, 请在选择调用开始前启动超时计时器,以限制等待时间。 给 AI 代理的提示在 `tasks/Delegation/script_task.py` 第 106 行:
**委派可能无限期挂起**
如果始终没有出现队伍选择指示器,`ui_click` 就会一直等待该指示器;但 `start_timer` 只有在全部四次选择调用完成后才创建,因此任务会一直卡住。
请在选择调用开始前启动超时计时器,以限制等待时间。Original comment in English🟡 Medium · Delegation can hang indefinitely When a team-selection indicator never appears, Bound the selection waits with a timeout that starts before the selection calls. Prompt for AI agentsIn `tasks/Delegation/script_task.py` at line 106:
**Delegation can hang indefinitely**
When a team-selection indicator never appears, `ui_click` keeps waiting for the selection indicator, but `start_timer` is created only after all four selection calls finish, so the task remains stuck.
Bound the selection waits with a timeout that starts before the selection calls. |
||
| while 1: | ||
| self.screenshot() | ||
| if not self.appear(self.I_D_START): | ||
| break | ||
| if start_timer.reached(): | ||
| logger.warning(f'Delegation: {name} start timeout') | ||
| break | ||
| if self.click(self.C_D_5, interval=0.8): | ||
| continue | ||
| if self.appear_then_click(self.I_D_START, interval=1.8): | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🟡 Medium · 委派超时后仍被报告为成功
进入、返回或开始操作发生超时时,
delegate_one在某些超时情况下会返回False,而只有开始操作超时时才会跳出循环;与此同时,run忽略其结果并调用set_next_run(..., success=True),导致被跳过的任务仍会被安排并报告为成功。所有超时情况都应返回失败,并让
run根据该结果进行处理,而不是安排成功。另请查看
tasks/Delegation/script_task.py:83、tasks/Delegation/script_task.py:111-113。给 AI 代理的提示
Original comment in English
🟡 Medium · Timed-out delegation is reported successful
When an enter, back, or start timeout fires,
delegate_onereturnsFalsefor some timeouts and only breaks on a start timeout, whilerunignores its result and callsset_next_run(..., success=True), so skipped work is scheduled and reported as successful.Return failure for every timeout and make
runhandle that result instead of scheduling success.Also at
tasks/Delegation/script_task.py:83,tasks/Delegation/script_task.py:111-113.Prompt for AI agents