hermes-agent/ui-tui/packages/hermes-ink/src/ink
Brooklyn Nicholson 0d353ca6a8 fix(tui): bound retained state against idle OOM
Guards four unbounded growth paths reachable at idle — the shape matches
reports of the TUI hitting V8's 2GB heap limit after ~1m of idle with 0
tokens used (Mark-Compact freed ~6MB of 2045MB → pure retention).

- `GatewayClient.logs` + `gateway.stderr` events: 200-line cap is bytes-
  uncapped; a chatty Python child emitting multi-MB lines (traceback,
  dumped config, unsplit JSON) retains everything. Truncate at 4KB/line.
- `GatewayClient.bufferedEvents`: unbounded until `drain()` fires. Cap
  at 2000 so a pre-mount event storm can't pin memory indefinitely.
- `useMainApp` gateway `exit` handler: didn't reset `turnController`, so
  a mid-stream crash left `bufRef`/`reasoningText` alive forever.
- `pasteSnips` count-capped (32) but byte-uncapped. Add a 4MB total cap
  and clear snips in `clearIn` so submitted pastes don't linger.
- `StylePool.transitionCache`: uncapped `Map<number,string>`. Full-clear
  at 32k entries (mirrors `charCache` pattern).
2026-04-19 18:43:40 -07:00
..
components chore: uptick 2026-04-16 22:35:45 -05:00
events feat: add scrollbar and fix selection on scroll 2026-04-14 14:34:33 -05:00
hooks feat(tui): /model and /setup slash commands with in-place CLI handoff 2026-04-17 10:58:18 -05:00
layout feat: fork ink and make it work nicely 2026-04-11 11:29:08 -05:00
termio feat: fork ink and make it work nicely 2026-04-11 11:29:08 -05:00
Ansi.tsx feat: fix types and add type checking plus lazybundle on launch andddd dev flag 2026-04-11 14:42:28 -05:00
bidi.ts feat: fork ink and make it work nicely 2026-04-11 11:29:08 -05:00
clearTerminal.ts feat: fork ink and make it work nicely 2026-04-11 11:29:08 -05:00
colorize.ts Merge branch 'feat/ink-refactor' of github.com:NousResearch/hermes-agent into feat/ink-refactor 2026-04-11 11:39:19 -05:00
constants.ts feat: fork ink and make it work nicely 2026-04-11 11:29:08 -05:00
cursor.ts feat: fork ink and make it work nicely 2026-04-11 11:29:08 -05:00
devtools.ts feat: fix types and add type checking plus lazybundle on launch andddd dev flag 2026-04-11 14:42:28 -05:00
dom.ts feat: fix img pasting in new ink plus newline after tools 2026-04-11 13:14:32 -05:00
focus.ts feat: fork ink and make it work nicely 2026-04-11 11:29:08 -05:00
frame.ts chore: uptick 2026-04-14 19:38:04 -05:00
get-max-width.ts feat: fork ink and make it work nicely 2026-04-11 11:29:08 -05:00
global.d.ts feat: fork ink and make it work nicely 2026-04-11 11:29:08 -05:00
hit-test.ts feat: add scrollbar and fix selection on scroll 2026-04-14 14:34:33 -05:00
ink.tsx chore: uptick 2026-04-17 15:13:33 -05:00
instances.ts feat: fork ink and make it work nicely 2026-04-11 11:29:08 -05:00
line-width-cache.ts feat: fork ink and make it work nicely 2026-04-11 11:29:08 -05:00
log-update.ts feat: fork ink and make it work nicely 2026-04-11 11:29:08 -05:00
measure-element.ts feat: fork ink and make it work nicely 2026-04-11 11:29:08 -05:00
measure-text.ts feat: fork ink and make it work nicely 2026-04-11 11:29:08 -05:00
node-cache.ts feat: fork ink and make it work nicely 2026-04-11 11:29:08 -05:00
optimizer.ts feat: fork ink and make it work nicely 2026-04-11 11:29:08 -05:00
output.ts chore: uptick 2026-04-14 19:38:04 -05:00
parse-keypress.ts chore: uptick 2026-04-14 19:38:04 -05:00
reconciler.ts feat: fix types and add type checking plus lazybundle on launch andddd dev flag 2026-04-11 14:42:28 -05:00
render-border.ts feat: fork ink and make it work nicely 2026-04-11 11:29:08 -05:00
render-node-to-output.ts chore: uptick 2026-04-14 19:38:04 -05:00
render-to-screen.ts feat: fix types and add type checking plus lazybundle on launch andddd dev flag 2026-04-11 14:42:28 -05:00
renderer.ts chore: uptick 2026-04-14 19:38:04 -05:00
root.ts feat: fork ink and make it work nicely 2026-04-11 11:29:08 -05:00
screen.ts fix(tui): bound retained state against idle OOM 2026-04-19 18:43:40 -07:00
searchHighlight.ts feat: fork ink and make it work nicely 2026-04-11 11:29:08 -05:00
selection.ts feat: fix img pasting in new ink plus newline after tools 2026-04-11 13:14:32 -05:00
squash-text-nodes.ts feat: fork ink and make it work nicely 2026-04-11 11:29:08 -05:00
stringWidth.ts feat: fork ink and make it work nicely 2026-04-11 11:29:08 -05:00
styles.ts feat: fork ink and make it work nicely 2026-04-11 11:29:08 -05:00
supports-hyperlinks.ts feat: fork ink and make it work nicely 2026-04-11 11:29:08 -05:00
tabstops.ts feat: fork ink and make it work nicely 2026-04-11 11:29:08 -05:00
terminal-focus-state.ts feat: fork ink and make it work nicely 2026-04-11 11:29:08 -05:00
terminal-querier.ts feat: fork ink and make it work nicely 2026-04-11 11:29:08 -05:00
terminal.ts Merge branch 'feat/ink-refactor' of github.com:NousResearch/hermes-agent into feat/ink-refactor 2026-04-11 11:39:19 -05:00
termio.ts feat: fork ink and make it work nicely 2026-04-11 11:29:08 -05:00
useTerminalNotification.ts feat: fork ink and make it work nicely 2026-04-11 11:29:08 -05:00
warn.ts feat: fork ink and make it work nicely 2026-04-11 11:29:08 -05:00
widest-line.ts feat: fork ink and make it work nicely 2026-04-11 11:29:08 -05:00
wrap-text.ts feat: fork ink and make it work nicely 2026-04-11 11:29:08 -05:00
wrapAnsi.ts feat: fork ink and make it work nicely 2026-04-11 11:29:08 -05:00