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 10 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. |
Dismissing prior approval to re-evaluate 660c416
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.
Reviewed by Cursor Bugbot for commit 537ba6f. Configure here.
| } | ||
| // The provider mirrored the command into `detail` (ACP/Grok, Claude): | ||
| // the row already shows the command, so surface the actual output. | ||
| return summarizeRawOutputForDetail(payload, normalizedHeading); |
There was a problem hiding this comment.
OpenCode rows collapse together
Medium Severity
When a command tool’s detail mirrors the command and there is no output summary, detail is now cleared. The fallback collapse key still keys on detail, so providers without toolCallId (OpenCode in the new tests) share [itemType, label, ""]. Adjacent distinct tool.updated rows with the same title incorrectly merge into one row.
Additional Locations (2)
Reviewed by Cursor Bugbot for commit 537ba6f. Configure here.
|
Closing: superseded by #4083, merged to main (143f713). This branch's feature (show command output instead of duplicated command in work rows) landed there with a different implementation. Note: the collapse regression Bugbot flagged here (adjacent distinct tool rows without a toolCallId merging into one once detail is cleared — 'OpenCode rows collapse together') is present in the merged implementation too, since main's collapse key still keys on |
|
Superseded by #4083 (merged). Closing. |


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, persistence, or execution paths touched.
Overview
Fixes expanded work-log tool rows that repeated the same command text and hid real output when providers mirror the command into
detail(ACP/Grok, Claude) or duplicate it acrosscommand/rawCommand/detail(OpenCode, Codex).Web and mobile derivation now treat command executions whose
detailequals the command as a mirror and setdetailfrom a short stdout/stderr/content summary viasummarizeToolRawOutput(stderr-only results included). Mobile also keys tool lifecycle collapse ontoolCallIdso in-progress and completed rows still merge afterdetailbecomes an output summary.Web expanded body uses
dedupeToolCallExpandedBodyBlocksbefore joining blocks so identical command/raw/detail strings render once. Server activity payload projection applies the same stderr summarization when slimmingrawOutputfor clients.Reviewed by Cursor Bugbot for commit 537ba6f. 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 537ba6f.