Repository navigation
feat(ai-components): agent reply steps (reasoning, tool calls, approvals) - #3924
Open
isekovanic wants to merge 1 commit into
Open
isekovanic wants to merge 1 commit into
isekovanic wants to merge 1 commit into
Conversation
Contributor
SDK Size
|
2 of 6 tasks
This branch has not been 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/RN-485
Stacked on #3921.
🎯 Goal
Show an agent reply's steps: its rounds of reasoning, its tool calls, and the questions a tool asks before it runs. The views are ported from React's AI components (#3376). Effects follow the native SDKs instead.
🛠 Implementation details
Views (all props-only, none of them reads
<Channel>)AIReasoningshows a header that counts up while the agent thinks ("Thinking... 7s") and then reads "Thought for 12s" with the step's summary.AIThinking.AIThinkingis the same header for a turn that hasn't shown any reasoning yet.AIToolCallshows the call's title, a detail line, a status icon and its duration. The detail line covers waiting for approval, a sign-in or the device, and declined, didn't complete or cancelled.AIToolApprovalandAIToolApprovalCardask the person a tool's question, such as "Share your location?", with the agent's reason and Allow / Don't Allow.AIMessageParts/AIMessagePartrender a reply's steps in order, with a neutral line for a kind this version can't show.AIToolApproverProvider/useAIToolApproversay who answers the questions on this device.Shared bits
NativeShimmerViewthrough a small internalShimmer, whichAITypingIndicatorViewnow uses too. Running calls use the platformActivityIndicator. This matches Swift and Android, not React's CSS.Intl, so we fall back the same way React does.messagePartssection in the AI theme.Thinking...key. Thearandhetranslations are new and could use a native speaker's look.ExpoChatGPTSample
LiveReasoning, fed bymessage.updated, and "thinking" comes from the session's state.session.decide.MessageListsizes bubbles to their content, andAIConversationreplaces it later anyway.🎨 UI Changes
Reasoning steps (folded, open, streaming), tool calls (running, waiting, done, failed, declined) and the approval card.
🧪 Testing
AIMessagePartViewssuite, plus duration formatting, including the iOS fallback./respondwithclient_id). calypso 0.2.3'sresponses.createdoesn't send one. Both come with the client tool runner later in this stack.yarn lint,yarn typecheck,yarn buildandyarn test:unitpass.☑️ Checklist
developbranch (stacked on feat(ai-components): AI translations via the chat SDK, AI sample on the agents router #3921)