Skip to content

chore(examples): move the Expo agent examples to @stream-io/stream-agents 0.4.1 - #3978

Open
oliverlaz wants to merge 1 commit into
v9-releasefrom
chore/rn-examples-stream-agents-0.4.1
Open

oliverlaz wants to merge 1 commit into
v9-releasefrom
chore/rn-examples-stream-agents-0.4.1

Conversation

@oliverlaz

Copy link
Copy Markdown
Member

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

What

  • @stream-io/calypso ^0.3.0 → @stream-io/stream-agents ^0.4.1 in ExpoChatGPTSample and ExpoCrewAssistant (the same JS SDK, renamed). Imports move to @stream-io/stream-agents and /chat. stream-chat stays on 9.55; /chat supports 9 and 10. .yarnrc.yml swaps calypso for stream-agents on the age-gate allowlist, since 0.4.1 is newer than three days.
  • Each example's agent/agentChat.ts and agent/agentTransport.ts are deleted. contexts/AppContext.tsx builds the controller from new AgentChat({ sessionId, open }) and agentChatTransport(chat, { adapt, images, reasoningEffort }), with actions: { edit: false, regenerate: false }. The transport sends the controller's messageId as requestId and a generated-UI action from custom.uiAction; a failed reply shows the kit's translated error.
  • agent/conversation.ts (new, per app): the Chat/ChatState types over LocalMessage, chatStore(chat) for useStateStore (typed for stream-chat's StateStore; the SDK's store has the same shape), a React key per chat, and whenUsed, which refreshes the drawer each time a new conversation's session is used (a first question that never reached the router has its session deleted, and the retry creates another).
  • Tools.register's run is (input, call) in 0.4 and the SDK stops waiting on a cancelled call itself, so deviceTools.ts drops the abort signal.

ExpoCrewAssistant keeps in the app what the SDK doesn't do:

  • DISPLAY_TITLES for the backend's tool steps, by wrapping adapt.
  • "Crew is getting things ready" while the agent opens a conversation about an event (awaitingAgent, now on the context, derived from whether a reply has shown).
  • lastRequest for "Try again" (questions, events and voice memos). A composer retry doesn't overwrite it, so a generated-UI action keeps its uiAction.
  • Voice memos and event-opened conversations call chat.use() once the router or backend has the request, so they're kept and listed, and a failed one isn't left behind.
  • On returning to the foreground, chat.prepare() when the session's socket is no longer live.

Checks

  • yarn lint
  • yarn workspace expochatgptsample typecheck / yarn workspace expocrewassistant typecheck
  • Run on a simulator against the local router (not done: no dev client build and no Stream API key in this checkout)

…ents 0.4.1

Replace @stream-io/calypso 0.3 with @stream-io/stream-agents 0.4.1 in
ExpoChatGPTSample and ExpoCrewAssistant, and build each conversation's
AIConversationController from the SDK's AgentChat and agentChatTransport
instead of the examples' own agentChat.ts and agentTransport.ts.

What the SDK doesn't hold stays in the apps: listing a new conversation
once it is used, and in ExpoCrewAssistant the step titles, the "getting
things ready" state, retrying the last request, voice memos and reopening
a dropped session when the app comes back to the foreground.
@oliverlaz
oliverlaz requested a review from isekovanic November 11, 2026 21:51

This branch has not been deployed

No deployments
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.

1 participant