Repository navigation
fix(ds): 同名代号取最新活动 / 作业按推图排序 / 暂停真能停 - #182
Merged
Merged
Conversation
本地修复,未 push(用户 2026-12-02 晚口径:「先本地修复一下,别 push」)。
1. 挂完 TR-1 直接跳 DS-3 + 助手说「DS 的前置是 DP-6」
根因同一个:stageplan.stage_index() 用 setdefault 建 {代号: 行},同名代号留下
资源包里的第一条——老活动 act1dp 也有 DS-1 / DS-2(「午间休息!」),于是
flow / chain 全按老活动算:DP-1~DP-6 被当成 DS 的前置,预检排序把 DS-3 排到
最前。现在同名代号取活动开始时间最晚的那条(同 resources.stage_by_code),
并在交给 MAA 前用 scatter.sort_codes() 按推图顺序再兜一层。
2. 按了暂停,作业集还在一直翻 DS-3
MAA 的多作业链会把「这一份被 AsstStop 停掉」当成「这份作业不行」,换下一份
继续点;_wait_run 只看 eng.wait() 会一直陪跑。现在看到 eng.stopped 就补一刀
AsstStop 并立刻按「没跑完」返回,上层不再换作业重挂,finally 的 close()
(AsstDestroy)把任务掐掉。
3. 顺带修掉一个埋着的坑
run_core 自己导航前调 eng.stop(),把 stopped 永久置 True,_retry_failed 以为
「用户按了停止」,翻车后从不换作业(11-22「2 星不换作业」的一半原因)。
新增 Engine.soft_stop():只发 AsstStop、不置 stopped,内部导航 / 换段 /
单关超时一律用它。
提示词:用户说「暂停 / 先停一下」必须真的调 stop_run;DS 没有 DP 前置(别把老
活动同代号关当前置)。
冒烟:新增 B94(同名代号/排序/停止),95 项全绿。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
背景
用户 2026-12-02 晚真机报了三件事,前两件其实是同一个根因:
改动
① 同名代号取最新活动(
backend/core/stageplan.py)stage_index()用setdefault建{代号: 资源行},同名代号留下的是资源包里的第一条。老活动 act1dp 也有DS-1/DS-2(「午间休息!」),于是:chain()/prereq_codes()按老活动的流程序算,把DP-1~DP-6当成 DS 的前置 → 助手照着实说「DS 的前置是 DP-6」;flow_key排序时键全乱,DS-3排到了DS-1前面 → 作业集第一条 TR-1,第二条跳 DS-3。改成同名代号取活动开始时间最晚那条(和
resources.stage_by_code同一口径)。② 交给 MAA 前再兜一层顺序(
backend/core/scatter.py/skills.py)新增
scatter.sort_codes(),handoff 路径按ST → TR → 普通关 → EX → S重排一遍。乱序输入也会排成DS-TR-1, DS-1, DS-2 … DS-8。③ 暂停真的能停(
backend/core/maaplan.py/maacore.py)MAA 的多作业链会把「这一份被 AsstStop 停掉」当成「这份作业不行」,接着加载下一份继续点;
_wait_run只在等eng.wait(),于是陪着它跑。现在_wait_run一看到eng.stopped就补一刀AsstStop并立刻按「没跑完」返回,上层不再换作业重挂,run_core的finally里close()(AsstDestroy)把任务彻底掐掉。顺带修掉一个埋着的坑:
run_core自己导航前调的是eng.stop(),会把stopped永久置 True,_retry_failed看到就以为「用户按了停止」,翻车后从不换作业(11-22「2 星不换作业」的一半原因)。新增Engine.soft_stop():只发AsstStop、不置位,内部导航 / 换段 / 单关超时一律用它,只有用户停才走stop()。④ 提示词(
backend/core/agent.py)stop_run,只回一句「已暂停」等于没停;DP-*当没看见。验证
stopped后立刻收手且soft_stop不置位)。build/MAA-PRTS,前端也是新版)。