fix(ui): show failed tool results as errors#85786
Conversation
|
Codex review: needs maintainer review before merge. Reviewed May 26, 2026, 4:26 PM ET / 20:26 UTC. Summary PR surface: Source +268, Tests +461. Total +729 across 8 files. Reproducibility: yes. at source level: current main labels the sidebar and grouped standalone tool-result paths as Review metrics: 1 noteworthy metric.
Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Mantis proof suggestion Risk before merge
Maintainer options:
Next step before merge Security Review detailsBest possible solution: Land the focused UI error-rendering fix after checks pass and maintainers explicitly accept or narrow the fallback heuristics, with explicit error flags kept as the source of truth. Do we have a high-confidence way to reproduce the issue? Yes, at source level: current main labels the sidebar and grouped standalone tool-result paths as Is this the best way to solve the issue? Yes for the explicit AGENTS.md: found and applied where relevant. Codex review notes: model gpt-5.5, reasoning high; reviewed against f7e2d9bb4708. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Source +268, Tests +461. Total +729 across 8 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
|
|
ClawSweeper PR egg ✨ Hatched: 🥚 common Velvet Lint Imp Hatch commandComment Hatchability rules:
Rarity: 🥚 common. What is this egg doing here?
|
69916a7 to
9482d3a
Compare
9482d3a to
1136ae8
Compare
3abd87d to
2a11ed8
Compare
|
Merged via squash.
Thanks @chengjiew! |
Summary
isError/is_errorflags into tool cards and add bounded fallback detection for common error payloads.Motivation
Change Type (select all)
Scope (select all touched areas)
Linked Issue/PR
Real behavior proof (required for external PRs)
Tool errorwith error styling instead ofTool output/Viewwith a success checkmark.node scripts/run-vitest.mjs ui/src/ui/chat/tool-cards.test.ts ui/src/ui/chat/tool-cards.node.test.ts ui/src/ui/chat/grouped-render.test.tspnpm exec oxfmt --check --threads=1 ui/src/ui/chat/tool-cards.ts ui/src/ui/chat/tool-cards.test.ts ui/src/ui/chat/tool-cards.node.test.ts ui/src/ui/types/chat-types.ts ui/src/styles/chat/tool-cards.css ui/src/ui/chat/grouped-render.ts ui/src/ui/chat/grouped-render.test.tsgit diff --checkcodex review --base refs/remotes/tmp/openclaw-main-2621renderToolCardSidebarin Chrome with one JSON error result and one successful result.Test Files 3 passed (3),Tests 66 passed (66).All matched files use the correct format.git diff --checkexited 0.I did not find a discrete regression in the modified surfaces.cardCount=2,errorCards=1,errorActionText="View error", success card keptView.{"error":"missing_brave_api_key"}and exactTool not foundoutput render as failed tool UI, while normal outputs continue to render as successful output.no space left on devicewhile pulling the image.Tool outputin grouped rendering and successful sidebar action copy.Root Cause (if applicable)
errorpayloads,Tool not found, and standalone collapsed tool results all render as errors.isError,is_error) and textual/JSON tool output surfaces, so the UI needs to respect both.Regression Test Plan (if applicable)
ui/src/ui/chat/tool-cards.test.tsui/src/ui/chat/tool-cards.node.test.tsui/src/ui/chat/grouped-render.test.tsisError/is_errorflags and fallback error outputs must render asTool errorwith error styling in card, sidebar, expanded, and collapsed standalone summary paths.User-visible / Behavior Changes
Failed tool results now show error labels, error badges, failed empty-output copy, and
View erroractions in the chat UI.Diagram (if applicable)
Security Impact (required)
Yes/No): NoYes/No): NoYes/No): NoYes/No): NoYes/No): NoYes, explain risk + mitigation: N/ARepro + Verification
Environment
Steps
Expected
Actual
Tool error, include error styling/badges, and useView errorin the sidebar card action.Tool output/View.Evidence
Attach at least one:
Human Verification (required)
What you personally verified (not just CI), and how:
errorpayloads.Tool not foundoutput.isErrorandis_errorflags.isError: falsecombined with an error payload.Review Conversations
Compatibility / Migration
Yes/No): YesYes/No): NoYes/No): NoRisks and Mitigations
errorfield as data.isError/is_errorflags are preferred, fallback parsing is bounded to top-level JSON objects and common known error shapes, and tests cover success outputs remaining unchanged.AI-assisted: yes, implemented with Codex and reviewed with
codex review.