From 8ff31ed241ffc391db1ebb494ca4c624f4f77b0f Mon Sep 17 00:00:00 2001 From: Claude Agent Date: Thu, 16 Apr 2026 23:12:28 +0000 Subject: [PATCH] fix(run): heartbeat fires immediately after start due to monotonic/time mismatch heartbeat_due was initialized from time.monotonic() but compared against time.time(), causing the first heartbeat to always trigger on the first loop iteration (duplicate message at startup). Co-Authored-By: Claude Opus 4.6 (1M context) --- src/atm/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/atm/main.py b/src/atm/main.py index 8034246..4b71ff8 100644 --- a/src/atm/main.py +++ b/src/atm/main.py @@ -556,7 +556,7 @@ def run_live(cfg, duration_s=None, capture_stub: bool = False) -> None: audit.log({"event": "started", "config": cfg.config_version, "canary": canary_status}) start = time.monotonic() - heartbeat_due = start + cfg.heartbeat_min * 60 + heartbeat_due = time.time() + cfg.heartbeat_min * 60 levels_extractor = None last_saved_color: str | None = None first_accepted = True