Comfort: a state missing 'started' can't crash status (timestamps of 0 still count)

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
saphidandClaude Opus 5.5 committed 2026-09-29 11:12:41 +10:00
1 parent 1203ec0a9e
commit ab1985b6b3
1 file changed
+2 -1
+2 -1
View File
@@ -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