Skip to content

feat(apollo-react): add the Wind chat tool-call and tree renderers - #1376

Open
BenGSchulz wants to merge 1 commit into
feat/wind-chat-markdown-rendererfrom
feat/wind-chat-tool-call-tree-renderers
Open

BenGSchulz wants to merge 1 commit into
feat/wind-chat-markdown-rendererfrom
feat/wind-chat-tool-call-tree-renderers

Conversation

@BenGSchulz

@BenGSchulz BenGSchulz commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Fourth PR of the Wind chat renderer stack (MST-16565): agent tool call messages (AGENTS_TOOL_CALL_RENDERER) and tree messages (APOLLO_CHAT_TREE_RENDERER) render in Wind. Both are registered as Wind built-ins, and a renderer injected on the service still wins (tested).

Tool call: apollo-wind ToolCall

  • Status: Material's state maps to the primitive's status.

    • loading → executing;
    • error → failed;
    • success → completed;
    • no state → completed, because Material's line then reads "Ran".

    The line reads "Running 'x'" or "Ran 'x' for 1.23 seconds", as Material's does, and is localized.

  • Display modes:

    • ToolNameOnly omits ToolCallContent, so only the status line shows.
    • InputsAndOutputs and FullTrace get the body.
    • The body starts closed, as Material's does, and opens by itself when the trace has escalation task links.
  • Sections:

    • Input, Errors and Output use the primitive's value sections. Strings render through CodeBlock (renderValue) and objects through the primitive's JSON tree.
    • FullTrace adds a Traces section: nested trace items with Material's span icons, model calls and agent output left out.
    • Escalation lists the task links with a waiting or completed icon.
  • Stable state: which parts are open (the card, Input, Output, Errors, Traces, Escalation and each trace row) is held by the renderer, as in Material, so it survives the finished call being re-sent under the same id and closing and reopening the card. The ported "stays expanded when the tool result replaces the message" test covers it, including an open Input section. Auto-opening for escalation happens once, so a re-send does not reopen a card the reader closed. A failure without input shows as failed. Trace rows and their icons are built level by level, only while the Traces section and the row are open.

Tree: disclosure tree, not apollo-wind TreeView

The tree message renders as a nested disclosure list built from apollo-wind Tooltip and Tailwind. The same component is shared with the tool call's Traces section.

  • Rows are open unless their span says expanded: false, as in Material.
  • Each row shows the title (with titleColor), a lucide icon via ServiceIcon, and additionalInfo on the right. It gets a tooltip only when the span has a description; a described leaf row is focusable, so keyboard users get the tooltip too. Rows use the tool call section's styling (text-emphasis hover, chevron, indentation), so a trace inside a tool call and a tree message read alike. The tree model no longer supplies a "No description" placeholder, which also removes it from Material.

apollo-wind's TreeView (FileTreeView) is a file-manager component and does not fit here (see the open decision):

  • it always shows a search box and English Expand and Collapse buttons;
  • it has no initial expanded state;
  • it has no description line.

Hoisted into src/chat/headless

Helper What it carries Material change
tool-call/tool-call-model.ts Span types; getToolCallState (from input, output and the span tree, including child errors); getToolCallName; getToolCallDurationSeconds; getTaskUrls; getToolCallValues (input, error and output as Material picks them); getVisibleTraceChildren; getSpanAttributes ApToolCall.tsx uses all of them
tool-call/span-icon.ts, tool-call/span-icons.ts The span icon lookup and its SVG set, moved from ap-tool-call/utils and ap-tool-call/assets ApToolCall.tsx imports them from here
tree/chat-tree.ts: toChatTreeItem, getExpandedTreeIds The tree row model and default expansion tree-renderer.tsx default transform and expanded ids
utils/openable-url.ts: isOpenableUrl The http(s)/relative URL rule from R-3, now shared ToolCallSection.tsx task links (see below)

Security: escalation task links come from the backend. Both renderers now render them as links only when they are http(s) or relative; anything else shows as plain text. This also changes Material, which previously linked any scheme.

Storybook

pnpm storybook:design, Apollo React / Chat / Playground, then Compare renderers with scenario:

  • Tool calls: one call per display mode, then:
    • a call that runs and finishes 3s later under the same id (expand it while it runs);
    • a failed call (Errors);
    • a FullTrace call waiting on two escalation task links, which opens by itself.
  • Tree message: the trace as a tree, open by default. Three spans have descriptions (tooltips) and two have none.

Tests

  • vitest --run src/chat src/material/components/ap-chat src/material/components/ap-tool-call: 43 files, 237 tests pass. New tests cover:

    • the tool call model: state from input/output and from the span tree, name, duration, task URLs (string attributes, descendants), section values, trace filtering;
    • the tree model: rows, fallbacks, expansion;
    • the Wind tool call:
      • running then finished;
      • stays expanded when the result replaces the message;
      • ToolNameOnly without a toggle;
      • string values as code and objects as a tree;
      • traces only for FullTrace, without model calls;
      • escalation opens by itself and never links a javascript: URL;
      • an injected renderer wins;
    • the Wind tree: open by default, expanded: false closed.
  • tsc --noEmit: clean.

  • biome check on touched files: no errors; two warnings already present in Material (its trace icon dangerouslySetInnerHTML and an any in ToolCallSection.tsx). The first push had a format error in headless/tree/chat-tree.ts, now fixed.

  • New strings, in en.json only:

    • tool call: status names, the running and ran lines, seconds, section titles, the waiting label;
    • JSON tree: the read-only strings (expand, collapse, item and key counts with plurals, copy path and value).

    The running and ran lines double their apostrophes, since a single ' starts a quoted literal in ICU.

Stack

  1. R-1 Wind shell: feat(apollo-react): add the Wind chat renderer shell #1371
  2. R-2 message list: feat(apollo-react): add the Wind chat message list #1372
  3. R-3 markdown renderer: feat(apollo-react): add the Wind chat markdown renderer #1375
  4. R-4 tool-call and tree renderers: this PR
  5. R-5 composer: feat(apollo-react): add the Wind chat composer #1378
  6. R-6 first run, suggestions and thinking state: feat(apollo-react): add the Wind chat first run, suggestions and thinking state #1396
  7. R-7 history and settings: feat(apollo-react): add the Wind chat history and settings panels #1397
  8. R-8 CSS delivery and docs: feat(apollo-react): document the Wind chat setup and its delivery #1399

Jira: MST-16565

🤖 Generated with Claude Code

@github-actions

github-actions Bot commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Apollo Coded App preview deployments are ready.

Project Status Preview Updated (PT)
apollo-design Ready Preview · Logs Oct 15, 2026, 02:58:45 PM
apollo-docs Ready Preview · Logs Oct 15, 2026, 02:58:45 PM
apollo-landing Ready Preview · Logs Oct 15, 2026, 02:58:45 PM
apollo-vertex Ready Preview · Logs Oct 15, 2026, 02:58:45 PM

@github-actions

github-actions Bot commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Dependency License Review

  • ✅ 1947 package(s) scanned
  • ✅ No license issues found
  • ⚠️ 2 package(s) excluded (see details below)
License distribution
License Packages
MIT 1713
ISC 91
Apache-2.0 56
BSD-3-Clause 28
BSD-2-Clause 23
BlueOak-1.0.0 8
MPL-2.0 4
MIT-0 3
CC0-1.0 3
MIT OR Apache-2.0 2
(MIT OR Apache-2.0) 2
Unlicense 2
LGPL-3.0-or-later 1
Python-2.0 1
CC-BY-4.0 1
(MPL-2.0 OR Apache-2.0) 1
Unknown 1
Artistic-2.0 1
(WTFPL OR MIT) 1
(BSD-2-Clause OR MIT OR Apache-2.0) 1
CC-BY-3.0 1
0BSD 1
(MIT OR CC0-1.0) 1
MIT AND ISC 1
Excluded packages
Package Version License Reason
@img/sharp-libvips-linux-x64 1.3.4 LGPL-3.0-or-later LGPL pre-built binary, not linked
khroma 2.1.0 Unknown MIT per GitHub repo, missing license field in package.json

@BenGSchulz
BenGSchulz added this pull request to stack #1374 October 15, 2026 21:06
@github-actions

github-actions Bot commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

📊 Coverage + size by package

Per-package coverage and bundle size on this PR. New-line coverage = of the source lines this PR adds or changes, the % hit by tests.

Package Coverage New-line coverage Packed (gzip) Unpacked vs main
@uipath/apollo-core — — 42.02 MB 50.17 MB ±0
@uipath/apollo-react 56.0% 78.9% (172/218) 8.02 MB 31.57 MB +32.9 KB
@uipath/apollo-ui-icons — — 2.86 MB 6.97 MB ±0
@uipath/apollo-vertex — — — — —
@uipath/apollo-wind — — 785.2 KB 4.55 MB +10 B
@uipath/ap-chat 85.8% — 40.37 MB 45.58 MB +1.7 KB

"Coverage" is each package's own coverage.include scope (e.g. apollo-core instruments only scripts/). "Packed"/"Unpacked" come from npm pack --dry-run and only cover built packages — "—" means not measured this run (package not affected / not built). "vs main" is the packed (gzipped) delta against the last successful main build (the package-sizes artifact from the Release workflow); "—" there means no main baseline was available this run. The baseline is main's latest build, not this PR's exact merge-base, so it includes any drift since the branch diverged. Packages with no vitest config are omitted.

@BenGSchulz
BenGSchulz force-pushed the feat/wind-chat-tool-call-tree-renderers branch from 8a59dcc to c95f4e7 Compare October 15, 2026 21:49
Copilot AI balanced review requested due to automatic review settings October 15, 2026 21:49

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@github-actions github-actions Bot added the size:XXL 1,000+ changed lines. label Oct 15, 2026
@BenGSchulz
BenGSchulz marked this pull request as ready for review October 15, 2026 22:39
Copilot AI balanced review requested due to automatic review settings October 16, 2026 16:10
@BenGSchulz
BenGSchulz force-pushed the feat/wind-chat-tool-call-tree-renderers branch from c95f4e7 to d8d484d Compare October 16, 2026 16:10

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@github-actions
github-actions Bot temporarily deployed to preview/apollo-vertex October 16, 2026 16:11 Destroyed
@github-actions
github-actions Bot temporarily deployed to preview/apollo-design October 16, 2026 16:11 Destroyed
@github-actions
github-actions Bot temporarily deployed to preview/apollo-landing October 16, 2026 16:11 Destroyed
@github-actions
github-actions Bot temporarily deployed to preview/apollo-docs October 16, 2026 16:11 Destroyed
Render agent tool call messages in the Wind chat on the apollo-wind
ToolCall primitive (status line, input, traces, escalation task links,
errors and output per display mode) and tree messages as a disclosure
tree, both registered as Wind built-ins behind injected renderers.

Hoist the renderer-agnostic reading of tool calls and trees into
src/chat/headless and switch Material to it: status from input, output
and the span tree, tool name and duration, task URLs, section values,
the span icon lookup and its SVG set, and the tree row model. Task
links are only rendered for http(s) or relative URLs in both renderers.

MST-16565

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings October 16, 2026 19:52
@BenGSchulz
BenGSchulz force-pushed the feat/wind-chat-tool-call-tree-renderers branch from d8d484d to 375e851 Compare October 16, 2026 19:52

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

This branch was successfully deployed

4 active deployments
preview/apollo-design — 375e851d Deployed Oct 16, 2026 by github-actions[bot]
preview/apollo-landing — 375e851d Deployed Oct 16, 2026 by github-actions[bot]
preview/apollo-vertex — 375e851d Deployed Oct 16, 2026 by github-actions[bot]
preview/apollo-docs — 375e851d Deployed Oct 16, 2026 by github-actions[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pkg:apollo-react size:XXL 1,000+ changed lines.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants