Skip to content

[Bug]: Bash command shown twice in tool-call activity — dedup check doesn't strip the "Bash: " prefix baked into detail #7711

Description

@harshiempire

Before submitting

Area

apps/web

Steps to reproduce

  1. Run any Bash tool call in a Claude-provider thread (desktop or web).
  2. Expand the tool-call activity in the chat timeline.

Expected behavior

The command is shown once.

Actual behavior

The command is shown twice: once as the plain command preview, and once again below it prefixed with Bash: .

Root cause (traced against the live event log + source)

The canonical item.completed activity carries the same command in two places on one payload:

  • payload.data.input.command — bare command, e.g. cd ... && grep ...
  • payload.detail — the same command with a tool-name prefix baked in, e.g. Bash: cd ... && grep ...

extractToolDetail (apps/web/src/session-logic.ts) is designed to suppress detail when it's redundant with the already-rendered command preview — it normalizes both strings via normalizePreviewForComparison → normalizeCompactToolLabel and only returns detail if the normalized strings differ.

normalizeCompactToolLabel only strips a trailing complete/completed suffix:

function normalizeCompactToolLabel(value: string): string {
  return value.replace(/\s+(?:complete|completed)\s*$/i, "").trim();
}

It never strips the leading "<ToolName>: " prefix that's already baked into payload.detail. So normalizedCommand ("cd ... && grep ...") and normalizedDetail ("bash: cd ... && grep ...") never match, the dedup check in extractToolDetail treats them as different content, and the redundant detail line renders anyway — directly under the command that was already shown.

Example payload from a live session (Claude provider)

{
  "type": "item.completed",
  "payload": {
    "itemType": "command_execution",
    "title": "Command run",
    "detail": "Bash: cd /Users/.../eksaq-platform/knowledge-base && grep -n -E \"F0[0-9][0-9]\" TRACKER.md | grep -i -E \"hpc|F0\" | sed -n '1,120p'",
    "data": {
      "toolName": "Bash",
      "input": {
        "command": "cd /Users/.../eksaq-platform/knowledge-base && grep -n -E \"F0[0-9][0-9]\" TRACKER.md | grep -i -E \"hpc|F0\" | sed -n '1,120p'"
      }
    }
  }
}
Image

Impact

Cosmetic, but consistently reproducible on every Bash tool call — clutters the timeline for any thread with meaningful shell usage.

Version or commit

Nightly, macOS desktop, Claude provider.

Suggested fix

Strip the "<ToolName>: " prefix (or any leading toolName + ": ") from detail before the redundancy comparison in extractToolDetail/normalizePreviewForComparison, so it's correctly recognized as duplicate content when it only differs from the command preview by that prefix.

Activity

  1. t3dotgg commented on Sep 3, 2026

    @t3dotgg
    Member

    Note

    🤖 GPT-5.6 Sol responding on behalf of Theo

    Fixed by PR #9120.

    The shared work log now removes synthetic tool-name command echoes, including truncated prefixes. Expanded command rows on web and mobile no longer repeat the command in the header.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions