fix(web): keep unattended planner state auditable
Some checks failed
M6 deployable RC / quick (push) Has been cancelled
M6 deployable RC / chromium (push) Has been cancelled
M6 deployable RC / release (push) Has been cancelled

This commit is contained in:
mes123456
2026-09-03 22:39:08 +08:00
parent 9ad74fdd4a
commit e00972b309
3 changed files with 21 additions and 2 deletions

View File

@@ -90,7 +90,17 @@ const collect = () => {
const supervisorLock = lockInfo(supervisorLockPath);
const handoff = latestHandoff();
const active = schedulerLock.alive || (guardianLock.alive && supervisorLock.alive);
const blocked = scheduler?.state === "blocked" || guardian?.state === "blocked" || supervisor?.state === "blocked";
let terminalQueue = false;
try {
const manifest = queue.task ? readJson(`tests/golden/${queue.task}/manifest.json`) : null;
const index = readJson("tests/golden/WBV2/task-index.json");
terminalQueue = !active && index?.activeTask === null && manifest?.status === "done" && manifest?.nextTask === null;
} catch { /* A malformed pointer remains visible as a normal checkpoint failure. */ }
const checkpointBlocked = scheduler?.state === "blocked" || guardian?.state === "blocked" || supervisor?.state === "blocked";
// A terminal task can leave a historical blocked checkpoint behind (for
// example, after a push retry). The watchdog owns the next planner attempt;
// do not report that stale checkpoint as a live execution block.
const blocked = checkpointBlocked && !terminalQueue;
const state = blocked ? "BLOCKED" : active ? "RUNNING" : "IDLE";
const phase = blocked ? "blocked" : scheduler?.state === "running" ? "scheduler-task" : supervisor?.state === "running" ? "task-or-gate" : scheduler?.state ?? supervisor?.state ?? "unknown";
const observed = new Date().toISOString();