hermes-agent/apps/desktop/src/lib
brooklyn! 3139a30e52
perf(desktop): multi-tile grids stop lagging — evict leaked session states, index lineage aliases, split the turn journal (#83133)
* fix(desktop): evict settled session states nothing on screen references

Closing a tile never removed its runtime's entry from $sessionStates, so
every tile ever closed parked its full transcript in the map for the life
of the process. Each leftover entry taxes every subsequent stream flush —
the map is spread-copied per delta and the busy/attention/draft projections
walk every entry per publish — so the app got slower the longer it ran,
which users read as "I need to clean my sessions/dbs".

Publish now evicts a settling state when no tile and not the primary view
holds its runtime (transition side effects still fire, so the settle keeps
its unread dot), and closing a tile drops an already-settled state on the
spot. Busy and needs-input states stay: background turns feed the sidebar
dots, and a first publish always lands because a resume can publish a beat
before the surface binds the runtime.

16 tiles streaming in a 2x2 grid with a day's worth of closed-tile residue:
worst-second 34 -> 58 fps, p99 frame 90 -> 28 ms, longtasks 37 -> 0.

* perf(desktop): index lineage aliases per sessions-list reference

lineageAliases scanned the whole recents list per call, and it is called
per cached session state per status projection per message delta — with a
populated sessions DB and a few busy sessions that multiplied out to
millions of row checks a second during streaming. Build the alias index
once per list reference (the list is replaced wholesale, never mutated)
and look aliases up in O(1).

* perf(desktop): journal each in-flight turn under its own storage key

The v1 journal kept every session's tail in one localStorage key, so each
throttled write re-parsed and re-stringified EVERY busy session's snapshot
— a grid of concurrent streams turned that into a whole-store JSON round
trip dozens of times a second, all on the main thread. Per-session keys
make a write O(own tail) no matter how many other sessions are streaming.
A v1 store migrates on first touch; expired/overflow crash residue is
pruned once per renderer.

* perf(desktop): stress the multitab scenario across grid/streaming/DB axes

The one-stack multitab run hid every cost this round of fixes removed: it
drove hook.publish (store only — no journal, no wiring cache), with an
empty recents list and no closed-tile residue. Streaming now routes through
hook.update (the real gateway write path), and the scenario grows axes for
the workloads users actually hit: --zones splits tiles across visible grid
zones, --streaming caps how many sessions are mid-turn (zone leaders
first), --sessions seeds a lived-in recents list, --dead models settled
sessions no surface references. launch.mjs pins HERMES_DESKTOP_CDP_PORT so
a non-default --port survives the app's own dev-CDP flag.
2026-08-10 10:45:43 +00:00
..
keybinds fix(desktop): list HUD snap chord in keyboard shortcuts panel 2026-08-10 05:21:07 -05:00
ansi.test.ts
…
ansi.ts
…
artifact-detect.test.ts feat(desktop): artifacts — versioned cards, sandboxed live preview, right-rail viewer 2026-07-26 19:29:25 -07:00
artifact-detect.ts feat(desktop): artifacts — versioned cards, sandboxed live preview, right-rail viewer 2026-07-26 19:29:25 -07:00
brand-icon.test.ts feat(desktop): resolve a hostname to its Simple Icons brand mark 2026-07-27 21:23:46 -05:00
brand-icon.ts fmt(js): `npm run fix` on merge (#73096) 2026-07-28 03:43:07 +00:00
chat-messages.test.ts fmt(js): `npm run fix` on merge (#82962) 2026-08-10 05:40:43 +00:00
chat-messages.ts fix(gateway): keep the personality pivot out of the truncate ordinal space (#82756) 2026-08-10 11:01:15 +05:30
chat-runtime.test.ts fix(desktop): stop message age falling back to the 1970 epoch ("20663d ago") 2026-07-28 20:33:25 -05:00
chat-runtime.ts fix(personality): single-owner personality state + one-time reset migration 2026-08-09 10:33:58 -07:00
clipboard.ts
…
commit-changelog.test.ts
…
commit-changelog.ts
…
completion-sound.ts refactor(desktop): tidy the cross-window deduper 2026-07-20 18:36:05 -05:00
composer-input-sanitize.test.ts
…
composer-input-sanitize.ts
…
desktop-fs.test.ts style(desktop): satisfy merged eslint/prettier config 2026-07-20 23:01:49 +02:00
desktop-fs.ts fix(desktop): render remote PDFs in preview rail 2026-08-05 10:26:48 -06:00
desktop-git.test.ts fix(desktop): salvage /compress cluster — session.compress RPC + dedicated RPC routing (#68229) 2026-07-22 16:40:06 -04:00
desktop-git.ts feat(desktop): resolve a session's pull request 2026-08-09 06:21:04 -05:00
desktop-remote-auth.test.ts fmt(js): `npm run fix` on merge (#70914) 2026-07-24 18:14:17 +00:00
desktop-remote-auth.ts feat(desktop): add "Connect to existing Hermes" option to first-run onboarding 2026-07-24 12:55:06 -05:00
desktop-slash-commands.test.ts fix(wake): route desktop control and select input devices 2026-07-29 14:04:21 -06:00
desktop-slash-commands.ts fix(wake): route desktop control and select input devices 2026-07-29 14:04:21 -06:00
desktop-toolsets.test.ts
…
desktop-toolsets.ts
…
display-path.test.ts feat(desktop): shared path display collapses home to ~ 2026-08-01 02:32:28 -05:00
display-path.ts feat(desktop): shared path display collapses home to ~ 2026-08-01 02:32:28 -05:00
download-text.ts feat(desktop): artifacts — versioned cards, sandboxed live preview, right-rail viewer 2026-07-26 19:29:25 -07:00
draft-title.ts fmt(js): `npm run fix` on merge (#82417) 2026-08-09 09:51:41 +00:00
drag-ghost.ts
…
embedded-images.test.ts refactor(desktop): hoist the reference-line matcher; drop dead textWithoutImageRefs 2026-08-03 18:37:31 +05:30
embedded-images.ts refactor(desktop): hoist the reference-line matcher; drop dead textWithoutImageRefs 2026-08-03 18:37:31 +05:30
escape-layers.test.ts
…
escape-layers.ts
…
excluded-paths.ts
…
external-link.test.tsx feat(desktop): show brand icons on links to known domains 2026-07-27 21:23:46 -05:00
external-link.tsx refactor(desktop): one `.ref` class, and the theme owns every accent 2026-07-30 04:52:06 -05:00
find-in-page.ts feat(desktop): complete find-in-page with the find-next/find-previous accelerators 2026-07-26 17:48:05 -07:00
format.ts
…
gateway-events.test.ts fix(desktop, ink): don't wipe messages before final message (#65919) 2026-07-20 11:42:29 -04:00
gateway-events.ts fix(desktop, ink): don't wipe messages before final message (#65919) 2026-07-20 11:42:29 -04:00
gateway-rpc.test.ts
…
gateway-rpc.ts fix(desktop): keep a mid-turn model pick painted in the composer (#74759) 2026-07-30 10:34:48 +00:00
gateway-ws-url.test.ts fix(desktop): avoid false remote gateway reauthentication (#68250) 2026-07-20 20:54:36 -04:00
generated-images.test.ts
…
generated-images.ts
…
guest-pointer-guard.ts fix(desktop): don't let webview guests swallow drag gestures 2026-08-10 04:52:19 -05:00
haptics.ts
…
icons.ts feat(desktop): two-way reaction UI — tapback pill, frimousse picker, live paint 2026-07-30 00:08:28 -05:00
incremental-external-store-runtime.test.ts perf(desktop): reconcile only the messages that actually moved 2026-07-26 02:56:08 -05:00
incremental-external-store-runtime.ts perf(desktop): stop idle chat re-renders — memo ChatView, stable tile props, gated adapter re-sync 2026-08-03 18:17:24 +05:30
inflight-turn-journal.test.ts perf(desktop): multi-tile grids stop lagging — evict leaked session states, index lineage aliases, split the turn journal (#83133) 2026-08-10 10:45:43 +00:00
inflight-turn-journal.ts perf(desktop): multi-tile grids stop lagging — evict leaked session states, index lineage aliases, split the turn journal (#83133) 2026-08-10 10:45:43 +00:00
input-modality.test.ts fix(desktop): stop the model-pill tooltip popping open after a mouse pick 2026-07-28 02:27:11 -05:00
input-modality.ts fix(desktop): stop the model-pill tooltip popping open after a mouse pick 2026-07-28 02:27:11 -05:00
json-format.test.ts
…
json-format.ts
…
json-rpc-gateway-url-guard.test.ts fmt(js): `npm run fix` on merge (#69562) 2026-07-22 19:01:09 +00:00
katex-memo.ts
…
loadout.ts
…
local-preview.test.ts fix(desktop): render remote PDFs in preview rail 2026-08-05 10:26:48 -06:00
local-preview.ts fix(desktop): render remote PDFs in preview rail 2026-08-05 10:26:48 -06:00
markdown-blocks.test.ts test(desktop): raise timeout on markdown-blocks property fuzz 2026-07-18 18:53:41 -04:00
markdown-blocks.ts perf(desktop): cache short markdown parses too 2026-07-26 17:02:59 -05:00
markdown-code.test.ts
…
markdown-code.ts
…
markdown-preprocess.ts feat(desktop): render agent-written @session links as chips 2026-07-24 22:52:45 -05:00
mcp-dashboard-oauth.test.ts fmt(js): `npm run fix` on merge (#66348) 2026-07-17 14:30:29 +00:00
mcp-dashboard-oauth.ts fmt(js): `npm run fix` on merge (#66348) 2026-07-17 14:30:29 +00:00
mcp-tool-filter.test.ts
…
mcp-tool-filter.ts
…
media.remote.test.ts fix(desktop): stream remote media through gateway 2026-07-28 11:58:03 -07:00
media.ts fix(desktop): stream remote media through gateway 2026-07-28 11:58:03 -07:00
middle-click.test.tsx fix(desktop): middle-click works on a real three-button mouse 2026-07-30 21:43:14 -05:00
middle-click.ts feat(desktop): ⌘-click closes a terminal rail tab 2026-08-01 02:15:02 -05:00
model-options.test.ts fix(desktop): scope model options by profile (#62795) 2026-07-22 09:40:50 -04:00
model-options.ts fix(desktop): scope model options by profile (#62795) 2026-07-22 09:40:50 -04:00
model-search-text.ts fmt(js): `npm run fix` on merge (#72522) 2026-07-27 07:00:22 +00:00
model-status-label.test.ts Merge pull request #71601 from helix4u/fix/desktop-model-picker-authority 2026-07-25 21:20:54 -05:00
model-status-label.ts Merge pull request #71601 from helix4u/fix/desktop-model-picker-authority 2026-07-25 21:20:54 -05:00
mutable-ref.ts
…
oneshot.ts
…
path-compare.test.ts refactor(desktop): one path-comparison helper instead of two 2026-08-08 14:50:43 -05:00
path-compare.ts refactor(desktop): one path-comparison helper instead of two 2026-08-08 14:50:43 -05:00
persisted.ts
…
personalities.ts fix(personality): single-owner personality state + one-time reset migration 2026-08-09 10:33:58 -07:00
pool.test.ts
…
pool.ts
…
preview-targets.test.ts
…
preview-targets.ts
…
profile-color.ts
…
project-idea-templates.ts
…
provider-setup-errors.test.ts fix(desktop): stop spurious provider onboarding from credential warnings 2026-07-23 00:18:21 -05:00
provider-setup-errors.ts fix(desktop): stop spurious provider onboarding from credential warnings 2026-07-23 00:18:21 -05:00
query-client.test.ts perf(desktop): scope tool-diff subscriptions + narrow profile query invalidation 2026-07-18 19:15:57 -04:00
query-client.ts perf(desktop): scope tool-diff subscriptions + narrow profile query invalidation 2026-07-18 19:15:57 -04:00
raf-coalesce.ts refactor(desktop): extract shared rafCoalesce helper for sash drags 2026-07-19 22:38:57 -05:00
reasoning-blocks.test.ts fix(desktop): render already-glued reasoning as separate blocks 2026-08-06 22:02:46 -05:00
reasoning-blocks.ts fix(desktop): render already-glued reasoning as separate blocks 2026-08-06 22:02:46 -05:00
reasoning-effort.test.ts refactor(desktop): give reasoning effort one owner 2026-07-25 20:51:18 -05:00
reasoning-effort.ts refactor(desktop): give reasoning effort one owner 2026-07-25 20:51:18 -05:00
reconnect-backoff.test.ts fix(desktop): full-jitter backoff on gateway WS reconnect loops 2026-08-03 18:10:30 +05:30
reconnect-backoff.ts fix(desktop): full-jitter backoff on gateway WS reconnect loops 2026-08-03 18:10:30 +05:30
remote-url.test.ts fix(desktop): accept scheme-less host:port in the remote gateway URL field 2026-07-31 22:28:43 -07:00
remote-url.ts fix(desktop): accept scheme-less host:port in the remote gateway URL field 2026-07-31 22:28:43 -07:00
render-weight.test.ts fmt(js): `npm run fix` on merge (#80725) 2026-08-07 02:42:42 +00:00
render-weight.ts feat(desktop): price a turn by what it paints 2026-08-06 21:20:41 -05:00
renderer-loop-pause.ts fix(desktop): suspend decorative work when inactive 2026-07-26 21:05:55 -05:00
reorder.ts
…
runtime-readiness.test.ts
…
runtime-readiness.ts
…
sanitize.test.ts
…
sanitize.ts
…
selectable-card.ts
…
session-branch-tree.test.ts fix(desktop): keep pinned sidebar rows in user order 2026-07-27 01:38:21 -05:00
session-branch-tree.ts fmt(js): `npm run fix` on merge (#72522) 2026-07-27 07:00:22 +00:00
session-date-groups.test.ts feat(desktop): date dividers in the sessions sidebar 2026-07-24 10:45:34 -05:00
session-date-groups.ts feat(desktop): sidebar filter menu 2026-08-09 06:21:15 -05:00
session-export.ts fix(sessions): prevent oversized transcripts from exhausting memory 2026-08-08 13:36:08 +05:30
session-ids.test.ts
…
session-ids.ts
…
session-link-title.test.ts fmt(js): `npm run fix` on merge (#71532) 2026-07-25 19:11:39 +00:00
session-link-title.ts feat(desktop): render agent-written @session links as chips 2026-07-24 22:52:45 -05:00
session-refs.test.ts feat(session-search): give the agent a link to hand back 2026-07-24 23:30:25 -05:00
session-refs.ts feat(session-search): give the agent a link to hand back 2026-07-24 23:30:25 -05:00
session-search.test.ts
…
session-search.ts
…
session-signatures.test.ts
…
session-signatures.ts
…
session-source.test.ts fmt(js): `npm run fix` on merge (#73770) 2026-07-29 01:49:23 +00:00
session-source.ts fix(sessions): keep kanban worker runs out of the session lists 2026-07-31 13:53:04 -05:00
slash-completion-cache.ts perf(desktop): cache @ path completions like / completions already are 2026-07-30 04:52:06 -05:00
speech-text.test.ts fmt(js): `npm run fix` on merge (#73666) 2026-07-28 21:55:38 +00:00
speech-text.ts fix(desktop): skip markdown tables in speech output 2026-07-28 11:58:03 -07:00
stable-array.ts refactor(desktop): give the status dot one source of truth and a quieter look 2026-08-08 16:26:48 -05:00
statusbar.tsx fix(desktop): prevent timers from shifting as they count (#68131) 2026-07-20 16:39:20 +00:00
storage.test.ts
…
storage.ts
…
summarize-command.test.ts
…
summarize-command.ts
…
svg-image.ts
…
text.ts
…
thinking-sound.test.ts feat(voice): calm ambient "thinking" sound while the agent works in voice chat 2026-07-29 08:24:00 -07:00
thinking-sound.ts feat(voice): calm ambient "thinking" sound while the agent works in voice chat 2026-07-29 08:24:00 -07:00
time.test.ts fmt(js): `npm run fix` on merge (#82000) 2026-08-08 20:29:52 +00:00
time.ts fmt(js): `npm run fix` on merge (#70845) 2026-07-24 16:36:59 +00:00
todos.test.ts
…
todos.ts
…
tool-render-class.ts refactor(desktop): share how a tool row renders 2026-08-06 21:19:44 -05:00
tool-result-summary.test.ts
…
tool-result-summary.ts
…
tool-run-continuity.test.ts feat(desktop): summarize a run of tool calls as one line 2026-07-27 18:10:26 -05:00
trackpad-gestures.ts
…
update-copy.test.ts
…
update-copy.ts
…
use-enter-animation.test.tsx fix(desktop): stop the enter animation pinning opacity over the stylesheet 2026-07-27 19:54:47 -05:00
use-enter-animation.ts fix(desktop): stop the enter animation pinning opacity over the stylesheet 2026-07-27 19:54:47 -05:00
use-session-slice.ts perf(desktop): stop the statusbar re-rendering per streaming token 2026-07-26 14:21:34 -05:00
utils.ts
…
version-status.test.ts refactor(desktop): resolve version/update labels in one place 2026-07-29 00:24:38 -05:00
version-status.ts refactor(desktop): resolve version/update labels in one place 2026-07-29 00:24:38 -05:00
voice-barge-in.ts fix(desktop): full-duplex voice barge-in — interrupt during generation AND playback 2026-07-29 12:52:42 -07:00
voice-playback.ts fmt(js): `npm run fix` on merge (#73770) 2026-07-29 01:49:23 +00:00
voice-stop-word.test.ts fix(voice): bare stop phrase ends the voice chat on every surface, spoken or typed 2026-07-29 00:01:06 -07:00
voice-stop-word.ts fix(voice): bare stop phrase ends the voice chat on every surface, spoken or typed 2026-07-29 00:01:06 -07:00
wake-client-capture.ts fmt(js): `npm run fix` on merge (#79521) 2026-08-05 16:51:56 +00:00
wake-indicator.test.ts feat(desktop): add notch wake indicator 2026-08-01 14:30:11 -07:00
wake-indicator.ts feat(desktop): add notch wake indicator 2026-08-01 14:30:11 -07:00
wake-sound.test.ts fmt(js): `npm run fix` on merge (#73770) 2026-07-29 01:49:23 +00:00
wake-sound.ts feat(desktop): play an activation chime when the wake word fires 2026-07-28 09:35:06 -07:00
yolo-session.ts feat(desktop): put YOLO in ⌘K and show each toggle's live state 2026-07-30 02:41:34 -05:00