Repository navigation
feat(chat,react): app-declared tool failures and a per-call result slot - #1501
Merged
Merged
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…lt slot Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…mplate Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Also keep tool message parts on the upgrade path and drop the redundant guard and cast in the snapshot-only path. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…rouped duplicate alert Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… types Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
blove
enabled auto-merge (squash)
November 9, 2026 22:19
…entry The packed-consumer check keeps an exact allowlist of react/chat runtime exports, so the new resolveToolOutcome export failed "Library — packages". Move the allowlist to one SUPPORTED_EXPORTS table that the generated consumer script receives alongside the assertion, and pin the new export. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
A tool can finish at the protocol level and still fail for the application (for example
lookup_flightreturning{"error": "Flight UA999 not found in dataset"}).Until now Threadplane showed such calls as Complete, in the expanded row and in the live region ("2 complete"), and an app could only fix that by replacing the whole activity rendering.
This PR adds one narrow, explicit hook plus a per-call slot, in Angular and React with identical semantics:
toolOutcomemay return{ status: 'failed', text, sources? }after the app decodes its own declared result schema. It only applies to protocol-complete calls: the row becomes Failed, the failure text replaces the generic copy, the raw result stays in Details. Existing{ text, sources? }outcomes are unchanged (statusdefaults to'succeeded'). The library still never infers failure from payload shape;false,0,"",[]andnullstay literal. Adapter errors, stopped, waiting, pending, running and unknown are never overridden. A throwingtoolOutcomeleaves the call unchanged (dev-onlyconsole.error).Used N tools · K failed(live region:Used 2 tools · 1 failed. 1 complete · 1 failed.). While work is active the existing running label and Failed cue are unchanged; an app caption still wins. Group alerts show de-duplicated failure copy (div[role=alert] > p), falling back to the generic sentence.renderToolResult(activity)onMessageList/Chat(andrenderResultonToolActivityGroup); AngularchatToolResultTemplate(per tool name or"*"), forwarded by<chat>. Receives the resolved activity, adds content outside Details, renders below a collapsed group. It runs nothing;renderMessage/chatToolCallTemplatekeep full replacement.ToolActivity/ToolActivityGroupandchat-tool-activity/chat-tool-activity-groupapply a failed outcome passed directly;resolveToolOutcomeis exported from both packages. Angular primitive input types are unchanged.errorfield maps to a failed call (a streamed-complete call is upgraded when the snapshot arrives; a lateTOOL_CALL_RESULTdoes not downgrade it). No shipped AG-UI server populateserrortoday, so this is covered by reducer unit tests only.errorstate mapping.chat-tool-callspages document declaring a failed result and adding content to one call; API reference and parity dispositions regenerated.Also fixes an Angular duplicate failure alert when calls are not grouped.
Design decisions: the hook is presentation-only (the model is not told; tools should use their protocol's error flag); partial failure is a group-level fact, not a new per-call phase; retry and save receipts stay application-owned. The application recipe (typed decoding, read-only retry of only the failed call, sources, receipts after an actual save) and its example/fixture work follow in a separate PR.
Test plan
Run on Node 22 at
34a1c6ac1, all passing:npx nx test react --watch=false(907 tests)npx nx test chat --watch=false --maxWorkers=1(1528 tests)npx nx test ag-ui --watch=false(618 tests)npx nx test langgraph --watch=falsenpx nx lint react|chat|ag-ui(no errors)npx nx run react:type-tests/chat:type-tests/ag-ui:runtime-qualitynpx nx run-many -t build -p chat,ag-ui,reactnode scripts/react-parity/inventory.mjs --checknpm run generate-api-docs:check🤖 Generated with Claude Code