Skip to content

STU-1873: Improve tool call descriptions - #3903

Merged
shaunandrews merged 7 commits into
trunkfrom
stu-1873-improve-tool-descriptions
Jun 22, 2026
Merged

STU-1873: Improve tool call descriptions#3903
shaunandrews merged 7 commits into
trunkfrom
stu-1873-improve-tool-descriptions

Conversation

@shaunandrews

@shaunandrews shaunandrews commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

Related issues

How AI was used in this PR

I used AI assistance to inspect the existing tool-call rendering surfaces, port the shared description changes from the older exploration branch, and add focused tests around the shared helper behavior. I reviewed the resulting diff and ran the checks listed below.

Proposed Changes

  • Makes Studio agent tool calls easier to understand in compact surfaces by giving common WordPress and Studio tools clearer action-oriented labels.
  • Keeps terminal and WP-CLI command details available for surfaces like Studio Code and the CLI, where users may not have a richer details panel.
  • Preserves safe fallbacks for unknown tools so existing transcripts still render.

Testing Instructions

  • Run npx eslint --fix apps/cli/ai/ui.ts apps/studio/src/components/studio-code-session/conversation/index.tsx apps/ui/src/ui-classic/components/session-view/conversation/index.tsx tools/common/ai/tools.ts tools/common/ai/tests/tools.test.ts.
  • Run npm test -- tools/common/ai/tests/tools.test.ts apps/cli/ai/tests/ui.test.ts apps/studio/src/components/studio-code-session/conversation/index.test.tsx.
  • Run npm run typecheck.
  • Trigger a Studio Code or Agentic UI run that uses WP-CLI or Bash and confirm the tool row uses a clearer label while still showing the command detail.

Pre-merge Checklist

  • Have you checked for TypeScript, React or other console errors?

This comment was marked as outdated.

@shaunandrews
shaunandrews requested a review from sejas June 19, 2026 19:12
@wpmobilebot

wpmobilebot commented Jun 19, 2026

Copy link
Copy Markdown
Collaborator

📊 Performance Test Results

Comparing 01e7e84 vs trunk

app-size

Metric trunk 01e7e84 Diff Change
App Size (Mac) 2341.83 MB 2341.87 MB +0.04 MB ⚪ 0.0%

site-editor

Metric trunk 01e7e84 Diff Change
load 1042 ms 1032 ms 10 ms ⚪ 0.0%

site-startup

Metric trunk 01e7e84 Diff Change
siteCreation 6506 ms 6503 ms 3 ms ⚪ 0.0%
siteStartup 6990 ms 6984 ms 6 ms ⚪ 0.0%

Results are median values from multiple test runs.

Legend: 🟢 Improvement (faster) | 🔴 Regression (slower) | ⚪ No change (<50ms diff)

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

LGTM 👍
Works as described

Before After
Image Image
Comment thread tools/common/ai/tools.ts
);
}

function getWpCliOptionValue( args: string[], option: string ): string | undefined {

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.

We already have a very similar function in apps/cli/ai/tools/wp-cli.ts, I suggest re-using it.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

do you think it makes sense to move this into tools/common?

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.

Yes, I think that's a good approach

@shaunandrews
shaunandrews merged commit 7d051b2 into trunk Jun 22, 2026
13 checks passed
@shaunandrews
shaunandrews deleted the stu-1873-improve-tool-descriptions branch June 22, 2026 20:16
shaunandrews added a commit that referenced this pull request Jun 24, 2026
<img width="496" height="547" alt="image"
src="https://github.com/user-attachments/assets/eeb56c55-d6cb-43e8-a528-c3d17cca02b9"
/>
<img width="498" height="518" alt="image"
src="https://github.com/user-attachments/assets/3c30cdfc-e925-4b42-8f07-f5acc8f0ffc7"
/>

## Related issues

- Related to
https://linear.app/a8c/issue/STU-1873/studio-agentic-ui-improve-tool-call-presentation
- Follow-up to #3903

## How AI was used in this PR

I used AI assistance to port the tool-row presentation from the older
exploration branch onto current trunk, keep the scope limited to the
classic Agentic UI transcript, and add regression tests. I reviewed the
final diff, updated the branch after #3903 landed, ran automated checks,
and verified the UI in light and dark modes with a temporary Vite
harness.

## Proposed Changes

- Makes classic Agentic UI tool calls easier to scan by showing an icon,
a human-readable label, and a compact detail.
- Lets users expand a tool row to inspect the command/input and output
without long output taking over the transcript.
- Keeps Ask User questions from rendering a duplicate raw tool row, so
the custom question UI remains the only visible prompt.

## Testing Instructions

- Run `npm test -- tools/common/ai/tests/tools.test.ts
apps/ui/src/ui-classic/components/session-view/conversation/index.test.ts`.
- Run `npm run typecheck`.
- In classic Agentic UI, trigger tool calls such as WP-CLI and Bash,
then click the tool rows to confirm input/output appears inside a
bounded scrollable details panel.
- Check the tool rows and expanded details in both light and dark color
schemes.

## Pre-merge Checklist

- [x] Have you checked for TypeScript, React or other console errors?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

4 participants