fix(web): show tool call output instead of the duplicated command - #6496
fix(web): show tool call output instead of the duplicated command#6496myNameArnav wants to merge 8 commits into
Conversation
ACP providers (Grok, Cursor) and Claude mirror the command into the tool call's detail field, and OpenCode fills both command and detail with the same output, so expanding a tool call rendered the same text twice. Command tools whose detail is just the command now prefer the actual output summary, and the expanded body drops exact duplicate blocks so Codex's raw command no longer repeats either. Worked with OpenCode on macOS.
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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 |
Command results that write only to stderr (failed builds, missing modules) shipped no output summary: the server projection dropped stderr-only rawOutput, and both clients' output summarizers stopped at stdout. Add the stderr fallback at all three layers so the expanded tool row shows the error line instead of nothing.
ApprovabilityVerdict: Approved 660c416 This is a focused UI bug fix that prevents duplicate command text from appearing in tool call displays. The changes are limited to presentation logic with comprehensive test coverage, and don't affect data processing or storage. You can customize Macroscope's approvability policy. Learn more. |
|
Seems like #6498 and this PR fix the same issue. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Want fixes drafted automatically? Bugbot Autofix can create code changes for findings. A team admin can enable Autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit b8d7c64. Configure here.
Dismissing prior approval to re-evaluate 660c416

Problem
Expanding a tool call in the work log showed the same information twice. Providers mirror the command into more than one payload field:
detailequal todata.command(deriveToolActivityPresentationreturnsdetail: commandfor command executions).commandanddetailwith the tool's output.rawCommandanddetail.detailasBash: <command>.buildToolCallExpandedBodyjoinedcommand/rawCommandanddetailas separate blocks with no dedupe, so the same text rendered twice — and the real output never showed for Grok.Fix
detailis just the command now prefer the actual output summary (rawOutput) instead — webextractToolDetailand the mobilethreadActivitymirror.buildToolCallExpandedBodydrops exact duplicate blocks, covering the Codex raw-vs-detail case and file paths that repeatdetail.git status+ one line of output.Same fix path covers every harness (Grok, Cursor, OpenCode, Codex, Claude); mobile rendered
detailonly once and now gets the output summary too.Before / After
Expanded
git statustool call, same thread:Before:
git statustwice. After:git statusonce plus the actual output (On branch applib/fix-tool-output).Worked with OpenCode on macOS.
Note
Low Risk
Presentation-only changes to work-log derivation and expanded tool bodies; no auth or persistence changes, with broad test coverage for provider-specific payloads.
Overview
Fixes expanded work-log tool rows that repeated the same command text and hid real output when providers mirror the command into
detail(Grok/ACP, Claude) or duplicate it acrosscommand/detail/rawCommand(OpenCode, Codex).Web
extractToolDetailnow treats command tools whosedetailonly repeats the command as a mirror and substitutes a compact stdout/stderr/content summary fromrawOutputinstead. MobiletoDerivedWorkLogEntryapplies the same rule so previews and expanded bodies show output (e.g.git statusplus one line of branch status).summarizeToolRawOutput(web + mobile) and serverprojectRawOutputalso fall back to stderr when stdout is empty.Expanded bodies on web run
dedupeToolCallExpandedBodyBlocksbefore joining blocks so identical command/raw/detail strings render once. Mobile collapses in-progress and completed command rows bytoolCallIdso lifecycle merge still works afterdetailbecomes an output summary on completion.Reviewed by Cursor Bugbot for commit 660c416. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Fix tool call rows to show output summary instead of duplicating the command
detailfield mirrors the command string,extractToolDetailinsession-logic.tsnow returns a concise output summary (stdout, stderr, or file count) instead of repeating the command.summarizeToolRawOutputandsummarizeToolTextOutputhelpers produce short summaries from raw output, including stderr-only results.toolCallIdnow collapse together viaderiveToolLifecycleCollapseKey, even when detail differs between in-progress and completed states.dedupeToolCallExpandedBodyBlocksinMessagesTimeline.logic.tsstrips duplicate blocks from expanded tool call bodies before rendering.Macroscope summarized 660c416.