Repository navigation
fix(AIComponents): add AIConversationController for agent conversations (v14) - #3429
Merged
Merged
Conversation
β¦ons (v14) Port stream-chat-react-native's AIConversationController (v9-release, incl. #3974) to stream-chat-react/ai-components with the same names, state and behaviour, and give AIConversation and AIMessageComposer an optional `conversation` prop. Also fixes AIPendingMessageTracker: a question whose copy arrives in the update that first passes it no longer shows twice, and a turn that starts with a reply keeps its key when older messages load above it.
Pre-merge checks:
|
Contributor
|
Size Change: +17 kB (+1.28%) Total Size: 1.35 MB π¦ View Changed
βΉοΈ View Unchanged
|
Codecov Reportβ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## release-v14 #3429 +/- ##
===============================================
+ Coverage 86.84% 87.73% +0.88%
===============================================
Files 526 599 +73
Lines 16699 20996 +4297
Branches 5251 6647 +1396
===============================================
+ Hits 14503 18420 +3917
- Misses 2196 2576 +380 β View full report in Codecov by Harness. π New features to boost your workflow:
|
oliverlaz
requested review from
aleksandar-apostolov,
isekovanic and
martinmitrevski
November 11, 2026 16:18
github-actions Bot
pushed a commit
that referenced
this pull request
Nov 11, 2026
## [14.17.0](v14.16.1...v14.17.0) (2026-11-11) ### Bug Fixes * **AIComponents:** add AIConversationController for agent conversations (v14) ([#3429](#3429)) ([1b67c7b](1b67c7b)), closes [#3428](#3428) [GetStream/stream-chat-react-native#3974](GetStream/stream-chat-react-native#3974) * **styling:** drop [@charset](https://github.com/charset) from the published CSS (v14) ([#3431](#3431)) ([6d0cf05](6d0cf05)), closes [#3423](#3423) ### Features * **AIMessageComposer:** add Actions, StopButton and an inline layout (v14) ([#3425](#3425)) ([cbc9f80](cbc9f80)), closes [#3424](#3424) [#3424](#3424) [#3424](#3424) [GetStream/getstream.io#1034](https://github.com/GetStream/getstream.io/issues/1034)
|
π This PR is included in version 14.17.0 π The release is available on: Your semantic-release bot π¦π |
This branch was successfully deployed
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.
Ticket: https://linear.app/stream/issue/REACT-1559/ai-components-add-aiconversationcontroller-port-from-react-native-and
Goal
The v14 port of #3428, for the
release-v14line.Every app built on the AI components works out
messages,pendingMessage,isThinking, ratings, retries and editing itself. StreamChatAI (iOS) and stream-chat-react-native already share one conversation-state contract (AIConversation/AIConversationController). This brings the same controller to the web kit, so both JS kits read the same and an agent SDK transport (agentChatTransport) can plug into either.Implementation details
Conversation/controller/:AIConversationController,AIConversationExchange,AIAgentError+AI_AGENT_ERROR_MESSAGE,offers,types,useAIConversationState, copied from React Nativev9-release(including fix(ai-components): align agent conversations with the other SDKsΒ stream-chat-react-native#3974). Names and behaviour are kept: send, stop, regenerate, edit/cancelEditing, retry, clearError, rate, loadOlderMessages,actions,chatOption,custom, the reply timeout and React Native's retry. A generated UI's action travels asrequest.custom.uiAction. Web adaptations only:Files; a pending message shows them through object URLs the controller makes once per file and revokes ondispose();AIMessageComposerStore, which gainsisEditing,chatOptionandcustom(newcreateAIMessageComposerStore(), React Native'screateNewComposerStore);crypto.randomUUID(with a fallback for insecure contexts), deep comparison usesreact-fast-compare,StateStorecomes fromstream-chat, anduseStateStoreis the SDK's own;AIMessagegainsrating;AI_AGENT_ERROR_MESSAGEstays English text, as in React Native; the README shows how to detect the error and show copy of your own.<AIConversation conversation={β¦}>: reads messages, the pending message, thinking (statussubmitted), older messages, the approver and reply actions (rating, regenerate when offered), and offers edit on the person's latest message. The existing props keep working;messagesis now optional.<AIMessageComposer conversation={β¦}>: uses the controller's composer store; submitting sends{ text, attachments, chatOption, custom }throughconversation.sendunlessonSubmitcallspreventDefault();SubmitButtonturns into aStopButtonwhile the agent answers, and Enter doesn't send meanwhile; an "Editing" chip with a cancel button shows whileisEditing, and the text input takes focus.ChatOptionskeeps the picked option in the store, where it stays picked across a form reset.AIPendingMessageTracker/turnsOf: ported the fixes from fix(ai-components): align agent conversations with the other SDKsΒ stream-chat-react-native#3974. A question no longer shows twice when its copy arrives in the same update, and a turn keeps its key when older messages load above it. The new tests fail onrelease-v14.Editingandaria/Cancel editing, filled in all 12 locales (React Native's wording where it has them; German and Portuguese are new).AIConversationControllersection, including the StrictMode-safe pattern (create the controller in auseEffectanddispose()it in that effect's cleanup, neveruseState(() => new β¦)plus dispose).Tests: React Native's controller and exchange suites ported to Vitest (100 tests), UI tests for the controlled conversation, the composer and a StrictMode mount, and the tracker regressions.
yarn lint(including translation validation),yarn typesandyarn test(266 files, 3550 tests) pass.UI Changes
layout='inline'it takes a full-width row. Not yet checked in a browser.