fix(web): stop tool-name prefix from duplicating command detail - #7799
fix(web): stop tool-name prefix from duplicating command detail#7799Exotic209093 wants to merge 3 commits into
Conversation
extractToolDetail compared payload.detail against the command preview verbatim, so a detail like "Bash: <cmd>" never matched the bare command and rendered as a second, redundant line under every Bash tool-call activity. Strip a leading "<toolName>: " prefix (from payload.data.toolName) before the redundancy comparison. Fixes pingdotgg#7711
|
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 |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a8af60d9ce
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
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 a8af60d. Configure here.
ApprovabilityVerdict: Approved at Macroscope's review found this PR approvable — This is a well-scoped UI display fix that prevents duplicated tool-name prefixes from showing in command detail. The changes follow existing patterns, are well-tested, and only affect display normalization without modifying stored data or core logic. You can add or adjust custom eligibility rules. Learn more. |
Bots review caught that the previous approach read payload.data.toolName, but ActivityPayloadProjection.ts rebuilds command-activity data from scratch server-side and never copies toolName across, so the check was a no-op on real traffic (only the test's synthetic payload had the field). Detail's redundancy check now matches the prefix structurally: if detail ends with the (already-projected) command or raw command preceded by a "<word>: " heading, treat it as the same duplicate case a literal match already covers. Added a negative test guarding against detail that merely happens to contain the command as a trailing substring.
|
Good catch — |
Macroscope flagged a real false positive in the previous structural prefix match: a legitimate detail like "warning: true" was wrongly treated as a duplicate of command "true" purely because it happened to end with the command text after a colon-terminated label. The safer, precise fix both bots originally suggested: preserve data.toolName through projectActivityPayload for command activities, matching what the MCP tool-call branch already does. The web client's prefix strip goes back to comparing against that exact field instead of guessing at any "word:" heading, so only a genuine "<toolName>: <command>" duplicate gets suppressed.
|
Updated again: Macroscope's follow-up finding was right too — the structural suffix match could drop a legitimate detail like |
|
Note 🤖 GPT-6 Astra (preview) responding on behalf of Theo This was closed as part of an automated cleanup pass. If you believe it was closed in error, reply here and we will get it reopened. Closing as superseded by merged #9120. Main preserves tool names and removes synthetic command echoes in shared work-log code, so web and mobile use the same rule. Genuine output remains visible even when it matches the command. |

Summary
Fixes #7711.
item.completedpayloads for Bash tool calls carry the same command in two places:payload.data.input.command(bare) andpayload.detail(the same command with aBash:prefix baked in).extractToolDetailinapps/web/src/session-logic.tsis supposed to suppressdetailwhen it's redundant with the already-rendered command preview, but it only stripped a trailingcomplete/completedsuffix before comparing — never the leading<toolName>:prefix. So the normalized command and normalized detail never matched, and the redundant detail line rendered a second time under every Bash tool call.Fix
Strip a leading
"<toolName>: "prefix (read frompayload.data.toolName) fromdetailbefore the redundancy comparison inextractToolDetail.Test plan
session-logic.command-output.test.tsreproducing the exact payload shape from the issue (command indata.command, detail prefixed withBash:); confirmed it fails before the fix and passes after.vp test run apps/web/src/session-logic.command-output.test.ts apps/web/src/session-logic.test.ts— 79 passed.vp run --filter @t3tools/web typecheck— clean.vp linton changed files — clean.Note
Low Risk
Small display-only change in work-log detail comparison, with a targeted regression test and no auth or data-handling impact.
Overview
Stops work-log command rows from repeating the same command under Bash (and similar) tool calls.
extractToolDetailalready hiddetailwhen it matched the command preview, but payloads often prefix detail with"<toolName>: ". The comparison now strips that prefix (fromdata.toolName) so redundant detail is dropped. Adds a regression test for the Bash-prefixed payload shape.Reviewed by Cursor Bugbot for commit a8af60d. Configure here.
Note
Strip tool-name prefix from command detail in web output
projectActivityPayloadnow propagatesdata.toolNameinto the projected payload for non-mcp_tool_callitems, so the web client can detect redundant headings.stripToolNamePrefixhelper in session-logic.ts which removes a case-insensitive<toolName>:prefix from a string;extractToolDetailapplies it before comparing detail to the command preview.warning: trueare preserved.stripToolNamePrefixonly strips when the prefix exactly matchespayload.data.toolName; mislabeled or missingtoolNamevalues will leave the prefix visible rather than dropping the detail.Macroscope summarized 6b5e461.