mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-07-01 12:02:05 +00:00
Audit follow-up. ChatBar subscribed to the whole `$statusItemsBySession` (a computed that rebuilds the entire map) + `$previewStatusBySession` maps just to derive a boolean, so every per-item status mutation (a subagent tick, the 5s background poll) and every OTHER session's change re-rendered the ~1.4k component. The queue hook likewise subscribed to the whole `$queuedPromptsBySession` map. - Add `useSessionStatusPresence` — a coarse edge (useSyncExternalStore) that flips only when the stack shows/hides; ChatBar uses it for the styling data-attr instead of the two map subscriptions. - Add generic `useSessionSlice(store, key)` — subscribes to one session's array, bailing out when other sessions churn (the plain atom keeps per-key refs stable). The queue hook now reads its slice through it. Result: ChatBar re-renders only when the stack's presence flips or this session's queue changes — not on background/subagent status streaming or other sessions. Verified: typecheck clean, 0 lint errors, composer tests 39/40 (pre-existing attachments failure unrelated). |
||
|---|---|---|
| .. | ||
| bootstrap-installer | ||
| desktop | ||
| shared | ||