fix: detect crashed threads even when .running marker is already gone

Check worker PID liveness as final fallback — if worker is dead
and thread has no __end__ node, it crashed.

小橘 <xiaoju@shazhou.work>
This commit is contained in:
2026-05-09 12:52:39 +00:00
parent 08a79b77db
commit bf2f790e6e
+10
View File
@@ -230,6 +230,16 @@ export async function resolveThreadListStatus(
}
return "running";
}
// No .running marker + no __end__ + source "active" → check if worker is dead (crashed)
const ctlResult = await readWorkerCtl(storageRoot, row.hash);
if (ctlResult.ok) {
try {
process.kill(ctlResult.value.pid, 0);
} catch {
// Worker PID is dead, thread never finished — crashed
return "failed";
}
}
return "active";
}