Skip to content

refactor(workspaces): tighten tool call row and enrich summaries - #684

Merged
urjitc merged 1 commit into
mainfrom
codex/tool-call-ui-dedup
Jul 28, 2026
Merged

refactor(workspaces): tighten tool call row and enrich summaries#684
urjitc merged 1 commit into
mainfrom
codex/tool-call-ui-dedup

Conversation

@urjitc

@urjitc urjitc commented Jul 28, 2026

Copy link
Copy Markdown
Member

Summary

  • Drops the redundant static registry title from the tool activity row so each row is just icon + summary. Fixes the visible duplication (e.g. Read workspace · Read 3 items).
  • Hides workspace_list_items from the chat UI entirely — listings are an internal operation, not something a user needs to see.
  • Rewrites the fallback summaries ("Working", "Done", "Couldn't complete") so that unregistered tools still read as standalone sentences without a title next to them.
  • Surfaces more per-tool detail: PDF page ranges on reads, new name on renames, destination on moves, warning counts on edits, and URL paths on web_markdown.

Before / after

Tool Before After
workspace_read_items (PDF) Read workspace · Read "paper.pdf" Read "paper.pdf" p. 1–3
workspace_read_items (partial PDF) Read workspace · Read "paper.pdf" Read "paper.pdf" p. 1–3 of 42
workspace_rename_item Rename item · Renamed "old" Renamed "old" → "new"
workspace_move_items Move items · Moved 2 items Moved 2 items to "Archive"
workspace_edit_item Edit item · Updated "notes.md" with 3 edits Updated "notes.md" with 3 edits, 1 warning
web_markdown Read webpage · Read acme.com Read acme.com/blog/post
workspace_list_items shown as List workspace · Listed 5 items not rendered
unregistered tool (fallback) Tool · Done Ran my_tool

Test plan

  • npm run check (biome + tsc) passes
  • npm run test (all 136 tests) passes
  • Manually check the chat stream in a live workspace: run a search, read a PDF, edit a doc, rename a file — verify the row reads as one clean sentence and no duplicate label appears

🤖 Generated with Claude Code


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

Review in cubic

Summary by CodeRabbit

  • Improvements
    • Improved AI activity messages with clearer descriptions for moving, reading, renaming, editing, computing, and researching.
    • Added more useful details such as destinations, page ranges, URLs, warning counts, and renamed item names.
    • Improved summaries for completed, failed, and unfamiliar actions with more specific tool names and outcomes.
    • Enhanced search activity displays with clearer result summaries and presentation.

- Drop the redundant static registry title from the tool activity row so
  the summary carries the full label without repeating the verb.
- Hide `workspace_list_items` from the chat UI and delete its receipt
  code — listings are an internal operation, not a user-facing action.
- Rewrite fallback summaries so unregistered tools still read as
  standalone sentences (e.g. "Running foo", "Ran foo", "Foo failed").
- Surface more per-tool detail: PDF page ranges on reads, new name on
  renames, destination on moves, warning counts on edits, and URL paths
  on `web_markdown`.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@cursor

cursor Bot commented Jul 28, 2026

Copy link
Copy Markdown

Bugbot is not enabled for your account, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

@github-actions

Copy link
Copy Markdown

React Doctor found 1 new issue in 1 file · 1 warning · score 92 / 100 (Great) · 0 fixed · vs main

1 warning

src/features/workspaces/components/ai-chat/ai-chat-tool-receipts.ts

  • ⚠️ L32 .map().filter(Boolean) loops twice js-flatmap-filter

Reviewed by React Doctor for commit 9624d8a. See inline comments for fixes.

}
case "workspace_read_items": {
const requests = getArray(toolInput.requests).map((request) => asRecord(request));
const paths = requests.map((request) => getString(request.path)).filter(Boolean) as string[];

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

React Doctor · react-doctor/js-flatmap-filter (warning)

This loops over your list twice because .map().filter(Boolean) makes two passes, so use .flatMap() to change & drop items in one pass

Fix → Use .flatMap(item => condition ? [value] : []) to change and drop items in one pass, instead of building a throwaway array in between

Docs

@coderabbitai

coderabbitai Bot commented Jul 28, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

AI tool receipts now provide more specific summaries for workspace, web, research, and Code Mode operations. Activity rows display the activity summary directly, workspace list-items is hidden in the UI, and display-state tests use web-search fixtures.

Changes

AI tool activity presentation

Layer / File(s) Summary
Tool receipt formatting
src/features/workspaces/components/ai-chat/ai-chat-tool-receipts.ts
Running, completed, failed, workspace, research, Code Mode, URL, destination, and unknown-result summaries are updated with more specific text and formatting.
Activity summary rendering
src/features/workspaces/components/ai-chat/AiChatToolActivityRow.tsx
Activity rows render activity.summary as the primary label and tooltip while preserving running-state accessibility and shimmer behavior.
Tool visibility and display fixtures
src/features/workspaces/ai/ai-tool-registry.ts, src/features/workspaces/components/ai-chat/ai-chat-display-state.test.ts
workspace_list_items is hidden in the registry, and display-state tests use web_search fixtures and expectations.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related PRs

Suggested labels: capy

Suggested reviewers: cubic-dev-ai

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title is concise and accurately summarizes the main UI and receipt-summary refactor in workspaces.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/tool-call-ui-dedup

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.

@urjitc
urjitc merged commit f0b5f7d into main Jul 28, 2026
10 of 11 checks passed
@github-project-automation github-project-automation Bot moved this from Backlog to Done in Dev Board Jul 28, 2026
@urjitc
urjitc deleted the codex/tool-call-ui-dedup branch July 28, 2026 02:38

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
src/features/workspaces/components/ai-chat/ai-chat-display-state.test.ts (1)

19-47: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Retain explicit coverage for hidden workspace_list_items.

These replacements now exercise visible web_search, but no longer prove that a hidden workspace_list_items call is omitted or that fallback to a visible sibling works. Keep a fixture containing both tools and assert that only the visible child is rendered.

Also applies to: 57-77

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/features/workspaces/components/ai-chat/ai-chat-display-state.test.ts`
around lines 19 - 47, Update the test fixture and assertions around
getDisplayableParts and AiChatToolGroupPart to include both a hidden
workspace_list_items tool and a visible sibling tool. Assert that the rendered
group contains only the visible child, preserving explicit coverage that
workspace_list_items is omitted and visible sibling fallback remains supported.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@src/features/workspaces/components/ai-chat/ai-chat-display-state.test.ts`:
- Around line 19-47: Update the test fixture and assertions around
getDisplayableParts and AiChatToolGroupPart to include both a hidden
workspace_list_items tool and a visible sibling tool. Assert that the rendered
group contains only the visible child, preserving explicit coverage that
workspace_list_items is omitted and visible sibling fallback remains supported.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: a1f27e69-c875-4412-8311-be7f09b74dd6

📥 Commits

Reviewing files that changed from the base of the PR and between 9ceb7a1 and 9624d8a.

📒 Files selected for processing (4)
  • src/features/workspaces/ai/ai-tool-registry.ts
  • src/features/workspaces/components/ai-chat/AiChatToolActivityRow.tsx
  • src/features/workspaces/components/ai-chat/ai-chat-display-state.test.ts
  • src/features/workspaces/components/ai-chat/ai-chat-tool-receipts.ts

@greptile-apps

greptile-apps Bot commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

Refines AI tool activity rows and receipt summaries.

  • Displays each activity as a single icon-and-summary row.
  • Hides internal workspace-list operations from chat.
  • Adds rename destinations, move destinations, PDF ranges, edit warning counts, URL paths, and clearer fallback summaries.
  • Updates display-state tests to use visible web-search activities.

Confidence Score: 5/5

The PR appears safe to merge, with no concrete changed-code failures identified.

The hidden-tool paths remain filtered by the existing display-state logic, and the enriched summaries consume fields guaranteed by the corresponding workspace operation schemas and producers.

Files Needing Attention: No files require additional attention.

T-Rex T-Rex Logs

What T-Rex did

  • I reviewed the before/after startup logs and confirmed they provide the paired evidence and identify the exact environment blocker.
  • I checked the focused runtime logs and confirmed the changed receipt and visibility code paths executed, though they do not substitute for the authenticated live-chat rendering check.
  • I noted that the authenticated live-chat rendering check remains necessary and cannot be fully validated by runtime logs alone.

View all artifacts

T-Rex Ran code and verified through T-Rex

Important Files Changed

Filename Overview
src/features/workspaces/ai/ai-tool-registry.ts Marks workspace listing activity as hidden while preserving its tool registration and behavior.
src/features/workspaces/components/ai-chat/AiChatToolActivityRow.tsx Removes the redundant registry title and renders the activity summary as the row’s primary truncated label.
src/features/workspaces/components/ai-chat/ai-chat-display-state.test.ts Replaces newly hidden workspace-list fixtures with visible web-search fixtures while retaining display grouping coverage.
src/features/workspaces/components/ai-chat/ai-chat-tool-receipts.ts Enriches tool receipts using fields consistent with workspace operation contracts and introduces standalone fallback summaries.

Reviews (1): Last reviewed commit: "refactor(workspaces): tighten tool call ..." | Re-trigger Greptile

@capy-ai

capy-ai Bot commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Capy auto-review is paused for this organization because the usage-cycle auto-review limit has been reached. Increase the limit or turn it off in billing settings to resume automatic reviews.

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

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant