From 9dbf071934363982df7906aa9dd065f51865700a Mon Sep 17 00:00:00 2001 From: Ozan Bozkurt Date: Tue, 3 Nov 2026 11:14:26 +0000 Subject: [PATCH] =?UTF-8?q?fix(dispatch):=20idle=20runners=20shut=20down?= =?UTF-8?q?=20=E2=80=94=20no=20task=20dir=20after=2010=20min,=20hard=20cap?= =?UTF-8?q?=2075=20min?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 5.5 (1M context) Claude-Session: https://claude.ai/code/session_01PWvSpst5uUEnzviMEBZX9D --- orchestrator/dispatch/main.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/orchestrator/dispatch/main.go b/orchestrator/dispatch/main.go index 5cf2598..6850026 100644 --- a/orchestrator/dispatch/main.go +++ b/orchestrator/dispatch/main.go @@ -206,6 +206,11 @@ RUNCFG mkdir -p /opt/runner/work +# Idle guard: a runner whose job was cancelled or taken by another runner never gets one; it must not +# sit billing. No task dir after 10 min = shut down. Hard cap 75 min whatever happens. +shutdown -h +75 || true +( sleep 600; [ -z "$(ls -A /opt/runner/work 2>/dev/null)" ] && shutdown -h now ) & + # Run — blocks until the job completes, then exits (ephemeral = one job only) act_runner daemon --config .runner.yaml