Repository navigation
feat(native-chat): read a tool batch as a group - #19372
Conversation
A run of several tool calls collapsed to one joined string: names and arguments run together, separated by a middle dot that also occurs inside `browser.open` and `tools/read`, with the overflow cut mid-token. Opened, the member rows sat flush with the header and with the message content around them, so the batch had no visible end. Two presentation changes, no new derivation: - Each member gets its own bounded pill in the collapsed header, carrying its own category glyph, so the boundary between calls is a shape rather than a character. Pills wrap instead of truncating, and members past the summary cap are counted in `+N more` rather than dropped silently. - Opened members are indented under the header, which is what marks where the run ends. `toolRunSummaryMembers` keeps the run's leading calls apart instead of pre-joining them; `summarizeToolRun` now derives its string from it, so mobile's header is byte-identical and the two cannot disagree about which calls speak for a run. Two existing behaviours are pinned by test rather than changed, both being naming decisions rather than layout ones: the header still prints the raw `mcp__linear__list_issues` while the row beneath prints the split name, and a call carrying only a `url` still falls through to a JSON preview clipped at 28 characters.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Team Run ID: 📒 Files selected for processing (2)
Included review availability: Your plan provides up to 10 included reviews per hour; 7 remain after this review. 📝 WalkthroughWalkthroughThe shared tool summary logic now returns individual tool-run members with names, arguments, and optional MCP identities. Merge Risk: ⚪ Minimal · up to Tool runs now display grouped call summaries with member labels, glyphs, overflow counts, and indented expanded rows. The supplied validation indicates the presentation and interaction behavior is working as intended, with no remaining merge-blocking risk. 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
Full details: Description checkExplanation The description clearly explains the change, rationale, visual behavior, known limitations, and verification results. However, it omits the required Linked Issue entry, does not provide the required before-and-after visual attachments or an explicit Visual Proof section, and does not complete the template checklist. Resolution Add the linked issue after
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
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. Comment |
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
A presentation-only change to the desktop native-chat tool-run header so a batch of tool calls reads as a group instead of one joined string that ran names together and truncated mid-token.
- Shared
toolRunSummaryMembers— extracts the run's leading calls as{ name, arg, mcpIdentity }[]under the sameMAX_TOOL_RUN_SUMMARY_PARTScap and blank-name skip the joined string always used;summarizeToolRunis now derived from it, so mobile's header stays byte-identical. - Per-member pills — the settled header renders one pill per member, each with its own category glyph, so a mixed run no longer collapses to a single generic wrench; members past the cap become
+N more. - Indented members — opened member rows gain
pl-4so the batch has a visible end. - Tests — new cases pin the member boundaries, the
+N morecount, the blank-name fallback, and both deliberately-unfixed naming decisions; the six updated assertions preserve intent after the header stopped emitting one joined text node.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
The follow-up commit bundles the new moreCalls string into the renderer's boot-bundle catalog.
- Runtime-required i18n entry — adds
components.native-chat.tool.moreCalls(+{{value0}} more) toen-runtime-required.json, matchingen.json. The catalog generator marks this key required because thetranslate(...)call site passesNATIVE_CHAT_TOOL_ACTIVITY_COPY.moreCalls(an object-property expression, not a string literal), so i18next cannot rebuild it from a call-site default and it must ship in the runtime catalog. The value and key placement are byte-identical toen.jsonand alphabetically sorted.
No new issues. The prior review's findings were informational, and this commit cleanly completes the catalog sync the previous commit missed.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
|
Electron CDP validation at
|
Review status: LANDThe review/fix loop is clean at
Validation passed: 113 native-chat test files / 1,207 tests, focused selector and rendering tests, Electron QA used the exact branch in an isolated background profile through Playwright CDP. The narrow renderer showed three separately wrapping pills, The requested Grok reviewer could not run because its weekly limit was exhausted. A Codex orchestration fallback performed the Electron validation. Its live Grok request then returned HTTP 402, so it inserted deterministic settled records into the isolated QA transcript and exercised Orca's production transcript reader and renderer. This proves the changed presentation and interaction, but does not test live Grok execution or streaming. That gap does not block this renderer-focused PR. Mobile emulator, remote Windows, and SSH/Linux QA were not applicable to this desktop presentation change; Windows packaging still passed in CI. |
Rendered in the app, the filled chips were wrong twice over. `bg-accent` is reserved for hover/active row backgrounds, and the only full-strength use of it in native chat is on payload and diff surfaces — so each member read as a shrunken content block, and a run became the loudest thing in the transcript. Worse, `flex-wrap` degenerated: at a 297px pane each member is 274-288px, so every one took its own line, the header grew 24px to 72px, and the `5x` count centred against the block landed beside the second member as though it counted that call alone. The glyph already marks where a member starts, so the fill was carrying no information the icon wasn't. Members are now inline, glyph-led, and separated by spacing; the list stays one line and truncates as a whole, as it did before this branch. `+N more` moves outside the truncating span so the count of what is not shown survives a pane too narrow to print the list. Members carry `data-tool-run-member` rather than being found by their fill.
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
The latest commit replaces the filled per-member pill with a glyph-led, single-line member list, then re-anchors the affected assertions on an explicit marker instead of the removed styling.
- Glyph-led segments instead of
bg-accentpills — drops the pill chrome in favor of a plain monospace list where each member's ownNativeChatToolIconglyph marks the boundary (a separator character cannot:·also occurs insidebrowser.openandtools/read). - Single-line truncation with a surviving remainder count — the member list now truncates as a whole instead of wrapping into a block, and
+N moremoved outside the truncating span (shrink-0) so the hidden count survives a too-narrow pane. data-tool-run-memberselector — replaces the.bg-accentqueries in tests with an explicit attribute, decoupling assertions from visual classes.- Re-anchored assertions — existing tests now query the run header /
codeselector after the header stopped emitting a single joined text node;summarizeToolRunstays byte-identical for mobile.
One minor note: the PR description still describes the superseded approach ("one pill per member … pills wrap instead of truncating"). Worth a one-line refresh so it matches the shipped glyph-led, truncating header.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/shared/native-chat-tool-activity.ts (1)
17-17: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winUse a named interpolation key.
Change
+{{value0}} moreto+{{count}} more. Pass{ count: hiddenCallCount }inNativeChatToolRun.tsxand update the matching catalog entries.Based on learnings, new user-facing strings must use intent-named localization IDs with named interpolation placeholders.
Source: Learnings
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Team
Run ID: b30d748f-4c24-452a-afd6-c0127c8975d9
📒 Files selected for processing (11)
src/renderer/src/components/native-chat/NativeChatMessageList.test.tsxsrc/renderer/src/components/native-chat/NativeChatSubagentRun.test.tsxsrc/renderer/src/components/native-chat/NativeChatToolRun.identity.test.tsxsrc/renderer/src/components/native-chat/NativeChatToolRun.test.tsxsrc/renderer/src/components/native-chat/NativeChatToolRun.tsxsrc/renderer/src/components/native-chat/native-chat-tool-summary.tssrc/renderer/src/i18n/en-runtime-required.jsonsrc/renderer/src/i18n/locales/en.jsonsrc/shared/native-chat-tool-activity.tssrc/shared/native-chat-tool-summary.test.tssrc/shared/native-chat-tool-summary.ts
Included review availability: Your plan provides up to 10 included reviews per hour; 7 remain after this review.
`flex-1` on the truncating member list made it claim the header's slack, so `+N more` was pushed to the far right edge with a gap between it and the last member it counts. Without it the span still shrinks and truncates — `min-w-0` plus the default shrink is what drives the ellipsis, which is how the header worked before this branch — and the count now sits directly after the list at every width.
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
The latest commit stops the settled run header from stretching its member list full-width, so the trailing +N more / completion / chevron marks sit against the content rather than being pushed to the far edge.
flex-1dropped from the member list and fallback spans —NativeChatToolRun.tsxremovesflex-1from the two truncating spans in the settled header (min-w-0 truncate), leaving the active-call header'sflex-1untouched.callCount×, the member list, and+N moreare allshrink-0/min-w-0siblings undergap-1.5, so the list still truncates on a narrow pane and left-packs on a wide one.
No behavior or test changes accompany this commit; the six prior assertions querying the run header and data-tool-run-member markers remain intact, and summarizeToolRun (and mobile's header) are untouched.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
…hat-tool-run-pills
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
The new commit is a merge of origin/main into the branch (91f58a7), pulling in upstream changes from #19228 (compaction/plan/image notices) and #19398 (sidebar worktree reveal). The PR's own eleven files are byte-identical to the last-reviewed state (8b84b4e).
- Clean merge — none of the upstream changes overlap the PR's reviewed code:
NativeChatToolRun.tsx,native-chat-tool-summary.ts, and the test files are untouched by the merge. - No semantic interaction — the merged
native-chat-types.tsadditions (presentation,tone) extendNativeChatTextBlock, while the PR'stoolRunSummaryMembersoperates on tool-call blocks and readsmcpIdentity, which the merge does not change. - i18n is disjoint — the merge's
en.jsonadditions (native-chat.notices.*) are a sibling of the PR'snative-chat.tool.moreCalls; no key collision or runtime-required change.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
Screenshots — tool-run header at
|
An `ml-3` margin marks the boundary on screen but is invisible to a copied selection and to the button's accessible name, so the header read `ls -latools/read`. Adds a space text node between members and trims the margin to pay for its width. `+N more` also picks up the hover transition every other header segment already had.
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
The new commit (1caae61) fixes the run header's member boundaries so a copied selection and the button's accessible name actually separate members, instead of relying on a CSS margin that invisible text consumers cannot see.
- Real whitespace between members — each member is now wrapped in a
Fragmentand preceded (after the first) by a literal space, so the header readsls -la tools/readrather thanls -latools/read; the separator margin is trimmedml-3→ml-2to pay for the added width. - Hover consistency — the
+N morespan gains the sametransition-colors group-hover:text-foreground/80treatment as itscallCount×and member-list siblings. - New regression test —
separates members with real whitespace, not only a marginpins the header's exacttextContent, alongside a reformatted glyph assertion.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
Merge gate — verdict at
|
| Check | Result |
|---|---|
pnpm tc |
clean |
pnpm test — native-chat + shared summary |
114 files, 1221 tests passing |
pnpm test — mobile/ |
516 files, 4204 passing, 3 skipped |
oxfmt --check, oxlint |
clean |
verify:localization-catalog / -runtime-catalog / -extraction |
pass |
| Changed-code quality gate | clean on all tracked files |
summarizeToolRun equivalence holds by construction — same iteration, same name.trim() skip, same briefToolArg, same >= 3 break, and briefToolArg returns a string rather than null so the old and new falsy branches are identical. Mobile imports the same shared module and its suite is green.
Note for anyone reading the thread
The earlier "Review status: LAND" comment is pinned to 1e90644c6a. That SHA predates the redesign — it reviewed the filled-chip version that was scrapped after rendering, four commits ago. It does not apply to the current branch. This comment supersedes it.
Known, deliberate, and not fixed here
- The header prints the raw
mcp__linear__list_issueswhile the member row below prints the splitLinear / list_issues. Reconciling them changes what a tool is called. - A url-only call still falls through to a JSON preview clipped at 28 chars (
urlis aPRIMARY_ARG_KEYbut not aBRIEF_ARG_KEY); fixing it moves mobile's summary string too. browser.openandtools/readboth take the generic wrench, since the category resolver deliberately does not parse dot/slash names — so between those two, spacing rather than the glyph carries the boundary.
Each is a naming decision rather than a layout one, and each is pinned by test so it stays visible.








A run of several tool calls collapsed to one joined string, so you could not tell which tools were in it:
Names and arguments run together, separated by a middle dot that also occurs inside
browser.openandtools/read— three calls read as one string. The overflow is cut mid-token, so the last thing you read is an unbalanced brace and the third member is a stub. Opened, the member rows sat flush with the header and with the message content around them (mt-1, no indent), so the batch had no visible end.What changed
Presentation only. Both changes use the strings the row already renders — the tool name as-is and the existing
briefToolArgpreview. Nothing here derives a new value or changes how a name is parsed.Each member is glyph-led in the collapsed header. Every call in the run is preceded by its own category glyph and separated by spacing, so the boundary between calls is no longer a character that also occurs inside the names. The list stays on one line and truncates as a whole, exactly as it did before this branch — it never wraps.
+N moresits outside the truncating span, so the count of what is not shown survives a pane too narrow to print the list; today an 11-call batch renders three names with nothing to say the other eight happened.Opened members are indented (
pl-4), which is what marks where the run ends.Members carry
data-tool-run-memberfor styling and test hooks.Rendered, not assumed
Captured on an isolated dev instance (CDP + Playwright, seeded transcript read through the real
nativeChat:readSession), five calls in one run, at both a 1728px window and a 1000px one:offsetTop+2 moreThis is the second design. The first used filled
bg-accentchips withflex-wrap. Rendered, it was wrong twice over:accentis reserved for hover/active row backgrounds and its only full-strength use in native chat is on payload and diff surfaces, so each chip read as a shrunken content block; and at a 337px pane each chip measured 274–288px against a 297px container, so every one took its own line, the header tripled from 24px to 72px, and the5×centred against the block landed beside the second member as though it counted that call alone. Themax-w-72cap also clippedbrowser.openmid-token — the same defect this PR set out to remove, relocated into a chip. The glyph was already marking each member's start, so the fill was carrying nothing the icon wasn't.Shared selector
toolRunSummaryMemberskeeps the run's leading calls apart instead of pre-joining them.summarizeToolRunnow derives its string from it, so:MobileNativeChatToolRun) is byte-identical — its assertions pass untouched and the full mobile suite is green;Known weakness
The rationale is that each member's glyph marks its own boundary, and that is only partly true today.
nativeChatToolCategorydeliberately does not parse slash- or dot-style names, sobrowser.openandtools/readboth resolve to the generic wrench — at wide widths two of three boundaries are marked by identical icons and the real delimiter is the spacing. The expanded list differentiates properly (plug / wrench / wrench / magnifier / terminal). Fixing this means teaching the category resolver about those name shapes, which is the naming change deliberately excluded below.Deliberately not fixed
Both are naming decisions rather than layout ones, and both are pinned by test so they stay visible:
mcp__linear__list_issueswhile the row directly beneath printsLinear / list_issues. Reconciling them means running the header throughNativeChatToolName, which changes what a tool is called.urlstill falls through to a clipped JSON preview. This is the real source of{"url":"https://example.com"in the original screenshot:urlis aPRIMARY_ARG_KEYbut not aBRIEF_ARG_KEY, sobriefToolArgfalls through to the bounded JSON preview and slices it at 28 characters. AddingurltoBRIEF_ARG_KEYSfixes it in one word — and moves mobile's summary string too, so it belongs in its own change.Verification
pnpm tc— cleanpnpm run check:code-quality:changed— passed, React Doctor included (member keys use the file's own content-signature idiom, not the array index)pnpm test src/renderer/src/components/native-chat src/shared/native-chat-tool-summary.test.ts— 113 files, 1207 tests passingpnpm testinmobile/— 516 files, 4204 tests passingSix existing assertions were updated, all for one reason: the header no longer emits a single joined text node, so
getByText('shell pnpm test')no longer matches —getByTextcompares an element's direct text nodes, and the argument now sits in its own muted span. Their intent is preserved; they query the run header and assert its text content. One markup fix came out of that: a member's name and argument share a single text run, so the header still readsshell pnpm testto a screen reader and to a text selection rather thanshellpnpm test.Not applied to
MobileNativeChatToolRun, which has its own header markup.