Skip to content

fix(ai-components): document a StrictMode-safe controller lifecycle and custom.uiAction - #3975

Merged
isekovanic merged 1 commit into
v9-releasefrom
fix/ai-conversation-agent-actions-docs
Nov 11, 2026
Merged

isekovanic merged 1 commit into
v9-releasefrom
fix/ai-conversation-agent-actions-docs

Conversation

@oliverlaz

Copy link
Copy Markdown
Member

Ticket: https://linear.app/stream/issue/RN-524

What

  • AIConversationController doc + new README "Conversation state" section: create the controller inside useEffect, dispose it and clear state in the cleanup, render nothing until it exists. The previous useState(() => new …) + dispose-on-cleanup example breaks under React StrictMode (cleanup disposes the controller, the remount keeps using it).
  • Document that a generated-UI action travels on AIConversationRequest.custom.uiAction (types and README). Docs only, no runtime change.
  • ExpoChatGPTSample and ExpoCrewAssistant pass actions: { edit: false, regenerate: false }: the Stream Agents router can't rewind a conversation, so edit and regenerate would just re-ask as a new question.

The two Expo examples create controllers in an event handler and dispose the previous one on switch, so they don't have the StrictMode bug.

Checks

  • yarn lint
  • yarn typecheck
  • yarn test:unit
  • yarn build

…and custom.uiAction

Create AIConversationController in the effect that disposes it, so React
StrictMode's cleanup-then-rerun doesn't leave the views with a disposed
controller. Document that a generated-UI action travels on
AIConversationRequest.custom.uiAction, and add a Conversation state section
to the ai-components README.

The Expo agent examples turn off edit and regenerate: the agents router
keeps the conversation in Stream Chat and can't rewind it.
@Stream-SDK-Bot

Copy link
Copy Markdown
Contributor

SDK Size

title develop branch diff status
js_bundle_size 2027 KB 2047 KB +20451 B 🔴
ai_components_size 163 KB 342 KB +183236 B 🔴
a2ui_size n/a 103 KB n/a 🆕

@oliverlaz
oliverlaz requested a review from isekovanic November 11, 2026 15:56
@oliverlaz oliverlaz changed the title docs(ai-components): document a StrictMode-safe controller lifecycle and custom.uiAction fix(ai-components): document a StrictMode-safe controller lifecycle and custom.uiAction Nov 11, 2026
@isekovanic
isekovanic merged commit 431719c into v9-release Nov 11, 2026
8 checks passed
@isekovanic
isekovanic deleted the fix/ai-conversation-agent-actions-docs branch November 11, 2026 17:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants