From d852aed15bb72e4bf3c129298b0da900635b9139 Mon Sep 17 00:00:00 2001 From: peppa-bot Date: Wed, 25 Nov 2026 17:39:00 +0000 Subject: [PATCH] =?UTF-8?q?PEP-248:=20=D0=B2=D0=B0=D1=87=D0=B4=D0=BE=D0=B3?= =?UTF-8?q?=20=D0=BF=D0=B5=D1=80=D0=B5=D0=BF=D1=80=D0=BE=D0=B2=D0=B5=D1=80?= =?UTF-8?q?=D1=8F=D0=B5=D1=82=20=D0=BF=D1=80=D0=BE=D0=BF=D0=B0=D0=B2=D1=88?= =?UTF-8?q?=D1=83=D1=8E=20=D1=81=D0=B5=D1=81=D1=81=D0=B8=D1=8E=20tmux=20?= =?UTF-8?q?=D0=BF=D0=B5=D1=80=D0=B5=D0=B4=20=D0=BF=D0=B5=D1=80=D0=B5=D0=B7?= =?UTF-8?q?=D0=B0=D0=BF=D1=83=D1=81=D0=BA=D0=BE=D0=BC=20(=D0=BD=D0=B5?= =?UTF-8?q?=D1=81=D1=82=D0=B0=D0=B1=D0=B8=D0=BB=D1=8C=D0=BD=D1=8B=D0=B9=20?= =?UTF-8?q?cjm=20hang=20=D0=BF=D0=BE=D0=B4=20=D0=BD=D0=B0=D0=B3=D1=80?= =?UTF-8?q?=D1=83=D0=B7=D0=BA=D0=BE=D0=B9=20CI)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 5.5 --- packages/runner/src/watchdog.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/runner/src/watchdog.ts b/packages/runner/src/watchdog.ts index 17699684..cc8e66a4 100644 --- a/packages/runner/src/watchdog.ts +++ b/packages/runner/src/watchdog.ts @@ -243,7 +243,8 @@ async function checkSession(db: Db, s: SessionView, opts: WatchdogOptions, cfg: } const label = `#${s.id} ${s.taskKey ?? ""} (${s.tmuxName})`; - if (!(await tmux.hasSession(tmux.sessionPane(s)))) { + // One failed `has-session` under load is not proof: ask again before restarting the agent. + if (!(await tmux.hasSession(tmux.sessionPane(s))) && !(await new Promise((r) => setTimeout(r, 300)).then(() => tmux.hasSession(tmux.sessionPane(s))))) { log(`${label}: tmux session gone`); await logSessionEvent(db, s, "tmux_gone"); // PEP-244: the container does not depend on tmux — without this it keeps running unattended.