Repository navigation
fix(ui): keep errored tools collapsed instead of force-expanding - #1036
Merged
Merged
Conversation
An errored tool no longer counts as an attention state: the trow group
and the boxed card stay collapsed when a tool fails, and an earlier
manual collapse is no longer overridden by the error transition. The
failure signal stays on the summary line ("N 个失败" in destructive
color, red kind icon), and the error banner + raw diagnostics remain
one click away behind the disclosure.
Permission prompts keep the force-open behavior — they are actionable
and a collapsed summary would hide them.
ToolActivity gains a controlled `open` prop (the ToolErrorDetails
pattern) so tests can render the expanded body in static markup; the
#741 error-collapse contract now pins the collapsed default and the
expanded body separately.
Codex review on the collapsed-error change found two spots where the failure signal degraded to a destructive tint once errors stopped force-opening: - summarizeTrowTools suppressed the "N 个失败" clause for live groups. The suppression was justified by the force-open fallback that no longer exists, and the failed count is monotonic mid-group, so the clause now rides the live summary too (the live option only adds the 正在 prefix). - An errored ToolTrowRow inside an expanded group showed only a red intent. The row label now carries a visible "· 失败" word.
The collapsed-error change had switched five body-rendering tests to waiting_permission as the static-markup mounting seam, which silently moved them off the errored branches they pin (error banner, raw-details disclosure, pty_control banner suppression). With the open prop added in this PR, the tests can keep status: 'errored' and mount the panel explicitly — byte-identical to the old auto-open renders. The automation preview contract is status-agnostic (it exercises the result parser), so it now uses the honest status: 'completed' + open.
…d default The zero-visual harness still mirrored the old disclosure default (waiting_permission || errored render OPEN) and rode its rich inner parts on the open errored card. openByDefault now matches production (waiting_permission only); the rich inner parts ride the open waiting_permission card, and the errored card joins the collapsed set so the zero-visual proof covers the new default. The cascade contract regex is updated to pin the new line. Verified end-to-end: every fixture id (incl. tool-dot-waiting_permission and the now-collapsed tool-item-errored) resolves and computes in the headless run.
…ctor
The contract pinned the literal JSX {formatToolIntent(item.intent)}; the
errored-row change routes intent through a rowLabel computation instead.
The invariant is unchanged — intent is still only consumed via
formatToolIntent and raw {item.intent} still never reaches JSX.
16 tasks
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
In Desktop sessions, a failed tool force-expanded its trow group (and the legacy boxed card), spreading the error banner and raw output across the conversation. This PR keeps failed tools collapsed:
deriveToolActivityPresentationandtrowNeedsAttentionnarrow fromwaiting_permission || erroredtowaiting_permissiononly. Permission prompts keep the force-open behavior — they are actionable and a collapsed summary would hide them. Errors are no longer an attention state.manuallySetsemantics unchanged).ToolActivitygains a controlledopenprop (the existingToolErrorDetailstest pattern) so tests can render the expanded body in static markup; production callers never pass it and are unaffected.The #741 error-collapse contract's goal (a verbose failure must not dominate the conversation) still holds under the collapsed default; its tests now pin the collapsed default and the expanded banner/inner-diagnostics behavior separately.
Verification
@maka/uifull suite: 160/160 pass, including a new trow-level regression test (errored tool stays collapsed, summary keeps "1 个失败").@maka/desktopfull main suite: 2549/2549 pass (including thetest:checksconsole/a11y/copy checks).typecheck(ui + desktop, incl. the storybook tsconfig) andbiome linton changed files pass.Review focus
A Codex review round on the initial commit found three P2 gaps created by removing the force-open fallback; all are fixed in follow-up commits on this branch:
summarizeTrowTools(live)now keeps the "N 个失败" clause (the count is monotonic mid-group — no jitter), and an erroredToolTrowRowcarries a visible "· 失败" word.waiting_permission, silently leaving the errored branches they pin. They now keepstatus: 'errored'and mount the panel via theopenprop (byte-identical to the old auto-open renders); the automation contract uses the honestcompleted+open.waiting_permission || erroredopen-by-default. It now matches production (waiting_permissiononly), with the rich inner parts on the open permission card and the errored card joining the collapsed set; the cascade contract regex is updated in lockstep. A fourth commit aligns the intent-redaction contract's source pin with the row-label refactor.Follow-up verification:
@maka/ui161/161,@maka/desktop2549/2549 (incl. checks), typecheck + biome lint clean, and a headlesscheck:chat-visualsmoke run confirming every rewritten fixture id resolves and computes.