diff --git a/agents.py b/agents.py index 1d52cf0..7f4188a 100755 --- a/agents.py +++ b/agents.py @@ -1148,6 +1148,17 @@ def watchdog_loop(cfg_path): if session_alive(a["session"]): limit_tick(cfg, a, capture_pane(a["session"], 40)) + # ...and ADD one that appeared. wake_elapsed was built once at startup, and only ever + # shrank (below) — so a `wake` written into agents.toml while the watchdog is running was + # invisible to it, silently and forever. Both flat-file agents were given 30-min wakes on + # 2026-08-16 against a watchdog up since 2026-08-01: zero wakes fired in the 2 days since, + # and with watch="heal" (no stall-reboot) each finished turn parked them until a human + # looked. Seed a new wake with a full interval so it fires on its own schedule, not at once. + for _n, _a in cfg["agents"].items(): + if _a.get("wake") and _n not in wake_elapsed: + wake_elapsed[_n] = 0 + log(f"wake registered mid-run for {_n} (interval={_a['wake'].get('interval', 3600)}s)") + for name, el in list(wake_elapsed.items()): agent = cfg["agents"].get(name) # Config is re-read every tick, but wake_elapsed was built once at startup. If an agent's