Skip to content
This repository was archived by the owner on Apr 14, 2026. It is now read-only.

feat: group consecutive tool calls with verb labels and improved UI#94

Closed
tellaho wants to merge 10 commits intomainfrom
tho/tool-call-grouping-v3
Closed

feat: group consecutive tool calls with verb labels and improved UI#94
tellaho wants to merge 10 commits intomainfrom
tho/tool-call-grouping-v3

Conversation

@tellaho
Copy link
Copy Markdown
Collaborator

@tellaho tellaho commented Apr 3, 2026

Summary

  • Consecutive same-type tool calls collapse into expandable groups ("Edited 3 files", "Ran 2 commands") with animated slide-in transition
  • Solo tool calls show past-tense verb + filename labels ("Edited content-design-review.md") with layout-animated trigger that hides filename on expand
  • Per-tool artifact candidates instead of single primary host per message — each tool call shows its own open-file action
  • Artifact actions render as inline filename + arrow-up-right link below code block, clickable to open file
  • Groups split by execution outcome so errors aren't hidden behind success labels
  • Redundant bottom labels (e.g. bare "Ran") hidden when they add no info beyond the trigger
  • Extracted shared ToolCallTrigger component used by both single and grouped tool calls — styling changes (foreground color, chevron, animations) only need to happen in one place
  • Extracted ToolChainCards and toolLabelUtils into dedicated files
Screen.Recording.2026-04-07.at.1.38.33.PM.mov

Test plan

  • Verify consecutive same-type tool calls collapse into expandable group row
  • Verify solo tool calls show "Edited filename.md" with chevron, filename disappears on expand
  • Verify expanding solo tool call shows content with left border + filename link below
  • Verify clicking filename link opens the file
  • Verify grouped items show just filename with arrow-up-right link
  • Verify failed tool calls are not grouped with successful ones
  • Verify labels like "Ran" or "Delegate" don't show redundantly below expanded content
  • Verify both single and grouped triggers use foreground text color when collapsed

🤖 Generated with Claude Code

@tellaho tellaho marked this pull request as ready for review April 7, 2026 23:13
@tellaho tellaho requested a review from wesbillman as a code owner April 7, 2026 23:13
@tellaho tellaho marked this pull request as draft April 7, 2026 23:15
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 25aa644be5

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread src/features/chat/hooks/ArtifactPolicyContext.tsx Outdated
tellaho and others added 8 commits April 7, 2026 13:24
Consecutive same-type tool calls collapse into expandable groups
("Wrote 3 files", "Ran 2 commands") with animated slide-in transition.
Solo items show past-tense verbs ("Wrote foo.html", "Read", "Ran").
Extract ToolChainCards and toolLabelUtils into dedicated files.
Make tool calls full-width, hide result labels, and add context-aware
spacing between tool and prose sections.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
… filenames

- Distribute artifact candidates per tool call instead of single primary host
- Solo tool calls: animated expand with layout transitions for verb/filename
  in trigger, slide-in content with left border matching grouped style
- Grouped items: show just filename with inline open-file arrow link
- Extract filenames from tool name, args path keys, or result text
- Use "Edited" verb for write operations, inline ArrowUpRight icon for open
- Artifact actions render as clickable label+arrow, not separate link below

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Grouping now keys on both tool type and status, so failed or
executing calls are never collapsed with completed ones. This
prevents "Edited 2 files" from hiding a failure in the group.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Only show the filename label below expanded content when there's a
filename detail or artifact candidate. Labels like "Ran" or "Delegate"
that just repeat the trigger text are now hidden.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…ction

- toolLabelUtils: 20 tests covering getToolType, getToolDetail, getToolVerb,
  getToolLabel, and extractFileDetail (from name, args, and result text)
- MessageBubble: groups consecutive same-type calls, splits by outcome,
  verb labels with filenames, filename extraction from args path keys
- ToolCallAdapter: redundant label hidden when no detail, filename shown
  below content when displayDetail is provided

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…lCallTrigger

Extracts a shared ToolCallTrigger component so styling changes (like
foreground color) apply to both single and grouped tool calls at once.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@tellaho tellaho force-pushed the tho/tool-call-grouping-v3 branch from 25aa644 to 39c5a2a Compare April 7, 2026 23:35
@tellaho tellaho marked this pull request as ready for review April 7, 2026 23:39
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 39c5a2a4d2

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment on lines +160 to +163
<ToolCallTrigger
label={label}
expanded={expanded}
onClick={() => setExpanded((prev) => !prev)}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Surface grouped tool-call status in collapsed headers

When multiple tool calls are grouped, the collapsed row renders only label={label} and never passes a status badge, so a group of failed or still-running calls is shown as a success-like label such as “Edited 2 files” until the user expands it. This hides error/running state in the default view (especially in long tool chains) and undermines the commit’s goal of keeping failures visible; please compute the group status and pass an appropriate badge (e.g. via getStatusBadge) into ToolCallTrigger for grouped rows.

Useful? React with 👍 / 👎.

tellaho and others added 2 commits April 7, 2026 13:46
…on grouped rows

- Pick the first allowed candidate as primaryCandidate per tool call
  instead of blindly using candidates[0], so file-open actions work
  even when the top-ranked path is out of scope.
- Compute worst-case status across grouped tool calls and pass the
  badge to ToolCallTrigger so errors/running state are visible in
  collapsed group headers.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- ArtifactPolicyContext: verify first allowed candidate becomes primary
  when top-ranked candidate is outside allowed roots
- ToolChainCards: verify error/running badges surface on collapsed
  group headers, and successful groups show no badge

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@tellaho tellaho closed this Apr 9, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant