fix: a run started a moment ago is never judged dead — another dashboard's tmux list may predate it

Only the process that starts a pane writes it into its own cached tmux list
(noteSession); a second dashboard on the same database (a dev server) holds
a member list up to 15 s old, so its heal beat ended a Codex pane seconds
after it started and the proxy gateway answered 401. reconcileOrphans and
healRunId skip a run younger than 20 s (dashboard-runs.isYoungRun).
Tests: dashboard-runs (young vs old).
This commit is contained in:
2026-10-12 14:15:22 +07:00
parent 943ba03b76
commit 64173a5428
4 changed files with 47 additions and 4 deletions
+4
View File
@@ -128,6 +128,10 @@ function healRunId(lane, live = null) {
if (require("../lib/linux-accounts").unseenMemberFolder(lane.cwd)) return lane;
if (live) {
if (live.has(lane.run_id)) return lane;
// Started a moment ago: a cached list may not show it yet (dashboard-runs.js).
const dashboardRuns = require("../lib/dashboard-runs");
const row = dashboardRuns.getRun(lane.run_id);
if (row && row.status === "running" && dashboardRuns.isYoungRun(row.started_at)) return lane;
} else {
const run = runs.getRun(lane.run_id);
if (run && run.status === "running") return lane;