fix(desktop): surface terminal error frames as failed bubbles

message.complete frames with status "error" were detected only by a text
regex heuristic, which misses the gateway's "Error: <detail>" texts and
partial-text failures — a failed turn rendered as a healthy reply. The
structured error/partial fields now drive the failure state: the bubble is
marked failed from the frame's error field, and a partial failure keeps
its streamed text visible instead of stripping it. session.resume's
inflight projection likewise carries a retained failure's error onto the
projected assistant row, so a failed turn recovered after a disconnect
renders as failed rather than as a healthy partial answer.

Co-authored-by: Reza Sayar <rsayar@uvic.ca>
This commit is contained in:
Brooklyn Nicholson 2026-07-24 23:31:56 -05:00
parent 8d8d1d61fe
commit b8675a1899
2 changed files with 1 additions and 14 deletions

View file

@ -345,10 +345,6 @@ function timelineDisplayContent(message: SessionMessage, content: string): strin
return 'model changed'
}
if (message.display_kind === 'auto_continue') {
return 'resumed interrupted turn'
}
if (message.display_kind === 'async_delegation_complete') {
const count = timelineTaskCount(message.display_metadata)
@ -948,9 +944,7 @@ export function toChatMessages(messages: SessionMessage[]): ChatMessage[] {
)
const displayRole =
message.display_kind === 'model_switch' ||
message.display_kind === 'async_delegation_complete' ||
message.display_kind === 'auto_continue'
message.display_kind === 'model_switch' || message.display_kind === 'async_delegation_complete'
? 'system'
: message.role

View file

@ -514,13 +514,6 @@ export interface SessionMessagesResponse {
}
export interface SessionResumeResponse {
/** Present when the backend found a fresh crash-interrupted turn and
* scheduled its automatic continuation; the turn arrives as a normal
* message.start stream right after this resume. */
auto_continue?: {
attempt: number
interrupted_at: number
}
inflight?: null | {
assistant?: string
/** Retained failed turn: the error the terminal frame carried (the frame