feat: error state with retry - #13
Merged
Merged
Conversation
A failed assistant turn no longer recolors its parts into the errorContainer bubble: delivered content keeps its ink and the turn closes with a FlowErrorState card — a failure must not swallow what the user has already read. The card is the old FlowErrorBubble translated to the token system, and the first consumer of the error color role.
8 tasks
rahulbisht25
previously approved these changes
Aug 20, 2026
# Conflicts: # AGENTS.md # CHANGELOG.md # CLAUDE.md # README.md # docs/src/content/docs/roadmap.md # lib/src/models/flow_message_part.dart # lib/src/widgets/flow_message.dart # lib/src/widgets/flow_thread.dart # playground/lib/src/demo_registry.dart # playground/lib/src/playground_item.dart
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit d23a6b0. Configure here.
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
Roadmap row 20. Adds
FlowErrorState, the failure card: error glyph, host-written title and message, and a labelled retry pill. AddsFlowErrorPartto the message model and threadsonRetry,errorTitle,retryLabelthroughFlowMessageandFlowThread.Breaking (pre-1.0): a failed assistant turn no longer recolors its content into the
errorContainerbubble. Delivered parts keep their normal ink and the turn closes with the card. A turn withstatus: errorand noFlowErrorPartstill renders a default card, so status-only hosts keep a visible failure state. The user bubble's error treatment is unchanged.Notes for review:
FlowErrorBubbleandFlowRetryButton, translated to the new tokens. First consumer of theerrorcolor role.FlowErrorPart(message, retryable)mirrors the block stac_ai already emits;FlowThread.onRetry(message)matches its retry loop.retryable: falsehides the pill even when retry is wired.flow_message.dartlines with feat: code block with built-in syntax highlighting #12. Whichever merges second resolves trivial conflicts.Screenshots
errorContainerbubble; no message, no retryHow this was verified
Playground
Error Statestage on Chrome (web), both themes. Card and Minimal variants render the full and message-only anatomies. Failed turn shows a reply that died mid-sentence: partial text keeps normal ink, card sits at the part gap, Retry removes the card and resumes the streaming reveal to completion. Docs site builds clean.Checklist
flutter analyze libandflutter analyzeinexample/andplayground/are cleandart format .applieddependencies:inpubspec.yaml(Flutter SDK and flutter.dev packages only)lib/flow_ui.dartand documented indocs/and the README tableCHANGELOG.mdupdated for user-facing changes, with breaking changes called outfeat:,fix:,refactor:,docs:,chore:)Note
Medium Risk
Public API and a breaking change to how failed assistant turns render; hosts that relied on the errorContainer bubble will see a different layout and need to wire retry/copy.
Overview
Ships
FlowErrorState: a failure card (glyph, host-written title/message, optional retry pill) plusFlowErrorPart.onRetry,errorTitle, andretryLabelare threaded throughFlowMessageandFlowThread. Retry is host-owned;retryable: falsehides the pill.Breaking: a failed assistant turn no longer recolors its content into an
errorContainerbubble. Delivered parts keep normal ink and the turn closes with the card (a default one if there is noFlowErrorPart). User-bubble error treatment is unchanged. Docs, changelog, and a playground demo cover standalone, minimal, and in-thread retry.Reviewed by Cursor Bugbot for commit 69fcda5. Bugbot is set up for automated code reviews on this repo. Configure here.