Repository navigation
fix(desktop): state a failed turn's outcome where it happened - #4073
Conversation
|
The overall direction looks right: moving the failed-turn outcome below the timeline and replacing the bespoke Marker/CSS surface with Astryx I think one part is over-subtracted, though. Could we keep the structural simplification but retain a much smaller state-aware guidance derivation, returning only text (no unused action enum)? For example:
There is also a regression-test gap around the ordering fix. From an Occam perspective, the converged causal spine seems to be: failed turn -> preserve relevant execution state -> render the truthful outcome after the work -> expose only recovery controls that actually exist. The Banner/placement/dead-enum changes are necessary for that spine; discarding retained-output/tool-activity guidance is not, and reduces safety rather than merely removing complexity. |
|
Both points hold, and the second is a gap I left. Ordering test. Confirmed: the test asserted Execution-state guidance. The risk is real: a resend after a side-effecting tool can repeat that effect, and error-class copy alone does not say so. Restored as I did not restore the ranked form. That chain put the tool branch ahead of the error class, so The two facts never actually competed: one is why the turn ended, the other is what it already did. Tests added: Pushed as 3e68486. |
A failed turn's banner made three separate promises it could not keep. It claimed an action that does not exist. The banner reads `describeTurnErrorClass()` for a title and `deriveFailedTurnRecovery()` for a tail, joined by a CSS `::before` dot, so a rate limit rendered as 「触发模型速率限制 · 已保留部分输出,可从这里继续」. There is no "here" to continue from: `partialOutputRetained` only records that the turn produced some assistant text or a tool result, and the sole resume path is `app_restarted`'s safe resume, gated on `latestInterruptedResumeTurnId`. `FailedTurnRecoveryAction`'s four values were never read by any renderer — only `label` was — so the whole recovery layer existed to phrase guidance no surface could honor. It goes; each `turnError` string now says what happened and what to do in one sentence, and what it tells the user to do is send another message, which always works. It painted its own error surface. `Marker variant="failed-banner"` plus hand-rolled `oklch(from var(--destructive) …)` borders reimplemented Astryx's `Banner`, which the same file already uses for the provider retry indicator and which the app uses in ~50 other places. Reason maps to `title`, the park diagnostic to `description`, safe resume to `endContent`. Three `MarkerVariant`s, the bespoke `AlertOctagon`, and the shell CSS go with it; only the block rhythm stays. Severity follows the app's existing `tone === 'destructive' ? 'error' : 'warning'` grading so "restarted, press continue" stops looking as loud as blocked billing. It rendered above the work it described. The banner sat at the head of `maka-assistant-answer-content`, before `segment.items.map()`, so an outcome read as a header on reasoning and tool calls that had all succeeded. It now follows the timeline it concludes. Safe resume survives all of this: it is the one recovery with a real backend, replaying an interrupted turn's own context rather than asking the user to restate it. Its button and every string around it move from 「安全恢复」 to 「继续这一轮」, so the control, its pending state, its park description, and its toasts stop describing the same act four ways. Generated-by: Claude Code
Deleting `deriveFailedTurnRecovery()` took a real warning with it. A turn that ran a tool and then failed on transport — `timeout`, `network`, `rate_limit` — was left with error-class copy alone, so "send a message to retry" no longer said that tools had already run and a resend could repeat their effects. That guidance was worth keeping; only the resume it falsely promised was not. `describeFailedTurnExecutionState()` restores it as text, with no action enum to go unread. It does NOT restore the ranking the old derivation used. That chain put the tool branch ahead of the error class, so `auth` plus one errored tool advised "inspect the tool result" and dropped "sign in again" — the only step that could change the outcome — and `context_overflow` plus tool activity lost "reduce attachments" the same way. The two facts never competed for real: one is why the turn ended, the other is what it already did. `Banner` has a slot for each, so the error class takes `title`, execution state takes `description`, and neither has to lose. `description` is otherwise written only by the parked-resume diagnostic, which exists solely on `app_restarted` turns, so the two cannot collide. The ordering fix shipped without a test that could fail for it: `chat-turn-steering-order.test.ts` asserted steering position and one-occurrence, both true of either layout. It now asserts the banner follows the last timeline entry, verified by moving the banner back above the timeline and watching it fail. Generated-by: Claude Code
3e68486 to
c8e78de
Compare
jackwener
left a comment
There was a problem hiding this comment.
I reviewed exact head c8e78ded56391423889b4a502486892260dfdda5.
The failed-turn banner no longer names a continue action the UI cannot run. Reason and leftover tool/partial state stay in separate slots, so an auth failure is not replaced by "inspect the tool". The banner sits after the timeline, uses the shared Banner, and keeps the one real resume button (app_restarted).
No blocking issues on this head.
Posted by an automated review agent operated by @WAWQAQ. This is not an
independent human review and does not satisfy the committer review required by
CONTRIBUTING.md. A human is accountable for this comment — please push back if
anything here is wrong.
简体中文
我审了当前 head。失败回合横幅不再承诺一个并不存在的「继续」动作;原因和工具副作用分开写。没有阻塞问题。
本条评论由 @WAWQAQ 运行的自动化审查程序发出。它不构成 CONTRIBUTING.md
所要求的独立人类审查,也不能替代人类审查。有人类对本条评论负责,如有错误请直接指出。
The aborted marker rendered at the top of the assistant answer, above the reasoning disclosures and tool calls, where it read as a header on work that had in fact all completed. PR #4073 moved the failed banner below the timeline for exactly this reason but left the aborted marker behind; both are terminal outcome markers and share the same slot, so move the aborted marker next to the failed banner and match its block rhythm. Generated-by: Maka
The aborted marker rendered at the top of the assistant answer, above the reasoning disclosures and tool calls, where it read as a header on work that had in fact all completed. PR #4073 moved the failed banner below the timeline for exactly this reason but left the aborted marker behind; both are terminal outcome markers and share the same slot, so move the aborted marker next to the failed banner and match its block rhythm. Generated-by: Maka
* fix(ui): state an aborted turn's outcome after its timeline The aborted marker rendered at the top of the assistant answer, above the reasoning disclosures and tool calls, where it read as a header on work that had in fact all completed. PR #4073 moved the failed banner below the timeline for exactly this reason but left the aborted marker behind; both are terminal outcome markers and share the same slot, so move the aborted marker next to the failed banner and match its block rhythm. Generated-by: Maka * fix(ui): use Astryx badge for aborted turns Aborted turns are settled facts, but their outcome was rendered through a Maka-only Marker variant and bespoke visual recipe. Render the terminal outcome with Astryx's neutral Badge while preserving its position after the timeline, retain only the flex alignment needed by the transcript container, and cover both the component contract and ordering. Generated-by: Codex * fix(ui): render aborts as chat status notices An aborted turn is a short, settled status change with no recovery action. Astryx documents ChatSystemMessage as the Chat-family primitive for inline status notices, while Badge is reserved for states users need to notice or act on. Render the outcome as a system-message sibling after the assistant timeline, remove the marker-era parentheses and layout hook, and pin the component, copy, and ordering contracts. Generated-by: Codex * docs(ui): remove stale abort marker reference Generated-by: Codex
Summary
A failed turn's banner made three promises it could not keep.
It named an action that does not exist. The banner joins
describeTurnErrorClass()andderiveFailedTurnRecovery()with a CSS::beforedot, so a rate limit rendered as 「触发模型速率限制 · 已保留部分输出,可从这里继续」. There is no "here" to continue from —partialOutputRetainedonly records that the turn produced assistant text or a tool result, and the one real resume path isapp_restarted's safe resume, gated onlatestInterruptedResumeTurnId.FailedTurnRecoveryAction's four values were never read by any renderer, onlylabelwas, so the recovery layer existed solely to phrase guidance no surface could honor. It is deleted. EachturnErrorstring now says what happened and what to do in one sentence, and what it asks for — send another message — always works.It painted its own error surface.
Marker variant="failed-banner"plus hand-rolledoklch(from var(--destructive) …)borders reimplemented Astryx'sBanner, which this same file already uses for the provider retry indicator and which the app uses in ~50 other places. Reason →title, park diagnostic →description, safe resume →endContent. ThreeMarkerVariants, the bespokeAlertOctagon, and the shell CSS go with it. Severity follows the app's existingtone === 'destructive' ? 'error' : 'warning'grading, so "restarted, press continue" stops looking as severe as blocked billing.It rendered above the work it described. The banner sat at the head of
maka-assistant-answer-content, beforesegment.items.map()— an outcome reading as a header on reasoning and tool calls that had all succeeded. It now follows the timeline it concludes.Safe resume is kept: it is the only recovery with a real backend, replaying an interrupted turn's own context instead of asking the user to restate it. Its button and the strings around it move from 「安全恢复」 to 「继续这一轮」 so the control, its pending state, its park description, and its toasts stop describing one act four ways.
Net −122 lines.
Verification
npm --workspace @maka/ui run build— passnpm --workspace @maka/desktop run typecheck(preload + main + renderer + storybook) — passnpm run format:check— cleannode --teston the three affected files (session-status-presentation,session-error-presentation,chat-turn-steering-order) — 7/7 passRendered through the real
TurnView+ Astryx CSS. Banner now follows the answer; app-restart iswarningwith the resume button, rate limit and auth areerrorwith copy only:Review focus
The copy is the substance of this change — every
turnErrorstring in both locales was rewritten. Worth reading as user-facing text rather than as a diff.AI use
Select exactly one:
Tool(s) and scope: Claude Code (Opus 5) — traced the three defects to their sources, wrote the change, and rewrote the copy under review by the contributor of record, who chose the approach at each branch (drop the unbacked recovery layer rather than build buttons for it; keep safe resume; grade severity in two tiers).
Checklist
Does this PR entail a change in behavior?