Commit 415f02e
fix: multi-layer backpressure to prevent terminal write freezes
Add three layers of protection against oversized terminal.write() calls
that freeze Chrome's main thread:
1. SSE entry cap: _onSessionTerminal drops data when total queued bytes
(pendingWrites + flickerFilterBuffer) exceeds 128KB. Server sends
session:needsRefresh to recover dropped content.
2. Flush cap: flushPendingWrites splits at DEC 2026 sync segment
boundaries with 64KB per-frame budget. Excess segments deferred to
next requestAnimationFrame. Segment-level splitting preserves Ink
redraw atomicity (no flicker).
3. Reduced tail size: initial buffer fetch reduced to 128KB (from 256KB)
to limit data volume during tab switch.
Re-enable WebGL renderer — root cause was unbounded terminal.write()
volume, not the GPU renderer itself.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent d581494 commit 415f02e
2 files changed
Lines changed: 13 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1386 | 1386 | | |
1387 | 1387 | | |
1388 | 1388 | | |
1389 | | - | |
| 1389 | + | |
1390 | 1390 | | |
1391 | 1391 | | |
1392 | 1392 | | |
| |||
1815 | 1815 | | |
1816 | 1816 | | |
1817 | 1817 | | |
| 1818 | + | |
| 1819 | + | |
| 1820 | + | |
| 1821 | + | |
| 1822 | + | |
| 1823 | + | |
| 1824 | + | |
| 1825 | + | |
| 1826 | + | |
| 1827 | + | |
1818 | 1828 | | |
1819 | 1829 | | |
1820 | 1830 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
55 | | - | |
56 | | - | |
| 55 | + | |
| 56 | + | |
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
| |||
0 commit comments