You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(chat): hide empty assistant messages on desktop and mobile - #46311
Empty assistant messages should not look like replies. This removes blank Chat rows and their orphaned copy/scroll controls on desktop and mobile while keeping meaningful messages visible.
What Changed
Share a display-content predicate between desktop and mobile transcript projection.
Skip assistant entries containing only whitespace, empty text, or no blocks before tool folding, so they cannot reserve rows or split adjacent tool work.
Preserve text, images, tool calls/results, subagent and background-task status, semantic notices/cards, and shortened content. A blank streaming entry becomes visible when text arrives.
Filtering at projection time removes the transcript slot and keeps tool grouping correct. Hiding the text or controls alone would leave layout gaps or change grouping. The source transcript and persisted messages are unchanged.
The same fixed synthetic transcript, English UI, dark theme, and 560 × 420 component viewport. These are isolated shipping-component reproductions: before renders the unfiltered transcript slots with the existing row components; after uses the fixed NativeChatMessageList. The after view additionally has the real list's message rail. No account or conversation data is included.
Before
After
Light-theme captures were also checked; neither theme reported page errors.
Testing
The reporter manually verified the development build before this main-branch sync. No new physical-device or live SSH verification was performed during the sync.
At cfe1643e2d0, a local runtime smoke directly exercised the real desktop and mobile projection entry points. It checked blank/empty message filtering, tool grouping, preservation of images, semantic notices, shortened entries, subagents, background tasks and Orca cards, and blank-to-text-to-blank streaming updates.
pnpm check:changed --base=upstream/main: all 38 selected checks passed in 51.9 seconds against upstream 9e2fd8d57c2.
The old projection test files were deleted upstream in test: cut the suite to the tests that guard real invariants #46786 and remain deleted, following the current policy against committing UI projection unit tests. The smoke script is local validation and is not committed.
Earlier desktop/mobile unit-test counts and screenshots refer to the original fix commit c1c29a7e635. The production changes are byte-identical after the sync; no new screenshots were captured for the merge commit.
Upstream CI is awaiting maintainer approval. These are local validation results, not a claim that the remote CI matrix has passed.
Performance
Desktop projection adds a visibility pass over messages; mobile source preparation checks each source when it is prepared. Whitespace-only text checks may scan the relevant strings. Existing block derivations retain their WeakMap cache, and the predicate does not generate markdown. No additional I/O, network requests, subprocesses, or persistent data are introduced. Filtering empty entries avoids their later folding and rendering work. This trade-off was assessed from the code; no dedicated large-transcript performance benchmark was run.
Risk
Level: Low
The main risk is incorrectly hiding a metadata-only assistant entry. The predicate preserves semantic text metadata, cards, tools, images, raw and grouped subagent status, background tasks, and shortened content. The local runtime smoke covers preservation and later streaming text. This only changes display projection: no provider requests, journal storage, permissions, or runtime protocols change. A plain revert restores the previous rendering; there is no data migration to undo.
AI Disclosure
OpenAI Codex (GPT-6) assisted with implementation, regression tests, review, and PR preparation. The reporter manually verified the development build's visual behavior.
Review
Agent review checked desktop/mobile parity, tool folding, streaming updates, and preservation of meaningful non-text content; it identified and fixed raw subagent-row preservation before submission. The change uses shared, platform-neutral presentation logic and introduces no platform paths, shortcuts, IPC, or remote protocol changes. Local, SSH/remote, and folder-workspace transcripts use the same projection. Block derivations retain their WeakMap cache, and the predicate does not build markdown. No new network, filesystem, credential, or execution surface is added. Existing Chat components, layout, and design tokens are retained.
Agent skill upstream boundary
Not applicable: no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation is copied or translated.
Notes
The unrelated 0 ms tool-duration issue is outside this PR. Local Corepack/cache and SDK fixes are not included. Screenshots are attachments; temporary capture fixtures are not committed.
Checklist
This PR is small and focused
I explained what changed and why, including ELI5 and the mechanism
I stated what could break, for whom, and how to revert
Before/after screenshots attached, with reproduction method stated
Self-reviewed for correctness, security, and performance
Cross-platform, SSH/remote, mobile, and compatibility impact considered
Repository-selected local checks passed on the updated branch.
No actionable comments were generated in the recent review.
Walkthrough
The change adds shared helpers to detect whether a native chat message has visible content. Desktop and mobile projections use the helpers to omit visually empty assistant messages. Tests cover blank messages, retained content and tool grouping, and a pending reply that appears after it receives text.
Severity of issue fixed: Medium
Merge Risk: Minimal · up to c1c29
This change hides blank assistant entries in desktop and mobile Chat while keeping meaningful content visible. No concrete merge-blocking risk was found, and the source transcript is unchanged.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title "fix(chat): hide empty assistant messages on desktop and mobile" matches the main change. The changeset filters visually empty assistant messages (whitespace-only, empty text, or no blocks) …
Linked Issues check
Issue #46310 requires that assistant entries with no visible content not reserve Chat rows or split tool grouping. It also requires that entries with text, images, tools, worker/task status, semantic …
Out of Scope Changes check
All changed areas support the linked objective of hiding blank assistant entries in Chat projection: - Shared predicate in src/shared/native-chat/transcript/row-content/native-chat-row-content.ts, u…
Description check
The description covers the required sections: ELI5, What Changed, Why, Linked Issue (Fixes #46310), Visual Proof (before/after images), Testing, Performance, Risk (Level: Low), AI Disclosure, Review, …
Full details: Title check
Explanation
The title "fix(chat): hide empty assistant messages on desktop and mobile" matches the main change. The changeset filters visually empty assistant messages (whitespace-only, empty text, or no blocks) out of the desktop and mobile Chat projections, and the PR objectives describe the same behavior. The title is concise and specific, and it follows a conventional commit style.
Full details: Linked Issues check
Explanation
Issue #46310 requires that assistant entries with no visible content not reserve Chat rows or split tool grouping. It also requires that entries with text, images, tools, worker/task status, semantic notices, or shortened content stay visible, and that a blank streaming entry appear when text arrives.
The summary shows these changes:
nativeChatMessageHasVisibleContent and isVisuallyEmptyNativeChatAssistantMessage in src/shared/native-chat/transcript/row-content/native-chat-row-content.ts define visibility. Visible content includes nonblank text, images, tools, subagent groups or blocks, background tasks, Orca cards, shortened messages, and nonblank drawnMarkdown.
Desktop projection (src/renderer/.../native-chat-message-list-projection.ts) filters visually empty assistant messages before unit reuse and before tool folding. This keeps tool grouping intact.
Mobile projection (mobile-native-chat-render-data.ts) excludes visually empty messages in isMobileNativeChatSource.
Desktop tests cover omission of whitespace-only, empty, and empty-text-block messages, including before tool runs. They also cover preservation of turn notices, shortened messages, subagent rows, and the final answer. Mobile tests cover omission of blank messages, preservation of commentary, tools, images, partial text, notices, and subagent rows, and appearance of a streamed reply once text arrives.
Each expected behavior in #46310 maps to a code change and a test. The summary does not show an unmet coding requirement. Tool-duration (0 ms) reporting is excluded by the issue and is not part of this PR.
Limitation: this verdict relies on the change summary and the PR's reported test results. I did not read the hunks directly.
Full details: Out of Scope Changes check
Explanation
All changed areas support the linked objective of hiding blank assistant entries in Chat projection:
Shared predicate in src/shared/native-chat/transcript/row-content/native-chat-row-content.ts, used by both clients.
Desktop projection filter in native-chat-message-list-projection.ts and its tests.
Mobile projection filter in mobile-native-chat-render-data.ts and its tests.
The PR does not change persisted messages, the source transcript, provider requests, IPC, permissions, or storage. The PR description states that tool-duration, Corepack/cache, and SDK fixes are excluded, and the summary shows no such changes. Test additions support the behavior change and do not expand scope.
Limitation: this verdict relies on the change summary. I did not inspect the full diff.
Full details: Description check
Explanation
The description covers the required sections: ELI5, What Changed, Why, Linked Issue (Fixes #46310), Visual Proof (before/after images), Testing, Performance, Risk (Level: Low), AI Disclosure, Review, the agent skill upstream boundary checkbox, Notes, and Checklist. It explains the mechanism (projection-time filtering before tool folding), the risk, and how to revert. Testing results and screenshots are documented in detail. Minor gaps: the Testing section does not check the template's test-related checkboxes, and the PR is described as having both desktop and mobile verification, but the Testing section cites a local smoke script that is not committed. These gaps are non-critical.
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
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
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.
ELI5
Empty assistant messages should not look like replies. This removes blank Chat rows and their orphaned copy/scroll controls on desktop and mobile while keeping meaningful messages visible.
What Changed
Why
Filtering at projection time removes the transcript slot and keeps tool grouping correct. Hiding the text or controls alone would leave layout gaps or change grouping. The source transcript and persisted messages are unchanged.
Linked Issue
Fixes #46310
Visual Proof
The same fixed synthetic transcript, English UI, dark theme, and 560 × 420 component viewport. These are isolated shipping-component reproductions: before renders the unfiltered transcript slots with the existing row components; after uses the fixed NativeChatMessageList. The after view additionally has the real list's message rail. No account or conversation data is included.
Light-theme captures were also checked; neither theme reported page errors.
Testing
cfe1643e2d0, a local runtime smoke directly exercised the real desktop and mobile projection entry points. It checked blank/empty message filtering, tool grouping, preservation of images, semantic notices, shortened entries, subagents, background tasks and Orca cards, and blank-to-text-to-blank streaming updates.pnpm check:changed --base=upstream/main: all 38 selected checks passed in 51.9 seconds against upstream9e2fd8d57c2.c1c29a7e635. The production changes are byte-identical after the sync; no new screenshots were captured for the merge commit.Performance
Desktop projection adds a visibility pass over messages; mobile source preparation checks each source when it is prepared. Whitespace-only text checks may scan the relevant strings. Existing block derivations retain their WeakMap cache, and the predicate does not generate markdown. No additional I/O, network requests, subprocesses, or persistent data are introduced. Filtering empty entries avoids their later folding and rendering work. This trade-off was assessed from the code; no dedicated large-transcript performance benchmark was run.
Risk
Level: Low
The main risk is incorrectly hiding a metadata-only assistant entry. The predicate preserves semantic text metadata, cards, tools, images, raw and grouped subagent status, background tasks, and shortened content. The local runtime smoke covers preservation and later streaming text. This only changes display projection: no provider requests, journal storage, permissions, or runtime protocols change. A plain revert restores the previous rendering; there is no data migration to undo.
AI Disclosure
OpenAI Codex (GPT-6) assisted with implementation, regression tests, review, and PR preparation. The reporter manually verified the development build's visual behavior.
Review
Agent review checked desktop/mobile parity, tool folding, streaming updates, and preservation of meaningful non-text content; it identified and fixed raw subagent-row preservation before submission. The change uses shared, platform-neutral presentation logic and introduces no platform paths, shortcuts, IPC, or remote protocol changes. Local, SSH/remote, and folder-workspace transcripts use the same projection. Block derivations retain their WeakMap cache, and the predicate does not build markdown. No new network, filesystem, credential, or execution surface is added. Existing Chat components, layout, and design tokens are retained.
Agent skill upstream boundary
Notes
The unrelated 0 ms tool-duration issue is outside this PR. Local Corepack/cache and SDK fixes are not included. Screenshots are attachments; temporary capture fixtures are not committed.
Checklist