fix(tui): make folded assistant messages expandable - #2920
Open
yu-xin-c wants to merge 3 commits into
Open
Conversation
🦋 Changeset detectedLatest commit: e6707da 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 |
yu-xin-c
force-pushed
the
codex/tui-preserve-folded-assistant
branch
from
August 14, 2026 15:39
98c0fcf to
fc324a2
Compare
yu-xin-c
marked this pull request as ready for review
August 14, 2026 15:40
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: fc324a2695
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
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 #2904
Problem
Completed turns replace older assistant replies with a count-only step summary. The original message components are then disposed, while the summary does not participate in the existing
Ctrl+Oexpansion protocol. This makes the folded reply text unavailable in both the live TUI and replayed sessions.What changed
StepSummaryComponentbefore live, completed-turn, or replay folding removes the original components.Ctrl+O, reusing one lazy Markdown renderer and clearing its rendered-line cache on collapse or theme invalidation.KIMI_CODE_TUI_EXPAND_TURNSduring replay and as live turns advance, so summaries outside the recent-turn window stay collapsed.The summary owns its text snapshots before the original components are removed. That also keeps the behavior compatible with #2603 if folded transcript metadata is reclaimed later.
Verification
pnpm --filter @moonshot-ai/kimi-code exec vitest run test/tui/components/messages/step-summary.test.ts test/tui/kimi-tui-message-flow.test.ts test/tui/message-replay.test.ts(251 passed)pnpm --filter @moonshot-ai/kimi-code typecheckpnpm --filter kimi-code-docs buildoxlint(0 errors; 2 pre-existing warnings inkimi-tui.ts)git diff --checkA full TUI run also reached 1,952 passed and 3 skipped; its five unrelated failures (one feedback sequencing case and four image-compression timeouts under parallel load) all passed in isolated reruns.
Checklist
gen-changesetsskill, or this PR needs no changeset.gen-docsskill, or this PR needs no doc update.