fix(tui): bound live render memory pressure#15800
Closed
helix4u wants to merge 1 commit into
Closed
Conversation
Contributor
Author
Collaborator
|
Closing — these changes are already on current main. The |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Bounds the live-rendered text surfaces in the TUI so active reasoning and assistant streaming do not ask Ink/Yoga to re-layout an ever-growing text blob on every render pulse. The full in-memory turn text is still retained for final completion; only the live display is capped to a tail preview with an omitted-lines/chars marker.
This also makes the TUI memory monitor distinguish V8 heap pressure from RSS/native pressure. Heap pressure still writes a heap snapshot, while RSS/native pressure writes diagnostics only, avoiding repeated multi-GB heap snapshots for native RSS growth cases.
Related Issue
Refs #15141
Type of Change
Changes Made
boundedLiveRenderText()and live render caps inui-tui/src/lib/text.ts/ui-tui/src/config/limits.ts.ui-tui/src/app/turnController.tsandui-tui/src/components/messageLine.tsx.ui-tui/src/components/thinking.tsx.ui-tui/src/lib/memoryMonitor.ts.ui-tui/src/lib/memory.tsand updated the startup notice inui-tui/src/entry.tsx.ui-tui/src/__tests__/text.test.tsandui-tui/src/lib/memoryMonitor.test.ts.How to Test
cd ui-tui && npm test -- --run src/__tests__/text.test.ts src/lib/memoryMonitor.test.ts src/__tests__/details.test.ts.cd ui-tui && npm test.cd ui-tui && npm run type-check.cd ui-tui && npx eslint src/config/limits.ts src/lib/text.ts src/app/turnController.ts src/components/thinking.tsx src/components/messageLine.tsx src/lib/memory.ts src/lib/memoryMonitor.ts src/entry.tsx src/__tests__/text.test.ts src/lib/memoryMonitor.test.ts.hermes --tuirunsui-tui/dist/entry.js:ps -o pid,rss,vsz,comm -p <node pid>.Local smoke result from a fresh rebuilt
hermes --tuirun: Node RSS rose during active work, then stabilized while idle and dropped from about 537 MB to about 399 MB over the idle window. The Python gateway stayed flat around 51 MB.Checklist
Code
fix(scope):,feat(scope):, etc.)pytest tests/ -qand all tests passDocumentation & Housekeeping
docs/, docstrings) — N/Acli-config.yaml.exampleif I added/changed config keys — N/ACONTRIBUTING.mdorAGENTS.mdif I changed architecture or workflows — N/AFor New Skills
N/A
Screenshots / Logs
Live idle-monitor sample from the rebuilt bundle: