hermes-agent/apps
ethernet a75a8eda72 refactor(desktop): derive working/attention session sets from $sessionStates
$workingSessionIds and $attentionSessionIds were independently maintained
atoms that updateSessionState had to manually keep in sync with the session
cache (paired setSessionWorking/setSessionAttention calls, plus a rotation
special-case in ensureSessionState). Make them computed() projections of
$sessionStates instead, so the data flow is one-directional:
gateway event → cache → $sessionStates → computed views.

Transition side-effects (watchdog arm/disarm, settle grace, unread marker,
compression id rotation signal) move into handleTransition, fired from
publishSessionState by diffing previous vs next — one choke point instead
of per-callsite bookkeeping. The watchdog's force-clear reaches the cache
through setWatchdogClearFn rather than a listener set.

Also:
- clearAllSessionStates disarms all watchdog timers and drops settle-grace
  entries so a gateway switch can't leak stale timers or keep-set rows
- dropSessionState disarms the dropped runtime's watchdog timer
- watchdog tests now exercise the real timer→callback wiring instead of
  manually simulating the clear
2026-07-17 14:33:38 -04:00
..
bootstrap-installer fmt(js): npm run fix on merge (#65229) 2026-07-15 21:40:56 +00:00
desktop refactor(desktop): derive working/attention session sets from $sessionStates 2026-07-17 14:33:38 -04:00
shared fmt(js): npm run fix on merge (#65229) 2026-07-15 21:40:56 +00:00