Skip to content

fix(web): show tool call output instead of the duplicated command - #6496

Open
myNameArnav wants to merge 8 commits into
pingdotgg:mainfrom
myNameArnav:fix/expanded-tool-call-output
Open

fix(web): show tool call output instead of the duplicated command#6496
myNameArnav wants to merge 8 commits into
pingdotgg:mainfrom
myNameArnav:fix/expanded-tool-call-output

Conversation

@myNameArnav

@myNameArnav myNameArnav commented Aug 13, 2026

Copy link
Copy Markdown

Problem

Expanding a tool call in the work log showed the same information twice. Providers mirror the command into more than one payload field:

  • Grok/Cursor (ACP) set detail equal to data.command (deriveToolActivityPresentation returns detail: command for command executions).
  • OpenCode fills both command and detail with the tool's output.
  • Codex repeats the raw wrapped command in both rawCommand and detail.
  • Claude mirrors the command into detail as Bash: <command>.

buildToolCallExpandedBody joined command/rawCommand and detail as separate blocks with no dedupe, so the same text rendered twice — and the real output never showed for Grok.

Fix

  • Show the output: command tools whose detail is just the command now prefer the actual output summary (rawOutput) instead — web extractToolDetail and the mobile threadActivity mirror.
  • Dedupe the renderer: buildToolCallExpandedBody drops exact duplicate blocks, covering the Codex raw-vs-detail case and file paths that repeat detail.
  • The header preview ("Ran command - git status") is unchanged; the expanded body now reads git status + one line of output.

Same fix path covers every harness (Grok, Cursor, OpenCode, Codex, Claude); mobile rendered detail only once and now gets the output summary too.

Before / After

Expanded git status tool call, same thread:

Before After
image image

Before: git status twice. After: git status once 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 across command/detail/rawCommand (OpenCode, Codex).

Web extractToolDetail now treats command tools whose detail only repeats the command as a mirror and substitutes a compact stdout/stderr/content summary from rawOutput instead. Mobile toDerivedWorkLogEntry applies the same rule so previews and expanded bodies show output (e.g. git status plus one line of branch status). summarizeToolRawOutput (web + mobile) and server projectRawOutput also fall back to stderr when stdout is empty.

Expanded bodies on web run dedupeToolCallExpandedBodyBlocks before joining blocks so identical command/raw/detail strings render once. Mobile collapses in-progress and completed command rows by toolCallId so lifecycle merge still works after detail becomes 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

  • When a tool call's detail field mirrors the command string, extractToolDetail in session-logic.ts now returns a concise output summary (stdout, stderr, or file count) instead of repeating the command.
  • New summarizeToolRawOutput and summarizeToolTextOutput helpers produce short summaries from raw output, including stderr-only results.
  • Tool call rows with the same toolCallId now collapse together via deriveToolLifecycleCollapseKey, even when detail differs between in-progress and completed states.
  • dedupeToolCallExpandedBodyBlocks in MessagesTimeline.logic.ts strips duplicate blocks from expanded tool call bodies before rendering.
  • Behavioral Change: Detail text for command-execution rows will change from repeating the command to showing output summaries where available.

Macroscope summarized 660c416.

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.
@coderabbitai

coderabbitai Bot commented Aug 13, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 882206f5-4d82-4dd6-bd0f-0eda907b7b4f

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added vouch:unvouched PR author is not yet trusted in the VOUCHED list. size:L 100-499 changed lines (additions + deletions). labels Aug 13, 2026
Comment thread apps/mobile/src/lib/threadActivity.ts
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.
macroscopeapp[bot]
macroscopeapp Bot previously approved these changes Aug 13, 2026
@macroscopeapp

macroscopeapp Bot commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: 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.

@myNameArnav

Copy link
Copy Markdown
Author

Seems like #6498 and this PR fix the same issue.

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.

Fix All in Cursor

❌ 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.

Comment thread apps/mobile/src/lib/threadActivity.ts
@macroscopeapp
macroscopeapp Bot dismissed their stale review August 13, 2026 19:15

Dismissing prior approval to re-evaluate 660c416

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L 100-499 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant