You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Flutter assistant's restaurant cards could show tables but not book one, a brand chosen in Settings was lost on restart and didn't reach cards already on screen, and a card arriving on a call or replacing a reply's text jumped into place. The app also depended on a pre-release commit of Stream's Flutter AI components, which are now on pub.dev.
How it works
The seat selector card brings its own tool. The agent can only book a table while a card offering tables is on screen:
seat selector shown, finished streaming
└─ AgentChat.bring(reserve_table) -> session.addTools
person taps a table -> agent calls reserve_table
├─ asks first: "Reserve this table?"
├─ taken or unknown table -> error naming the free ones
└─ free table -> AgentChat.reserved(booking)
├─ card shows the booking and its confirmation code
└─ AgentChat.withdraw -> session.removeTool
Change
Result
Test
reserve_table on the seat selector (trip_components.dart, agent_chat.dart)
The agent can book a free table from the card, after the person allows it
agent_chat_test.dart "a seat selector" group
Tool brought only once the card is written
A table written after the first ones can still be booked
seat_selector_test.dart "offers every table of a card written in pieces"
Booking shown on the card it came from
The card turns into "Table T4 reserved", other cards keep their tables
trip_components_test.dart
Brand kept with shared_preferences and read from the widget tree
The chosen brand survives a restart, and shown cards take it on at once
brand_theme_test.dart
SmoothSize around a reply and the call card
Text gives way to a card smoothly, a call card slides up and grows, both instant under reduced motion
smooth_size_test.dart
Changes
stream_chat_flutter_ai and stream_chat_flutter_ai_a2ui 0.2.0 from pub.dev in flutter_assistant, and stream_chat_flutter_ai 0.2.0 in flutter_demo, replacing the git pins and overrides.
Seat selector: reserve_table with approval, the booking confirmation in place of the tables, taken tables struck through and the chosen one outlined in the brand's accent.
Brand: persisted, A2UI buttons and controls take the brand's corners, Settings shows a swatch per brand and fits the screen.
Animations: a reply's text gives way to its card; on a call the card comes up from below and grows, moving the glow.
flutter_assistant's README rewritten for the app's current behaviour, with an Interactive UI section; flutter_demo's names the 0.2.0 package.
Validation
flutter analyze clean and flutter test passing in flutter_assistant (107) and flutter_demo (42); new tests also pass in random order. Each new test fails without the change it covers.
Run on the iOS simulator and an Android emulator against the hosted router: booking from an OpenUI and an A2UI card, the card turning into the booking, a brand switch re-theming a shown card, the brand surviving a cold restart, a card arriving on a call, and the Settings sheet.
flutter build apk --debug succeeds; flutter_demo answers a chat question on 0.2.0.
Move both Flutter apps to stream_chat_flutter_ai 0.2.0 from pub.dev. The seat
selector brings reserve_table to the session and takes it back once a table is
booked, showing the booking. The call card and a reply's text giving way to
its card animate, following reduce motion. The brand is kept between launches
and shown cards re-theme live. README revised.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…Settings
A seat selector shown while the agent was still writing it brought its tool
with the tables written so far, so a table written after was refused and the
card never showed the booking. Settings' brand list overflowed the sheet.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Animate a reply only when its UI takes the place of its text, so streaming text
is not held back. Keep one card on a call rather than crossfading two, whose
host would drop the outgoing card's UI. Leave the call's cards without the
chat, as iOS does. Settings follows iOS: Brand, its swatches and footers, and
clear of the status bar. Strike taken tables and outline the chosen one. A
booking after the chat was let go of changes nothing.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
AnimatedSize changes its layout while laying out when it has no duration, which
Flutter asserts against, so a reply growing as it streams, or any card under
reduced motion, threw. SmoothSize follows at once with the shortest duration
instead, for the chat reply and the call card.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The Flutter assistant now uses published Stream AI packages and supports card-scoped table reservations through session tools. Brand selections persist across launches and update existing cards. Chat and voice UI cards animate size changes, with reduced-motion support. The README files document package sources, interactive UI formats, reservation behavior, branding, and voice UI.
Merge Risk: Moderate · up to 1015f
Reserving tables from seat-selector cards works in the main chat flow. Before merging, fix three cases: a Stop pressed while the booking tool is being registered still sends the question; a tap can book the wrong card when table IDs repeat; and an unexpected saved brand value can stop the app from launching. Voice-call cards also show a table picker with no booking tool behind it.
- [ ] Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 19
Caution
Some comments are outside the diff and can’t be posted inline due to GitHub limitations.
⚠️ Outside diff range comments (1)
Major · Launch the assistant if reading the saved brand fails. · main.dart:19
examples/voice_agents/flutter_assistant/lib/main.dart:19 Major · Stability & Availability · Quick win
Launch the assistant if reading the saved brand fails.
If SharedPreferencesAsync.getString('brand') fails, BrandProfile.load() throws before runApp. The user cannot open the app because an optional preference could not be read. Handle the read error in BrandProfile.load(). Keep the default brand on failure and still register the listener so a later selection can be saved. Continue to restore the saved brand when the read succeeds.
Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.
The reason will be displayed to describe this comment to others. Learn more.
Major · Functional Correctness · Quick win
Give the displayed card a way to retry registration.
If a transient network failure prevents the registration POST from reaching the router, clearing _brought permits a retry but does not start one. The completed card stays mounted and interactive, and the error banner offers no retry for this failure. Expose the failed registration to the card and let the user retry before enabling table selection. A successful registration should still require only one POST.
The reason will be displayed to describe this comment to others. Learn more.
Fixed in 1015f8c. Tapping a table offers the card again, which adds the tool again when adding it failed, and the question waits for it. Covered by "adds the card's tool again when a table is tapped after adding it failed".
#!/bin/bashprintf'%s\n''--- table action source ---'
cat -n examples/voice_agents/flutter_assistant/lib/trip_components.dart | sed -n '640,810p'printf'%s\n''--- test setup and retry ---'
cat -n examples/voice_agents/flutter_assistant/test/seat_selector_test.dart | sed -n '1,150p'
cat -n examples/voice_agents/flutter_assistant/test/seat_selector_test.dart | sed -n '245,290p'printf'%s\n''--- find SDK registration implementation ---'
rg -n -C 5 --type dart 'Future<[^>]*>\s+addTools\s*\(|addTools\s*\(' sdks/dart
Length of output: 35103
@VelikovPetar The retry covers a tap after registration has failed. One case remains: if the user taps while registration is pending and it then fails, _add catches the error and _answer still sends the action (agent_chat.dart, Line 440 and Line 494). The same can happen if the retry fails.
Prevent the action from being sent when registration fails, and let the user retry. Add tests for both failure cases. I am not marking the finding as addressed.
If you found this review helpful, would you consider giving us a shout-out on X?
The reason will be displayed to describe this comment to others. Learn more.
Minor · Data Integrity & Integration · Quick win
Handle failed brand writes.
If Android cannot commit an Ember selection, Settings still marks Ember as selected and the cards already use it. The listener discards the failed setString Future. Tapping Ember again does not trigger another write, and the next launch can restore the previously saved brand. Keep the live preview, but handle the write result and let the user retry the same selection. (raw.githubusercontent.com)
The reason will be displayed to describe this comment to others. Learn more.
Fixed in 1015f8c: a failed save is caught and logged instead of surfacing as an unhandled error. No retry: the brand is a local preference and the live preview already applies.
The reason will be displayed to describe this comment to others. Learn more.
@VelikovPetar The save failure is now logged. I accept the decision not to add a retry. I am not marking the finding as addressed because the original request included a retry.
Learnings added
Learnt from: VelikovPetar
Repo: GetStream/Agents PR: 2070
File: examples/voice_agents/flutter_assistant/lib/brand_theme.dart:0-0
Timestamp: 2026-11-18T13:40:29.790Z
Learning: Within repository "GetStream/Agents", only for files matching one of ["examples/voice_agents/flutter_assistant/lib/brand_theme.dart"]: In examples/voice_agents/flutter_assistant/lib/brand_theme.dart, the author accepts logging a failed brand-preference save without adding a retry because the preference is local and the live preview remains applied. A failed save can leave the previous brand stored for the next launch. Do not repeat the retry-only request without new context.
Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.
If you found this review helpful, would you consider giving us a shout-out on X?
The reason will be displayed to describe this comment to others. Learn more.
Minor · Maintainability & Code Quality · Quick win
Remove the persistence fixture after this test.
If this test runs first, BrandProfile.load() leaves a listener that retains its fake store. The widget test then writes to that store when it selects Ember. Resetting active does not remove the listener and can trigger another write. Detach the persistence listener before resetting active, and restore the previous SharedPreferencesAsyncPlatform.instance. Restoring the platform instance alone does not release the store captured by the listener. (raw.githubusercontent.com)
The reason will be displayed to describe this comment to others. Learn more.
Leaving as is: each test file runs in its own isolate, and the other test in this file resets the brand in tearDown, so the listener cannot reach another test.
@VelikovPetar Understood. I’ll leave the change as-is.
One correction: tearDown resets the brand but does not remove the listener. Later tests in the same file can still trigger it. I won’t mark the finding as addressed.
The app opens with the default brand when the saved one can't be read. The call
card's slide no longer adds a listener each time a streaming card rebuilds. The
seat selector test proves a card still being written brings no tool, and the
booking test that the booked card stops offering its tables.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A second card offering other tables couldn't be booked, two venues with the same
table ids shared a booking, and booking one card cleared another's. Each card now
offers its tables by the reply it is in, and keeps its own booking; the tool is
taken back once every card is booked, and kept until the router lets it go.
A question waits for a card's tool still being added, tapping a table adds it
again if adding it failed, the tool refuses a summary that doesn't name the table
being booked, and a brand that can't be saved is logged.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai On the outside-diff finding (main.dart:19, launching when the saved brand can't be read): fixed in 039d940. BrandProfile.load keeps the default brand when the read fails and still saves later choices; covered by brand_theme_test.dart "load opens with the default brand when the saved one cannot be read, and keeps the next".
520-520: Major · Data Integrity & Integration · Heavy lift
Unverified finding
Verification ran but could not confirm this finding. It is shown for review, not as a verified issue.
Retire offers when their source reply is deleted.
If a reply offering T1 is deleted, the feed hides the reply but _offers still accepts bookings for T1. The stale offer also prevents tool withdrawal when the remaining card is booked. Remove the offer when its source is deleted or no longer contains the selector. Do not remove it just because the user scrolls it off screen. (raw.githubusercontent.com)
Files skipped from review as they are similar to previous changes: 1
examples/voice_agents/flutter_assistant/README.md
Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.
The reason will be displayed to describe this comment to others. Learn more.
Major · Functional Correctness · Quick win
Recheck cancellation after tool registration.
If the user presses Stop while _adding is pending, send still calls responses.create when registration finishes. It interrupts only after the router receives the request. A close during the wait also does not prevent the POST. Move the wait before the final _checkNotStopped and _usedSessionId assignment. A stopped request should return to the composer without reaching the router. (raw.githubusercontent.com)
The reason will be displayed to describe this comment to others. Learn more.
Minor · Functional Correctness · Quick win
Do not send a card action after the chat closes.
If the user leaves while _answer waits for _adding, the method still attempts the response POST for the old chat. The catch can hide a rejection, but it cannot prevent the request. Check _closed immediately after the wait. (raw.githubusercontent.com)
The reason will be displayed to describe this comment to others. Learn more.
Major · Data Integrity & Integration · Heavy lift
Do not treat an unconfirmed DELETE as an installed tool.
If the router removes reserve_table but its reply is lost, the SDK marks the removal unsettled. _brought still makes bring skip registration for every new card and every retry tap. Track this outcome separately from confirmed installation. On the next offer, let addTools use the SDK's existing reconciliation path. (raw.githubusercontent.com)
The reason will be displayed to describe this comment to others. Learn more.
Major · Stability & Availability · Heavy lift
Reconcile new offers with a pending withdrawal.
If booking A starts a DELETE and B appears before it completes, B's registration is skipped because _brought still contains reserve_table. Tapping B in that window also skips registration. If the DELETE takes effect before the next turn starts, that turn has no booking tool. Track the pending removal and make B's request wait for registration after the removal settles. Do not re-add the tool if no unbooked offer remains. (raw.githubusercontent.com)
The reason will be displayed to describe this comment to others. Learn more.
Major · Data Integrity & Integration · Heavy lift
Book the offer the user selected.
If Terrace and a newer Garden card both offer T1, tapping Terrace can book Garden. The action identifies the originating reply, but reserve receives only the table ID and picks the newest match. Even a summary that correctly says Terrace does not change that lookup. Carry the offer identity through to reserve and reject a stale or unavailable selection instead of booking another venue. (raw.githubusercontent.com)
The reason will be displayed to describe this comment to others. Learn more.
Major · Functional Correctness · Heavy lift
Voice seat selectors present booking without a way to book.
On a voice call, the seat selector renders without AgentChatScope. Its offer and reserve_table registration run only when a chat scope is present (trip_components.dart:803-804). A table tap on a voice selector can therefore reach the agent with no booking tool or approval available.
Make the voice behavior match one of two options:
Register the booking flow for voice sessions, so a completed voice seat selector offers the same approval-based booking as a chat card.
Do not present the picker as bookable on voice cards.
The reason will be displayed to describe this comment to others. Learn more.
Minor · Functional Correctness · Quick win
Wait for the repeat offer before counting registration requests.
This assertion runs immediately after the second chat.offer. If the duplicate guard is removed, the SDK queues another add, but the second POST cannot reach the fake router before this assertion. The test still sees one request. Await completion of the second offer's registration work before checking the request count. (raw.githubusercontent.com)
As per path instructions, flag “tests that would still pass on a broken implementation.”
The reason will be displayed to describe this comment to others. Learn more.
Minor · Functional Correctness · Quick win
Assert that the write-failure test attempts a save.
The test passes after 50 ms even if the Ember selection never calls _UnwritableStore.setString. Record the key and value in the fake before it throws. Wait for that signal with a timeout and assert that the test attempted to save brand=ember. Keep the test harness check for unhandled errors.
As per path instructions, flag “tests that would still pass on a broken implementation.”
The reason will be displayed to describe this comment to others. Learn more.
Minor · Functional Correctness · Quick win
Assert that the rewrite makes T1 unbookable.
This test passes if a rewrite adds T7 but leaves the old, available T1 in the booking lookup. Attempt T1 first and assert rejection without a confirmation. Then book T7 as the test does now. Checking T1 after booking T7 would let the booked-card guard hide stale availability.
As per path instructions, flag “tests that would still pass on a broken implementation.”
The reason will be displayed to describe this comment to others. Learn more.
Minor · Functional Correctness · Quick win
Wait for the registration failure before tapping to retry.
brought proves only that the fake router received the POST. If the tap runs before _add processes the 500 and clears _brought, the app correctly skips a concurrent add and the test times out waiting for a second POST. Wait for chat.failure to report the first add error before changing the response and tapping. (raw.githubusercontent.com)
For best results, initiate chat on the files or code changes.
Analysis chain
Script executed:
#!/bin/bashset -u
printf'%s\n''=== Matching files ==='
fd -t f -g 'main.dart' examples/voice_agents/flutter_assistant/lib
fd -t f -g 'brand_theme.dart' examples/voice_agents/flutter_assistant/lib
fd -t f -g 'brand_theme_test.dart' examples/voice_agents/flutter_assistant/test
forfilein \
examples/voice_agents/flutter_assistant/lib/main.dart \
examples/voice_agents/flutter_assistant/lib/brand_theme.dart \
examples/voice_agents/flutter_assistant/test/brand_theme_test.dart
doprintf'\n=== Outline: %s ===\n'"$file"
ast-grep outline "$file" --items all 2>&1||trueprintf'\n=== Contents: %s ===\n'"$file"
cat -n "$file"doneprintf'\n=== Reported commit ===\n'
git show --stat --oneline 039d94051 -- \
examples/voice_agents/flutter_assistant/lib/main.dart \
examples/voice_agents/flutter_assistant/lib/brand_theme.dart \
examples/voice_agents/flutter_assistant/test/brand_theme_test.dart 2>&1||trueif git merge-base --is-ancestor 039d94051 HEAD 2>/dev/null;thenecho'Reported commit is an ancestor of HEAD.'elseecho'Reported commit ancestry could not be established from this checkout.'fi
Length of output: 21504
@VelikovPetar I checked commit 039d94051. BrandProfile.load catches read-time PlatformExceptions and still registers the save listener. The cited test covers the fallback and a later save.
I did not run the test.
If you found this review helpful, would you consider giving us a shout-out on X?
Thank you for using CodeRabbit!
You are interacting with an AI system.
This branch has not been deployed
No deployments
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
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.
Why
The Flutter assistant's restaurant cards could show tables but not book one, a brand chosen in Settings was lost on restart and didn't reach cards already on screen, and a card arriving on a call or replacing a reply's text jumped into place. The app also depended on a pre-release commit of Stream's Flutter AI components, which are now on pub.dev.
How it works
The seat selector card brings its own tool. The agent can only book a table while a card offering tables is on screen:
reserve_tableon the seat selector (trip_components.dart,agent_chat.dart)agent_chat_test.dart"a seat selector" groupseat_selector_test.dart"offers every table of a card written in pieces"trip_components_test.dartshared_preferencesand read from the widget treebrand_theme_test.dartSmoothSizearound a reply and the call cardsmooth_size_test.dartChanges
stream_chat_flutter_aiandstream_chat_flutter_ai_a2ui0.2.0 from pub.dev influtter_assistant, andstream_chat_flutter_ai0.2.0 influtter_demo, replacing the git pins and overrides.reserve_tablewith approval, the booking confirmation in place of the tables, taken tables struck through and the chosen one outlined in the brand's accent.flutter_assistant's README rewritten for the app's current behaviour, with an Interactive UI section;flutter_demo's names the 0.2.0 package.Validation
flutter analyzeclean andflutter testpassing influtter_assistant(107) andflutter_demo(42); new tests also pass in random order. Each new test fails without the change it covers.flutter build apk --debugsucceeds;flutter_demoanswers a chat question on 0.2.0.🤖 Generated with Claude Code