From ab1985b6b38de92eca78e27375d35907a67f749c Mon Sep 17 00:00:00 2001 From: saphid <4596216+saphid@users.noreply.github.com> Date: Tue, 29 Sep 2026 11:12:41 +1000 Subject: [PATCH] Comfort: a state missing 'started' can't crash status (timestamps of 0 still count) Co-Authored-By: Claude Opus 5.5 (1M context) --- ui/frame_comfort.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ui/frame_comfort.py b/ui/frame_comfort.py index 4f636e6..cb2002e 100644 --- a/ui/frame_comfort.py +++ b/ui/frame_comfort.py @@ -183,7 +183,8 @@ def current(s, now): out = dict(s) out['time'] = time.time() # event age uses the Frame's clock, not the phone's out['remaining'] = max(0, max(s.get('deadline', now), (s.get('warned') or 0) + 60) - now) if s.get('active') else 0 - if s.get('active') and now - (s.get('heartbeat') or s.get('started') or now) > 90: + beat = s.get('heartbeat', s.get('started', now)) # a hand-edited state may lack either + if s.get('active') and now - beat > 90: out['error'] = 'Session worker is not responding. Timer enforcement is unverified; cancel and start again.' return out