fix(tui): bound completed shell output frames - #2385
Open
lurenjia534 wants to merge 1 commit into
Open
Conversation
🦋 Changeset detectedLatest commit: 6fb6bac The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
lurenjia534
marked this pull request as ready for review
July 29, 2026 21:52
commit: |
Contributor
Author
|
@codex review |
|
Codex Review: Didn't find any major issues. Bravo. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
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.
Related Issue
Resolve #2320
Problem
Completed foreground shell commands passed their entire captured output to the terminal renderer. A command that emitted many short lines could therefore create a very large frame, causing unnecessary wrapping work and memory pressure even though only the tail is useful in the interactive view.
What changed
Validation
pnpm --filter @moonshot-ai/kimi-code exec vitest run test/tui/components/messages/shell-run.test.ts test/tui/message-replay.test.tspnpm --filter @moonshot-ai/kimi-code exec vitest run— 2,462 passed, 5 skippedpnpm --filter @moonshot-ai/kimi-code typecheckpnpm --filter @moonshot-ai/kimi-code buildpnpm exec oxlint --type-aware --quietgit diff --check691ec4679ea19d6be8ac18f359088384ed3e446dand fixed6fb6bac22889bc0a1c2816aef437c76c3b397be5, using the realShellRunComponent→ pi-tuiTextrender path while retaining the completeformatBashOutputForDisplaytranscript. With 50,000 high-entropy shortlines (2,750,000 characters), five isolated
node --expose-gcprocessesproduced these forced-GC medians:
9,850,880 B RSS delta
2,772,992 B RSS delta
the forced-GC median by 82.60% for heap and 68.83% for RSS.
These are post-GC deltas for the affected render path on this run, not a
cross-platform claim about whole-process peak CLI memory.
Checklist
gen-changesetsskill, or this PR needs no changeset.gen-docsskill, or this PR needs no doc update.