perf(tui): stabilize long-session scrolling - #15926
Conversation
There was a problem hiding this comment.
Pull request overview
This PR improves long-session UX in the TUI by stabilizing transcript scrolling behavior under burst scroll, reducing composer rewrap jitter, centralizing viewport/input metrics helpers with tests, persisting /model selections across restarts, and adding /details slash completion support in the gateway.
Changes:
- Add ScrollBox clamp bounds support and hook it into virtual history to prevent scroll bursts from outrunning mounted rows.
- Centralize viewport snapshot + input layout metrics utilities, refactor consumers, and add unit tests.
- Persist
/modelswitches by default (via--global) and add/detailscompletions incomplete.slash(plus tests).
Reviewed changes
Copilot reviewed 13 out of 14 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| ui-tui/src/types/hermes-ink.d.ts | Extends ScrollBoxHandle typing with setClampBounds. |
| ui-tui/src/lib/viewportStore.ts | Adds shared viewport snapshot + useViewportSnapshot hook for consistent scroll-derived UI. |
| ui-tui/src/lib/inputMetrics.ts | Adds shared cursor wrap parity + composer sizing helpers. |
| ui-tui/src/hooks/useVirtualHistory.ts | Sets ScrollBox clamp bounds based on mounted virtual range to stabilize burst scrolling. |
| ui-tui/src/components/textInput.tsx | Refactors to import shared cursorLayout helper. |
| ui-tui/src/components/appLayout.tsx | Uses shared input metrics to reserve stable composer width/height. |
| ui-tui/src/components/appChrome.tsx | Switches sticky prompt + scrollbar math to useViewportSnapshot. |
| ui-tui/src/app/useMainApp.ts | Uses viewport snapshot helper; makes model picker selection persist via --global. |
| ui-tui/src/app/slash/commands/session.ts | Appends --global to /model by default (without duplicating it). |
| ui-tui/src/tests/viewportStore.test.ts | Adds tests for viewport snapshot normalization/keying. |
| ui-tui/src/tests/textInputWrap.test.ts | Moves cursor layout tests to new helpers; adds input metrics tests. |
| ui-tui/src/tests/createSlashHandler.test.ts | Adds tests asserting /model persistence behavior. |
| tui_gateway/server.py | Adds /details to slash completions and implements /details argument completions. |
| tests/test_tui_gateway_server.py | Adds gateway completion tests for /details. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
This PR aims to improve TUI “long session” interaction smoothness by stabilizing scrolling/virtualization bounds, reducing composer reflow/jitter during input, and throttling streaming UI updates based on user interaction state. It also extends slash completion and persists /model selections by default.
Changes:
- Add viewport/input-metric helpers and refactor scroll/viewport consumers to use them (with new tests).
- Improve virtual transcript burst-scroll stability via ScrollBox clamp bounds and selection-aware scrolling helper.
- Reduce composer/render churn while typing via coalesced parent updates, optional fast terminal echo, and interaction-mode-based streaming throttling; plus
/detailscompletion + default global/model.
Reviewed changes
Copilot reviewed 25 out of 26 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| ui-tui/src/types/hermes-ink.d.ts | Extends ScrollBoxHandle typing with clamp bounds setter. |
| ui-tui/src/lib/viewportStore.ts | Adds shared viewport snapshot + hook for scroll-driven UI. |
| ui-tui/src/lib/inputMetrics.ts | Centralizes cursor wrap parity + composer width/height helpers. |
| ui-tui/src/hooks/useVirtualHistory.ts | Adds virtual clamp logic to prevent burst scrolling past mounted rows. |
| ui-tui/src/config/timing.ts | Introduces interaction-aware streaming/idle timing constants. |
| ui-tui/src/config/limits.ts | Adjusts wheel scroll step size. |
| ui-tui/src/components/textInput.tsx | Adds fast-echo/coalesced updates and native-cursor behavior. |
| ui-tui/src/components/appLayout.tsx | Reserves stable composer width and sets height from visual wrap. |
| ui-tui/src/components/appChrome.tsx | Refactors sticky prompt + scrollbar to use viewport snapshot hook. |
| ui-tui/src/app/useSubmission.ts | Marks typing, boosts streaming throttle during busy, queues “session busy” submissions. |
| ui-tui/src/app/useMainApp.ts | Uses shared viewport snapshot; factors scroll-with-selection into helper; persists model picks globally. |
| ui-tui/src/app/turnController.ts | Adds interaction-mode-based streaming batching and adjustable delay. |
| ui-tui/src/app/slash/commands/session.ts | Makes /model persist globally by default (avoids dup --global). |
| ui-tui/src/app/scroll.ts | New helper for clamped scrolling that preserves selection snapshots. |
| ui-tui/src/app/interfaces.ts | Expands SelectionApi surface needed by scroll helper. |
| ui-tui/src/app/interactionMode.ts | Adds global interaction mode tracking (typing/scrolling/idle). |
| ui-tui/src/tests/virtualHistoryClamp.test.ts | Tests clamp enable/disable conditions. |
| ui-tui/src/tests/viewportStore.test.ts | Tests viewport snapshot math and keying. |
| ui-tui/src/tests/textInputWrap.test.ts | Moves cursorLayout tests to helpers; adds input metric tests. |
| ui-tui/src/tests/scroll.test.ts | Tests selection-aware scroll clamping behavior. |
| ui-tui/src/tests/interactionMode.test.ts | Tests interaction mode timing/priority. |
| ui-tui/src/tests/createSlashHandler.test.ts | Tests default /model --global persistence behavior. |
| ui-tui/packages/hermes-ink/src/ink/components/ScrollBox.tsx | Refactors scrollBy implementation and supports clamp bounds on element. |
| ui-tui/packages/hermes-ink/src/ink/components/App.tsx | Keeps native cursor visible; adjusts click-disable logic ordering. |
| tui_gateway/server.py | Adds /details command + argument completion in gateway slash completion. |
| tests/test_tui_gateway_server.py | Adds pytest coverage for /details slash completions. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
This PR focuses on improving TUI stability and perceived performance during long sessions by tightening scroll virtualization/clamping, reducing composer reflow/jitter, and throttling streaming updates while the user is actively typing.
Changes:
- Add viewport/input-metrics helpers (snapshot + cursor/wrap metrics) and refactor consumers to use them, with new unit tests.
- Improve scroll behavior: virtual-history clamp bounds integration and selection-aware scrolling extracted into a shared helper.
- Reduce typing/render overhead: coalesce parent input updates, add safe terminal “fast echo” paths, and adjust streaming batching while typing; plus persist
/modelselections by default and add/detailsslash completions.
Reviewed changes
Copilot reviewed 28 out of 29 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| ui-tui/src/types/hermes-ink.d.ts | Extends ScrollBoxHandle typing with setClampBounds. |
| ui-tui/src/lib/viewportStore.ts | Introduces viewport snapshot + subscription hook for scroll consumers. |
| ui-tui/src/lib/inputMetrics.ts | Centralizes cursor layout/wrap metrics and stable composer column calculation. |
| ui-tui/src/hooks/useVirtualHistory.ts | Hooks virtual-history range into ScrollBox clamp bounds to prevent spacer-only frames on burst scroll. |
| ui-tui/src/config/timing.ts | Adds new timing constants for streaming cadence and typing/scrolling idle thresholds. |
| ui-tui/src/config/limits.ts | Adjusts wheel scroll step. |
| ui-tui/src/components/textInput.tsx | Adds fast-echo + coalesced parent updates, native cursor usage, and cached width logic. |
| ui-tui/src/components/appLayout.tsx | Reserves stable composer width/gutter and uses new input metric helpers. |
| ui-tui/src/components/appChrome.tsx | Refactors sticky prompt + scrollbar computations to use useViewportSnapshot. |
| ui-tui/src/app/useSubmission.ts | Damps streaming while typing; queues “session busy” submits instead of surfacing errors. |
| ui-tui/src/app/useMainApp.ts | Uses shared selection-aware scrolling helper; persists model picker changes via --global; removes progress freezing. |
| ui-tui/src/app/turnController.ts | Makes streaming batch delay adjustable (idle vs typing). |
| ui-tui/src/app/slash/commands/session.ts | Ensures /model changes persist by default by appending --global. |
| ui-tui/src/app/scroll.ts | New shared scrollWithSelectionBy helper with clamped deltas. |
| ui-tui/src/app/interfaces.ts | Expands SelectionApi to support selection-aware scroll shifting/capture. |
| ui-tui/src/app/interactionMode.ts | Adds shared idle/typing/scrolling mode tracking with timers. |
| ui-tui/src/app/createGatewayEventHandler.ts | Streams legacy thinking.delta into reasoning state updates. |
| ui-tui/src/tests/virtualHistoryClamp.test.ts | Tests clamp gating logic for sticky vs manual scroll. |
| ui-tui/src/tests/viewportStore.test.ts | Tests viewport snapshot math + keying includes pending delta. |
| ui-tui/src/tests/textInputWrap.test.ts | Moves wrap parity tests to new helpers; adds tests for composer metrics. |
| ui-tui/src/tests/scroll.test.ts | Tests selection-aware scrolling clamping behavior. |
| ui-tui/src/tests/interactionMode.test.ts | Tests idle timeout and typing priority behavior. |
| ui-tui/src/tests/createSlashHandler.test.ts | Tests default /model --global behavior and avoids duplication. |
| ui-tui/src/tests/createGatewayEventHandler.test.ts | Tests legacy thinking delta feeding reasoning state. |
| ui-tui/packages/hermes-ink/src/ink/ink.tsx | Adds selection drag auto-scroll support and integrates selection bounds tracking. |
| ui-tui/packages/hermes-ink/src/ink/components/ScrollBox.tsx | Refactors scrollBy implementation into a reusable internal function and adds clamp bounds setter. |
| ui-tui/packages/hermes-ink/src/ink/components/App.tsx | Keeps native cursor visible; adjusts mouse click disabling behavior. |
| tui_gateway/server.py | Adds /details command + argument completions in complete.slash. |
| tests/test_tui_gateway_server.py | Adds tests for /details slash completion and arguments. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- remove the temporary -c MRU logic and companion test from this branch so PR #15926 stays focused on TUI perf work - keep the resume-ordering change isolated in the dedicated follow-up PR
There was a problem hiding this comment.
Pull request overview
This PR targets long-session TUI performance and responsiveness by reducing render work on scroll/stream/typing hot paths, adding bounded caches + eviction in @hermes/ink, and isolating frequently-updating turn state from the broader UI shell.
Changes:
- Add virtualization/scroll improvements, including wheel acceleration, viewport snapshots, and virtual height estimation + caching.
- Introduce bounded/LRU caching + explicit eviction for expensive Ink internals (
stringWidth, ANSI slicing, wrapping) plus perf/FPS instrumentation hooks. - Refactor TUI streaming/progress/todo rendering and state subscriptions (selector-based turn store) to avoid broad invalidations.
Reviewed changes
Copilot reviewed 97 out of 100 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| ui-tui/src/types/hermes-ink.d.ts | Extends Ink typings for frame callbacks, fast-path stats, cache eviction, and ScrollBox additions. |
| ui-tui/src/types.ts | Adds todo types/fields on messages and session info fields for status display. |
| ui-tui/src/lib/wheelAccel.ts | Implements wheel-scroll acceleration heuristics with host detection and env overrides. |
| ui-tui/src/lib/virtualHeights.ts | Adds message height keying + height estimation for virtualization. |
| ui-tui/src/lib/viewportStore.ts | Adds viewport snapshot/store keyed for stable subscriptions. |
| ui-tui/src/lib/todo.ts | Adds todo glyph/tone helpers for consistent transcript rendering. |
| ui-tui/src/lib/todo.test.ts | Unit tests for todo glyph/tone behavior. |
| ui-tui/src/lib/text.ts | Adds bounded render text helpers, thinking cleanup, tool duration formatting, and related utilities. |
| ui-tui/src/lib/perfPane.tsx | Adds opt-in perf logging for React commits and Ink frame events. |
| ui-tui/src/lib/messages.ts | Routes transcript appends through tool-shelf merging logic. |
| ui-tui/src/lib/messages.test.ts | Tests transcript append behavior for tool shelves. |
| ui-tui/src/lib/memoryMonitor.ts | Evicts Ink caches under memory pressure before heap dump/exit. |
| ui-tui/src/lib/liveProgress.ts | Adds tool shelf merging + todo state helpers for live progress rendering. |
| ui-tui/src/lib/liveProgress.test.ts | Tests tool shelf merge behavior and todo completion checks. |
| ui-tui/src/lib/inputMetrics.ts | Factors cursor layout + composer sizing helpers out of TextInput. |
| ui-tui/src/lib/fpsStore.ts | Adds opt-in FPS tracker store fed from Ink onFrame. |
| ui-tui/src/gatewayTypes.ts | Extends tool events to include todos and completion durations. |
| ui-tui/src/entry.tsx | Wires Ink onFrame to perf logging + FPS tracking when enabled. |
| ui-tui/src/domain/details.ts | Adjusts details-mode layering with a command override path. |
| ui-tui/src/config/timing.ts | Adds separate streaming batch timings and typing idle threshold. |
| ui-tui/src/config/limits.ts | Adds render tail limits and reduces base wheel scroll step to keep scroll fast path viable. |
| ui-tui/src/config/env.ts | Adds INLINE_MODE + SHOW_FPS flags and shared truthy parsing. |
| ui-tui/src/components/todoPanel.tsx | Adds interactive/collapsible todo rendering panel. |
| ui-tui/src/components/thinking.tsx | Bounds full reasoning render, threads commandOverride into section visibility, and displays tool durations. |
| ui-tui/src/components/textInput.tsx | Adds stdout-based fast echo paths + coalesced parent updates and stable cursor/layout behavior. |
| ui-tui/src/components/streamingMarkdown.tsx | Adds incremental streaming markdown renderer split by stable block boundary. |
| ui-tui/src/components/streamingAssistant.tsx | Splits streaming assistant rendering and adds live todo anchoring panel. |
| ui-tui/src/components/messageLine.tsx | Adds streaming markdown path, history render bounding, todo trail rendering, and tool injection support. |
| ui-tui/src/components/markdown.tsx | Adds theme-keyed, bounded cross-instance markdown parse cache (LRU). |
| ui-tui/src/components/fpsOverlay.tsx | Adds opt-in FPS overlay component. |
| ui-tui/src/components/appLayout.tsx | Refactors layout to PerfPane-wrapped sections, adds inline mode, stable composer sizing, and live todo anchoring. |
| ui-tui/src/components/appChrome.tsx | Switches to selector-based turn state + viewport snapshots; enriches model label rendering. |
| ui-tui/src/components/agentsOverlay.tsx | Switches overlay to selector-based subagent subscriptions. |
| ui-tui/src/app/useSubmission.ts | Adds typing-driven streaming backoff/relax behavior; improves queued submit behavior; tweaks session-busy errors. |
| ui-tui/src/app/useSessionLifecycle.ts | Adds active-session file writing + Ink cache eviction on reset/resume paths. |
| ui-tui/src/app/useMainApp.ts | Adds virtual height caching, transcript append merging, selector-based turn reads, and updated model persistence behavior. |
| ui-tui/src/app/useLongRunToolCharms.ts | Moves to selector-based tool reads and avoids rerenders from unrelated turn updates. |
| ui-tui/src/app/useInputHandlers.ts | Adds wheel acceleration and scroll-driven streaming backoff behavior. |
| ui-tui/src/app/useConfigSync.ts | Clears detailsModeCommandOverride on config sync. |
| ui-tui/src/app/uiStore.ts | Adds detailsModeCommandOverride to UI state. |
| ui-tui/src/app/turnStore.ts | Adds selector hook, todo state, and end-of-turn todo archival helpers. |
| ui-tui/src/app/slash/commands/session.ts | Makes /model persist globally by default; avoids duplicate --global. |
| ui-tui/src/app/slash/commands/ops.ts | Removes unused transcript pager helper usage. |
| ui-tui/src/app/slash/commands/core.ts | Threads detailsModeCommandOverride semantics through /details. |
| ui-tui/src/app/scroll.ts | Extracts selection-aware scrolling into a reusable helper. |
| ui-tui/src/app/interfaces.ts | Extends SelectionApi and narrows AppLayoutProgressProps to showProgressArea. |
| ui-tui/src/app/createGatewayEventHandler.ts | Records reasoning deltas/todos; supports tool duration/todos and inline-diff tool completion flow. |
| ui-tui/src/tests/wheelAccel.test.ts | Tests wheel acceleration state machine behavior. |
| ui-tui/src/tests/virtualHistoryClamp.test.ts | Tests virtual history clamping decisions. |
| ui-tui/src/tests/virtualHeights.test.ts | Tests stable keying and height estimates. |
| ui-tui/src/tests/viewportStore.test.ts | Tests viewport snapshot normalization and key behavior. |
| ui-tui/src/tests/useSessionLifecycle.test.ts | Tests active-session file writing helper. |
| ui-tui/src/tests/turnStore.test.ts | Tests todo archiving and collapse toggling behavior. |
| ui-tui/src/tests/textInputWrap.test.ts | Moves cursorLayout tests to inputMetrics and adds composer sizing tests. |
| ui-tui/src/tests/text.test.ts | Adds tests for bounded render text, tool duration formatting, and thinking formatting changes. |
| ui-tui/src/tests/streamingMarkdown.test.ts | Tests stable boundary detection for incremental streaming markdown. |
| ui-tui/src/tests/stateIsolation.test.ts | Tests UI subscriber isolation from high-frequency turn updates. |
| ui-tui/src/tests/scroll.test.ts | Tests selection-aware scroll clamping behavior. |
| ui-tui/src/tests/reasoning.test.ts | Adds tests for cleaning thinking/status ticker noise. |
| ui-tui/src/tests/messages.test.ts | Adds regression test ensuring resume preserves tool-call rows. |
| ui-tui/src/tests/details.test.ts | Tests details mode layering with command overrides. |
| ui-tui/src/tests/createSlashHandler.test.ts | Tests /model persistence default and details override behavior. |
| ui-tui/scripts/profile-tui.mjs | Adds a profiling harness script for synthetic streaming/layout scenarios. |
| ui-tui/packages/hermes-ink/src/utils/sliceAnsi.ts | Adds bounded LRU caching + eviction helpers for ANSI slicing. |
| ui-tui/packages/hermes-ink/src/ink/wrap-text.ts | Adds bounded memoization and eviction for wrapping/truncation logic. |
| ui-tui/packages/hermes-ink/src/ink/termio/osc.ts | Minor refactors/formatting in clipboard emission logic. |
| ui-tui/packages/hermes-ink/src/ink/terminal.ts | Adds xterm.js key support, diff-write telemetry (bytes/backpressure/drain timing), and return values. |
| ui-tui/packages/hermes-ink/src/ink/stringWidth.ts | Adds bounded memoization + eviction for string width calculation. |
| ui-tui/packages/hermes-ink/src/ink/render-node-to-output.ts | Adds fast-path diagnostics counters for scroll DECSTBM optimization. |
| ui-tui/packages/hermes-ink/src/ink/output.ts | Adds clip fast path to avoid ANSI slicing when line fits. |
| ui-tui/packages/hermes-ink/src/ink/lru.ts | Introduces shared LRU eviction helper for Ink caches. |
| ui-tui/packages/hermes-ink/src/ink/line-width-cache.ts | Converts line-width cache eviction to LRU and exposes eviction/size helpers. |
| ui-tui/packages/hermes-ink/src/ink/ink.tsx | Adds frame drain/backpressure telemetry and selection auto-scroll during drag selection. |
| ui-tui/packages/hermes-ink/src/ink/frame.ts | Extends FrameEvent phases to include write telemetry and optimized patch count. |
| ui-tui/packages/hermes-ink/src/ink/events/input-event.ts | Refactors special-sequence input normalization (space/return/escape). |
| ui-tui/packages/hermes-ink/src/ink/events/cmd-shortcuts.test.ts | Adds tests for modified Enter parsing sequences. |
| ui-tui/packages/hermes-ink/src/ink/components/ScrollBox.tsx | Tracks last manual scroll timestamp and exposes it on handle. |
| ui-tui/packages/hermes-ink/src/ink/components/App.tsx | Adjusts focus/mouse handling behavior and terminal mode toggles. |
| ui-tui/packages/hermes-ink/src/ink/cache-eviction.ts | Adds unified eviction API for Ink’s bounded caches. |
| ui-tui/packages/hermes-ink/src/entry-exports.ts | Exposes cache eviction, isXtermJs, and scroll fast-path stats. |
| ui-tui/packages/hermes-ink/index.d.ts | Exposes cache eviction API from package typings. |
| ui-tui/package.json | Adds React Compiler build step + Babel tooling and compiler lint plugin. |
| ui-tui/eslint.config.mjs | Wires react-compiler lint rule (warn in app code; off in tests). |
| ui-tui/babel.compiler.config.cjs | Adds Babel config for the React Compiler post-tsc pass. |
| tui_gateway/server.py | Improves config cache invalidation, session resume/history lineage display, tool todos, and /details completions. |
| tests/test_tui_gateway_server.py | Adds gateway tests for tool-call preservation, resume lineage display, and /details completion. |
| tests/test_hermes_state.py | Adds tests for ancestor-inclusive conversations and de-duping replayed prompts. |
| tests/hermes_cli/test_tui_resume_flow.py | Ensures TUI launches set NODE_ENV=production and exit summary prefers active-session file. |
| tests/hermes_cli/test_resolve_last_session.py | Adds tests for “most recently active” session selection logic. |
| skills/software-development/hermes-agent-skill-authoring/SKILL.md | Adds documentation skill for authoring in-repo skills. |
| skills/software-development/debugging-hermes-tui-commands/SKILL.md | Adds documentation skill for debugging TUI slash commands end-to-end. |
| hermes_state.py | Adds ancestor-inclusive conversation loading, replay de-duping, and last_active support in session search. |
| hermes_cli/web_server.py | Ensures NODE_ENV=production for embedded TUI launches and standardizes env passing. |
| hermes_cli/main.py | Uses last_active-based session resolution and active-session file to improve exit/resume flows. |
Files not reviewed (1)
- ui-tui/package-lock.json: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This reverts commit 1566f1e.
24744c8 to
3e16649
Compare
Update nix/tui.nix npmDeps hash to match the current ui-tui package-lock inputs so nix builds and CI lockfile checks pass.
- remove the temporary -c MRU logic and companion test from this branch so PR NousResearch#15926 stays focused on TUI perf work - keep the resume-ordering change isolated in the dedicated follow-up PR
…ession-perf perf(tui): stabilize long-session scrolling
- remove the temporary -c MRU logic and companion test from this branch so PR NousResearch#15926 stays focused on TUI perf work - keep the resume-ordering change isolated in the dedicated follow-up PR
…ession-perf perf(tui): stabilize long-session scrolling
- remove the temporary -c MRU logic and companion test from this branch so PR NousResearch#15926 stays focused on TUI perf work - keep the resume-ordering change isolated in the dedicated follow-up PR
…ession-perf perf(tui): stabilize long-session scrolling
- remove the temporary -c MRU logic and companion test from this branch so PR NousResearch#15926 stays focused on TUI perf work - keep the resume-ordering change isolated in the dedicated follow-up PR
…ession-perf perf(tui): stabilize long-session scrolling
Summary
This PR makes the TUI usable on very long sessions by cutting hot render work out of the scroll path, isolating streaming state, and adding bounded caches/eviction for Ink internals.
Main outcomes:
HERMES_DEV_PERF=1,HERMES_TUI_FPS=1).Before / After
CPU profile from a real long-session scroll:
Output.get()self-timesliceAnsitotalstringWidthfamilySynthetic PageUp profile harness:
Idle sanity / typing-while-streaming profiles after fixes:
Streaming*~0.05% inclusive, markdown ~0.00-0.01%)Key Changes
useVirtualHistorynow uses deferred range growth, slide caps, quantized scroll snapshots, clamp bounds, pessimistic coverage for unmeasured rows, and typed-array offset reuse.ScrollBox/Ink rendering gained a scroll fast path plus instrumentation to explain declines.stringWidth,wrapText,sliceAnsi, and line-width caches are bounded LRU caches, with shared eviction viaevictInkCaches().Output.get()skips ANSI slicing entirely when the line already fits the clip window.tscBabel pass, with compiler lint warnings enabled for app code./detailsconfig/completion,/modelpersistence, resume/exit session handoff, and most-recent session selection were tightened while working through long-session flows.Validation
Latest local validation after cleanup:
npm run fixpassednpm run type-checkpassednpm testpassed: 367/367npm run buildpassedpython -m py_compile scripts/profile-tui.pypassednpm run fixcurrently reports 4 React Compiler warnings in existing singleton/hot-path mutation patterns; no errors.Notes For Reviewers
The perf diagnostics are opt-in and should be zero-cost when disabled:
HERMES_DEV_PERF=1writes commit/frame rows to the perf log.HERMES_TUI_FPS=1shows the live FPS overlay.@hermes/inkso the TUI can prune hot caches on memory pressure or session reset.