Files
hermes-agent/apps
Finn763 e245e40f73 fix(desktop): warm session switch pegs renderer main thread (#95595)
Switching to an already-open session remounted the incoming transcript and
re-tokenized every fenced code block from scratch on the main thread (N blocks
x full shiki tokenization per switch, 96-100% CPU for seconds).

- shiki-block: content-keyed LRU cache of highlighted HTML (theme scope +
  language + code); remounts of unchanged blocks paint cached markup with
  zero highlighter calls; misses debounced, failures degrade to plain text
- use-session-actions: warm resume keeps the session-slice array when the
  reconciled content is equivalent (same guard as the cold path), so the
  runtime repository and every row keep identity
- transcript-window: per-session sticky window memos; a warm re-visit with an
  unchanged transcript reuses the windowed slice by reference (no re-index,
  no repository rebuild); sticky cut survives switches for sessions that grew
- perf regression guards: remount must not re-tokenize (codeToHtml called
  once per unique block), windowed slice reference preserved across switches,
  messageComponents identity stable across session switches
2026-09-03 12:19:11 +05:30
..