mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-07-21 16:18:55 +00:00
$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 |
||
|---|---|---|
| .. | ||
| bootstrap-installer | ||
| desktop | ||
| shared | ||