From 164df87e989c3588a5d1343dfdd564e427ea0af6 Mon Sep 17 00:00:00 2001 From: mfowler Date: Wed, 24 Jun 2026 15:36:02 +0000 Subject: [PATCH] fix(wake): persistent-agent wakes survive SEQUENCE-COMPLETE MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The watchdog gated ALL scheduled wakes behind `if not seq_done`, so once a phase sequence completed, even a persistent operator-facing supervisor stopped waking. That breaks follow-on supervision (e.g. a second build started after the first sequence finishes). Now: loop-tied wakes (on-demand auditor etc.) still quiet after completion, but persistent agents keep waking — their hourly supervision survives. Co-Authored-By: Claude Opus 4.8 Claude-Session: https://claude.ai/code/session_01UWTdUq2bsic7JZGqJp3nD6 --- agents.py | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/agents.py b/agents.py index cf30829..96006b3 100755 --- a/agents.py +++ b/agents.py @@ -978,12 +978,17 @@ def watchdog_loop(cfg_path): if session_alive(a["session"]): limit_tick(cfg, a, capture_pane(a["session"], 40)) - if not seq_done: - for name, el in list(wake_elapsed.items()): - interval = int(cfg["agents"][name]["wake"].get("interval", 3600)) - if el >= interval: - if wake_agent(cfg, cfg["agents"][name]): - wake_elapsed[name] = 0 + for name, el in list(wake_elapsed.items()): + agent = cfg["agents"][name] + # After the phase sequence completes, quiet the loop-tied wakes (e.g. the on-demand + # auditor) — but a PERSISTENT agent (the operator-facing supervisor) keeps waking, so its + # hourly supervision survives SEQUENCE-COMPLETE and can drive follow-on work (a second build). + if seq_done and agent.get("kind") != "persistent": + continue + interval = int(agent["wake"].get("interval", 3600)) + if el >= interval: + if wake_agent(cfg, agent): + wake_elapsed[name] = 0 # Auto-advance is checked EVERY tick (not just the heavy tick) so a completed phase advances # within signal_interval of its `## DONE` landing, instead of idling up to heavy_interval.