hermes-agent/ui-tui/packages/hermes-ink
Teknium 5e7bca95d9
fix(tui): coalesce render frames while stdout backpressure is unresolved (#31486) (#54171)
When the previous frame's stdout.write has not drained (the outer terminal
parser is overwhelmed by a wide CR+LF burst — CJK + ANSI tool output on a
high-context session), the renderer kept writing a new frame every tick. That
piled writes onto an already-backed-up pipe and kept the macrotask queue hot,
starving the stdin 'readable' callback — the observed stdin freeze where the
agent loop keeps running but keystrokes/Ctrl-C are dead.

onRender now coalesces: while pendingWriteStart is non-null (prior write's
drain callback hasn't fired) it skips the frame and retries on the drain tick
instead of writing. A MAX_COALESCED_BACKPRESSURE_FRAMES ceiling forces a write
through after N skips so a terminal whose drain callback never fires (OSError
EIO on flush) self-heals once the pipe recovers rather than wedging forever.
TTY-only; piped stdout has no flow control. Coalesce counter resets on every
real write.

This is the stdout-backpressure strand left open after #54046 fixed the
swallowed-exception strand.
2026-06-28 04:00:22 -07:00
..
src fix(tui): coalesce render frames while stdout backpressure is unresolved (#31486) (#54171) 2026-06-28 04:00:22 -07:00
ambient.d.ts feat: fix types and add type checking plus lazybundle on launch andddd dev flag 2026-04-11 14:42:28 -05:00
index.d.ts style(desktop,tui): fix all lint/type/formatting issues 2026-06-26 01:04:33 -05:00
index.js fix(tui): use --outdir instead of --outfile in hermes-ink build script 2026-05-04 03:09:41 -07:00
package.json fix(cli,deps): clear esbuild audit loop 2026-06-15 06:18:27 -07:00
text-input.d.ts feat: fork ink and make it work nicely 2026-04-11 11:29:08 -05:00
text-input.js feat: fork ink and make it work nicely 2026-04-11 11:29:08 -05:00