Skip to content

Render invoke-agent tool cards - #3593

Merged
kwakayama merged 3 commits into
mainfrom
agent/invoke-agent-tool-card
Aug 11, 2026
Merged

kwakayama merged 3 commits into
mainfrom
agent/invoke-agent-tool-card

Conversation

@kwakayama

@kwakayama kwakayama commented Aug 11, 2026 •

Copy link
Copy Markdown
Contributor

What changed

  • render invoke_agent calls as Studio-style child-agent cards by default
  • show the agent label, run status, and concise result or error detail
  • preserve custom rendering through the existing ToolCall children composition API
  • add focused coverage for running, failed, and custom-renderer behavior

Why

The generic tool row exposed invoke_agent as an implementation detail. Child-agent runs should read like the agent cards in Veryfront Studio without adding a new public rendering API.

Validation

  • focused ToolCall tests: 12 assertions passed
  • deno task lint:ci
  • deno task typecheck
  • full pre-push formatting, lint, typecheck, and unit-test suite

Summary by CodeRabbit

  • New Features

    • Added automatic rendering for agent-invocation tool calls with a collapsible card showing the child agent, execution status, description, and results or errors.
    • Added support for custom content to replace the default agent-invocation card.
  • Bug Fixes

    • Improved error presentation by hiding raw error details when collapsed and showing the terminal message when expanded.
    • Omitted unnecessary tool parameters from the default agent-invocation card.
  • Documentation

    • Updated API reference links to point to the current source locations.

@coderabbitai

coderabbitai Bot commented Aug 11, 2026 •

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 078b869c-876d-4d03-a37f-f175f3ba2370

📥 Commits

Reviewing files that changed from the base of the PR and between 7f98b66 and 2d76ddd.

⛔ Files ignored due to path filters (1)
  • src/server/handlers/dev/framework-candidates.generated.ts is excluded by !**/*.generated.*
📒 Files selected for processing (3)
  • docs/api-reference/veryfront/chat.md
  • src/react/components/chat/chat/components/tool-ui.test.tsx
  • src/react/components/chat/chat/components/tool-ui.tsx
🚧 Files skipped from review as they are similar to previous changes (3)
  • src/react/components/chat/chat/components/tool-ui.test.tsx
  • src/react/components/chat/chat/components/tool-ui.tsx
  • docs/api-reference/veryfront/chat.md

📝 Walkthrough

Walkthrough

The chat tool UI now renders default invoke_agent calls as collapsible child-agent cards. It derives status and details from tool data. Tests cover running, failed, and custom-child behavior. API reference links now point to current source locations.

Changes

invoke_agent UI

Layer / File(s) Summary
Child-agent card rendering and validation
src/react/components/chat/chat/components/tool-ui.tsx, src/react/components/chat/chat/components/tool-ui.test.tsx, docs/api-reference/veryfront/chat.md
ToolCallRoot routes default invoke_agent calls to InvokeAgentToolCall. The renderer displays agent identity, status, descriptions, results, and errors in a collapsible card. Tests cover running, failed, and custom-child cases. API references use updated source locations.

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

Sequence Diagram(s)

sequenceDiagram
  participant ToolCallRoot
  participant InvokeAgentToolCall
  participant Status
  ToolCallRoot->>InvokeAgentToolCall: route default invoke_agent call
  InvokeAgentToolCall->>Status: render derived child-agent status
  InvokeAgentToolCall-->>ToolCallRoot: render collapsible child-agent card
Loading

Possibly related PRs

Suggested reviewers: kojiwakayama

🚥 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 clearly and concisely describes the main change: rendering default cards for invoke_agent tool calls.
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 agent/invoke-agent-tool-card

Comment @coderabbitai help to get the list of available commands.

@kwakayama
kwakayama marked this pull request as ready for review August 11, 2026 17:12

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7f98b66c20

ℹ️ 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".

Comment thread src/react/components/chat/chat/components/tool-ui.tsx

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

Actionable comments posted: 3

🤖 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.

Inline comments:
In `@docs/api-reference/veryfront/chat.md`:
- Line 211: Update the ToolCall entry in the API reference to document that
invoke_agent calls render child-agent cards by default, while caller-provided
children replace the default renderer. Preserve the existing generic
default-card and compound-layout guidance.

In `@src/react/components/chat/chat/components/tool-ui.tsx`:
- Around line 399-405: The default invoke_agent early-return branch in the tool
UI component drops the generic root props. Update the InvokeAgentToolCall path
to forward className and ref to the child-agent card root, matching the generic
rendering path while preserving existing ToolCall consumer behavior, and add a
regression test verifying className forwarding.
- Around line 302-305: Update the failure-card rendering around ToolCallRoot and
showDetail so the detail visibility matches isExpanded, including structured
failures without tool.errorText; alternatively initialize isExpanded from the
invoke-agent failure signal. Ensure aria-expanded and toggling remain
consistent, and add an assertion that the structured failure fixture starts
collapsed.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: b30f1ef5-f300-493f-9e50-9f6e989fdd09

📥 Commits

Reviewing files that changed from the base of the PR and between 07683f1 and 7f98b66.

⛔ Files ignored due to path filters (1)
  • src/server/handlers/dev/framework-candidates.generated.ts is excluded by !**/*.generated.*
📒 Files selected for processing (3)
  • docs/api-reference/veryfront/chat.md
  • src/react/components/chat/chat/components/tool-ui.test.tsx
  • src/react/components/chat/chat/components/tool-ui.tsx

Comment thread docs/api-reference/veryfront/chat.md Outdated
Comment thread src/react/components/chat/chat/components/tool-ui.tsx Outdated
Comment thread src/react/components/chat/chat/components/tool-ui.tsx
@kwakayama

Copy link
Copy Markdown
Contributor Author

Agent-browser visual proof

Captured from the PR branch at a 1000 × 360 viewport. Verified with no page errors.

Running (collapsed)

01-running

Running (expanded)

02-running-expanded

Completed

03-completed

Failed (expanded)

04-failed

Stopped

05-stopped

Custom renderer override

06-custom-renderer

@kwakayama
kwakayama added this pull request to the merge queue Aug 11, 2026
Merged via the queue into main with commit 2c2753d Aug 11, 2026
57 of 60 checks passed
@kwakayama
kwakayama deleted the agent/invoke-agent-tool-card branch August 11, 2026 19:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant