Repository navigation
feat(native-chat): compact tool runs with a bounded call list - #26285
Conversation
An opened run drew every call's payload at full height, so live work lengthened the page.
📝 WalkthroughWalkthroughTool and diff details now use height-animated disclosures that start closed. Tool runs delegate member rendering and support bounded scrolling, remembered scroll positions, and member reveal. Transcript slots identify rows that continue a turn, and the renderer adjusts their spacing and assistant controls. Tests cover tool detail behavior, tool-run member scrolling, and transcript continuation. Priority: ➖ Normal Merge Risk: 🔵 Low · up to During live work, a call list may stop following new output until the reader scrolls down. The issue is localized and can be fixed before merge or accepted as a bounded follow-up. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 56.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 25 functions across 26 files. (1 skipped: 1 unsupported.)
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.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
40efc1ca-8542-49e3-8b11-b3e812abbcf9
📒 Files selected for processing (29)
src/renderer/src/components/native-chat/NativeChatDiffCard.tsxsrc/renderer/src/components/native-chat/NativeChatExpandable.tsxsrc/renderer/src/components/native-chat/NativeChatMessageList.task-list-frames.test.tsxsrc/renderer/src/components/native-chat/NativeChatMessageList.tool-stream-cost.test.tsxsrc/renderer/src/components/native-chat/NativeChatMessageRow.tsxsrc/renderer/src/components/native-chat/NativeChatReasoningRow.tsxsrc/renderer/src/components/native-chat/NativeChatSubagentRun.test.tsxsrc/renderer/src/components/native-chat/NativeChatTaskList.tsxsrc/renderer/src/components/native-chat/NativeChatToolLine.test.tsxsrc/renderer/src/components/native-chat/NativeChatToolLine.tsxsrc/renderer/src/components/native-chat/NativeChatToolRun.appearance.test.tsxsrc/renderer/src/components/native-chat/NativeChatToolRun.ask-row.test.tsxsrc/renderer/src/components/native-chat/NativeChatToolRun.identity.test.tsxsrc/renderer/src/components/native-chat/NativeChatToolRun.members.test.tsxsrc/renderer/src/components/native-chat/NativeChatToolRun.test.tsxsrc/renderer/src/components/native-chat/NativeChatToolRun.tsxsrc/renderer/src/components/native-chat/NativeChatToolRunCallCounts.test.tsxsrc/renderer/src/components/native-chat/NativeChatToolRunMemberList.tsxsrc/renderer/src/components/native-chat/NativeChatToolRunMembers.tsxsrc/renderer/src/components/native-chat/NativeChatTranscriptRow.tsxsrc/renderer/src/components/native-chat/native-chat-appearance.csssrc/renderer/src/components/native-chat/native-chat-disclosure-store.tssrc/renderer/src/components/native-chat/native-chat-edit-cards.tssrc/renderer/src/components/native-chat/native-chat-tool-line-label.tssrc/renderer/src/components/native-chat/native-chat-tool-run-members-test-support.tssrc/renderer/src/components/native-chat/native-chat-transcript-slots.test.tssrc/renderer/src/components/native-chat/native-chat-transcript-slots.tssrc/renderer/src/components/ui/collapsible.tsxsrc/shared/native-chat-tool-pairing.ts
💤 Files with no reviewable changes (2)
- src/renderer/src/components/native-chat/native-chat-edit-cards.ts
- src/shared/native-chat-tool-pairing.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.
| useEffect(() => { | ||
| const scroller = scrollerRef.current | ||
| const content = contentRef.current | ||
| if (!scroller || !content || typeof ResizeObserver === 'undefined') { | ||
| return | ||
| } | ||
| let roomForDetails = 0 | ||
| const observer = new ResizeObserver(() => { | ||
| const opened = openDetailHeight(content) | ||
| if (opened !== roomForDetails) { | ||
| roomForDetails = opened | ||
| // A variable, not state: a detail animating open would re-render every frame. | ||
| scroller.style.setProperty('--native-chat-opened-detail', `${opened}px`) | ||
| } | ||
| readPosition() | ||
| }) | ||
| observer.observe(content) | ||
| // The box's cap moves with an opened detail, which changes what lies past its edges. | ||
| observer.observe(scroller) | ||
| return () => observer.disconnect() | ||
| }, [readPosition]) |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
🔎 Supported by static analysis
🏁 Script executed:
set -eu
printf '%s\n' '--- NativeChatToolRunMembers.tsx ---'
nl -ba src/renderer/src/components/native-chat/NativeChatToolRunMembers.tsx | sed -n '1,180p'
printf '%s\n' '--- NativeChatToolLine.tsx ---'
nl -ba src/renderer/src/components/native-chat/NativeChatToolLine.tsx | sed -n '1,150p'
printf '%s\n' '--- NativeChatToolRun.tsx relevant references ---'
rg -n -C 8 -F -- 'NativeChatToolRunMembers' src/renderer/src/components/native-chat/NativeChatToolRun.tsx
printf '%s\n' '--- resize/follow/anchor references ---'
rg -n -S -- 'overflow-anchor|scrollTop|scrollHeight|followKey|max-h-64|ResizeObserver' src/renderer/src/components/native-chat src/renderer/src | head -240
printf '%s\n' '--- relevant tests ---'
nl -ba src/renderer/src/components/native-chat/NativeChatToolRun.members.test.tsx | sed -n '1,180p'
printf '%s\n' '--- base-to-head diff for member list ---'
git diff --unified=35 76d1b7bf29932f6e1edfb6b0b34d65c5c88e5f55 bdec59ef21849a4233f990d6272d7035eb224dc6 -- src/renderer/src/components/native-chat/NativeChatToolRunMembers.tsx src/renderer/src/components/native-chat/NativeChatToolLine.tsx src/renderer/src/components/native-chat/NativeChatToolRun.tsxRepository: stablyai/orca
Length of output: 42614
🏁 Script executed:
set -eu
printf '%s\n' '--- truncateToolDetail ---'
rg -n -C 12 -F -- 'function truncateToolDetail' src/renderer/src/components/native-chat src/renderer/src
printf '%s\n' '--- truncateToolDetail references ---'
rg -n -C 8 -F -- 'truncateToolDetail' src/renderer/src/components/native-chat
printf '%s\n' '--- NativeChatExpandable ---'
rg -n -C 10 -F -- 'export function NativeChatExpandable' src/renderer/src/components/native-chat
printf '%s\n' '--- result pairing and member rendering ---'
nl -ba src/renderer/src/components/native-chat/NativeChatToolRunMemberList.tsx | sed -n '1,180p'
printf '%s\n' '--- focused tests for expandable output and live updates ---'
rg -n -C 12 -S -- 'output|expanded|ResizeObserver|followKey|live' src/renderer/src/components/native-chat/*Tool*test* src/renderer/src/components/native-chat/*Member*test* || test "$?" -eq 1Repository: stablyai/orca
Length of output: 178
🏁 Script executed:
set -eu
printf '%s\n' '--- native-chat-tool-summary.ts ---'
nl -ba src/renderer/src/components/native-chat/native-chat-tool-summary.ts | sed -n '1,180p'
printf '%s\n' '--- NativeChatExpandable declaration ---'
rg -n -C 12 -F -- 'NativeChatExpandable' src/renderer/src/components/native-chat/NativeChatExpandable.tsx src/renderer/src/components/native-chat/NativeChatExpandable.* || test "$?" -eq 1Repository: stablyai/orca
Length of output: 3961
🏁 Script executed:
set -eu
nl -ba src/shared/native-chat-tool-summary.ts | sed -n '1,220p'Repository: stablyai/orca
Length of output: 9820
Keep the outer member list pinned when an existing result grows.
When a live run follows its end, followKey={blocks.length + asideCount} does not change when an existing paired result receives more output. truncateToolDetail allows output to grow up to 4000 characters, and the nested max-h-64 cap only limits the inner <pre>. Before that cap, the outer content can grow.
The resize callback only calls readPosition(). It does not restore the outer scroller to the new bottom. The resulting gap can disable following. Capture the previous follow state before reading the new position so a reader who scrolled away is not overridden.
Suggested fix
const observer = new ResizeObserver(() => {
+ const wasFollowingEnd = followsEndRef.current
const opened = openDetailHeight(content)
if (opened !== roomForDetails) {
roomForDetails = opened
// A variable, not state: a detail animating open would re-render every frame.
scroller.style.setProperty('--native-chat-opened-detail', `${opened}px`)
}
+ if (wasFollowingEnd) {
+ scroller.scrollTop = scroller.scrollHeight
+ }
readPosition()
})📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| useEffect(() => { | |
| const scroller = scrollerRef.current | |
| const content = contentRef.current | |
| if (!scroller || !content || typeof ResizeObserver === 'undefined') { | |
| return | |
| } | |
| let roomForDetails = 0 | |
| const observer = new ResizeObserver(() => { | |
| const opened = openDetailHeight(content) | |
| if (opened !== roomForDetails) { | |
| roomForDetails = opened | |
| // A variable, not state: a detail animating open would re-render every frame. | |
| scroller.style.setProperty('--native-chat-opened-detail', `${opened}px`) | |
| } | |
| readPosition() | |
| }) | |
| observer.observe(content) | |
| // The box's cap moves with an opened detail, which changes what lies past its edges. | |
| observer.observe(scroller) | |
| return () => observer.disconnect() | |
| }, [readPosition]) | |
| useEffect(() => { | |
| const scroller = scrollerRef.current | |
| const content = contentRef.current | |
| if (!scroller || !content || typeof ResizeObserver === 'undefined') { | |
| return | |
| } | |
| let roomForDetails = 0 | |
| const observer = new ResizeObserver(() => { | |
| const wasFollowingEnd = followsEndRef.current | |
| const opened = openDetailHeight(content) | |
| if (opened !== roomForDetails) { | |
| roomForDetails = opened | |
| // A variable, not state: a detail animating open would re-render every frame. | |
| scroller.style.setProperty('--native-chat-opened-detail', `${opened}px`) | |
| } | |
| if (wasFollowingEnd) { | |
| scroller.scrollTop = scroller.scrollHeight | |
| } | |
| readPosition() | |
| }) | |
| observer.observe(content) | |
| // The box's cap moves with an opened detail, which changes what lies past its edges. | |
| observer.observe(scroller) | |
| return () => observer.disconnect() | |
| }, [readPosition]) |
ELI5
When the agent runs a batch of tool calls, the chat shows one line for it, like "Ran 14 commands". Clicking that line used to dump every call's full input and output into the page, so the page got very long, especially while the agent was still working. Now it opens a short, tidy list you can scroll inside, and you click a single call to see what it produced.
What Changed
Before
After
Mechanism
animation="height"option, which reuses an animation already in the stylesheet.This builds on #26048, which made thoughts part of a batch. Thoughts appear in the new list as the rows that change provides.
Why
Watching a long turn meant the page kept running away from you, and an opened batch was mostly noise: raw JSON arguments repeated what the line above already said. The goal was the behaviour of other agent chat apps, where a batch is a compact list and detail is one click further in.
Visual Proof
Before:
CleanShot.2026-10-07.at.5.59.36.PM.mp4
After:
CleanShot.2026-10-07.at.5.57.06.PM.mp4
Testing
Unit tests added for: the box following new work and stopping when the reader scrolls up; restoring position after the row is unmounted; forgetting it on close; rows handed in by the transcript being drawn in order among the calls; a call opening to output only; an unapplied edit opening to its change; a running command offering nothing to open; a row counting as "continuing its turn" only when the agent's next step follows.
Existing tests that assumed every payload opens at once were updated to open a call first.
Checked in the running app on macOS: the cap (288px, growing with an opened detail, stopping at half the window), the edge fades at top, middle and end, the open/close animation frame by frame, and the 8px gaps.
Not tested on Linux or Windows. The change is renderer-only CSS and React with no platform-specific code. Not tested over SSH; nothing here touches the host or the wire.
I manually tested these changes locally
Automated tests added/updated, or explained why not below
Agent skill upstream boundary
docs/reference/agent-skill-sharing-upstream-boundary.mdand copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)