PEP-248: задание, которое исполнитель не берёт, — не очередь проверок #235

Merged
peppa-bot merged 14 commits from task/pep-248 into main 2026-11-25 19:05:54 +00:00
Showing only changes of commit d852aed15b - Show all commits

View File

@ -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.