Skip to content

feat: hold voice conversations through an app-provided transport - #189

Merged
nozokada merged 36 commits into
adobe:feature/voicefrom
nozokada:feat/voice-transport
Nov 24, 2026
Merged

nozokada merged 36 commits into
adobe:feature/voicefrom
nozokada:feat/voice-transport

Conversation

@nozokada

@nozokada nozokada commented Oct 23, 2026 •

Copy link
Copy Markdown
Member

Stacked on #174. Merge order: #174 → #189 → #191. GitHub can't base a PR on a fork branch, so this targets feature/voice and also shows #174's changes until #174 merges.
Base: feature/voice, cut from main at 5.10.3. Voice lands there, not in dev, so releases during the restricted change period don't pick it up. The pilot will use a prerelease tag on that branch, and the branch goes to dev once a public release is approved.
This PR's own changes only: feat/voice-bootstrap...feat/voice-transport

Its commits (merges from main, dev and #174 sit between them):

  • feat: add the voice transport interface and voice session logic
  • feat: hold voice conversations through an app-provided transport
  • test: avoid weak let so the voice tests build with Xcode 16
  • feat: pass a VoiceConnection to the transport and support reconnecting
  • fix: accept only wss and https voice server URLs
  • docs: explain why the voice session checks microphone permission again
  • feat: let Concierge.wrap take a voice transport for the floating button
  • feat: fail a voice session whose transport does not connect within 20 seconds
  • docs: mention wrap where the VoiceTransport docs list the APIs that take it
  • fix: allow one voice conversation at a time across the app
  • fix: apply audio interruptions while connecting and end the session when audio can't resume
  • fix: fail a voice session the agent ends because of an error
  • fix: keep voice replies on screen as they arrive
  • feat: keep a voice conversation running in the background when the transport opts in
  • feat: parse the full voice ui_payload and text_input_error
  • feat: render each voice turn's end like a typed turn
  • feat: send prompt suggestions tapped during voice to the voice agent
  • feat: freeze the held XDM context for a voice conversation
  • Show the thinking indicator while a voice turn waits for its reply
  • Register the voice transport with Concierge.setVoiceTransport
  • Align voice availability wording with the registered transport
  • List the voice conversation and transport in the identity reset docs

Still on #174's previous shape. #174 now sends the bootstrap in a new shape that Stage doesn't accept yet (see #174). This PR stays on #174's previous head (495e074), so it still shows and sends the old shape (data: {"type": "livekit-bootstrap"} and xdm.eventType: "conversation.voice") and can still be tested against Stage. It picks up the new shape once the service change is on Stage. Then ChatController passes the resolved auth token to bootstrapVoiceSession, and #191's getting-started guide no longer says the token isn't sent.

Replaces #185. Instead of discovering an AEPVoice plugin through AEPPluginSupport, Brand Concierge now owns the voice session logic, and the app supplies the real-time transport itself, registering it with Concierge.setVoiceTransport (section 7).

The per-request stream handler fix that was carried over from #185 is now its own PR, #195, against main. It isn't needed for voice: the voice bootstrap stream closes right after it delivers the credentials.

Summary

Brand Concierge can hold a voice conversation over a transport the app provides. BC owns the conversation: credentials, microphone permission, session lifecycle, audio interruptions, data-channel parsing, transcript and UI. The app owns only the audio connection, through a small public VoiceTransport protocol. BC takes no LiveKit, AEPVoice or AEPPluginSupport dependency, and apps that don't use voice ship no WebRTC code.

Concierge.setVoiceTransport(myVoiceTransport)
Concierge.show(surfaces: ["my-surface"])

Changes

1. Transport interface and voice session logic

  • New public API (Sources/Protocols/VoiceTransport.swift):
    • VoiceTransport: delegate, continuesInBackground, connect(_:), setMicrophoneEnabled(_:), disconnect(), send(_:topic:)
    • VoiceConnection: what connect(_:) receives, url and token. New fields can be added later without breaking existing transports.
    • VoiceTransportDelegate: voiceTransport(_:didChange:), voiceTransport(_:didReceive:topic:)
    • VoiceTransportState: .connected, .reconnecting, .disconnected, .failed(Error)
  • Moved in as internal types, from the AEPVoice prototype: VoiceSessionController, DataChannelMessage, DataChannelMessageParser, the session state and the transcript role.
  • Interface decisions:
    • Lifetime: one reusable transport instance serves every conversation. A session claims it (becomes its delegate) only while connected, and releases it (clears the delegate, then disconnects) before reporting its end. The transport must report nothing about a connection after its disconnect(). Callbacks from any other sender, or after release, are dropped.
    • Method shape: synchronous calls on main, with outcomes reported to the delegate (from any thread). The exception is send(_:topic:), which is async throws; see section 4.
    • Microphone state: the transport has no getter. BC treats the microphone as live once .connected, and changes it only through setMicrophoneEnabled, to mute during audio interruptions such as a phone call.
    • Interruptions: tracked apart from the session state, so an interruption that begins while connecting mutes the microphone as soon as .connected arrives. When it ends with .shouldResume, BC unmutes. iOS often omits that option, and the chat has no unmute control, so without it the session fails with the usual voice error and BC calls disconnect().
    • Naming: delegate methods follow the Swift sender convention (voiceTransport(_:didChange:)), not the shorthand didChange(state:).
    • Surface: there is no .connecting state, because BC tracks connecting itself.
    • Reconnecting: a transport reports .reconnecting while it recovers a dropped connection (a network change, for example) and .connected once it is back. BC shows the connecting spinner and keeps the microphone as it was. If the transport is not back within 30 seconds, the session fails and BC calls disconnect().
    • Connect timeout: the transport is app code, so BC doesn't wait forever for it. If neither .connected nor .failed arrives within 20 seconds of connect(_:), the session fails with the usual voice error and BC calls disconnect().

2. Voice in the chat

  • The app registers its transport once with Concierge.setVoiceTransport(_:) (section 7). show, present and wrap don't take it.
  • The UI and ChatController behaviour come from feat: integrate the optional voice plugin #185:
    • The voice button takes the send slot while the text field is empty.
    • Transcripts render as bubbles that update in place until final.
    • The microphone permission is asked for before any credentials are requested. A denial starts nothing and shows the Settings dialog, worded for voice conversations (same as Android). VoiceSessionController checks it again, as a safety net for callers that don't go through ChatController.
    • The server URL in the credentials must be wss or https, because the token travels on that connection. Any other scheme fails the session before the transport is touched.
    • Failures show the theme's network error copy and track errorOccurred.
    • When the voice agent ends the session, its inactivity and join timeouts end the conversation quietly. error, worker_shutdown, or an unknown or missing reason fails it with the usual voice error and errorOccurred.
    • Typed sends, dictation and data handoffs are held off during voice. Prompt suggestion taps go to the voice agent instead (section 4).
    • One voice conversation at a time across the app. The overlay chat and a UIKit chat can be open together and share the transport, so a chat claims voice at the voice tap and releases it when its conversation ends or the chat goes away. Meanwhile the other chats' voice button is disabled, so a second conversation can't take the transport's delegate or hang up the first call.
    • Stopping, the view disappearing, or an identity reset ends the session and cancels a still-open bootstrap.
    • While the agent's reply streams in, the list keeps the user's latest words in view and reserves space below them, so the reply grows on screen instead of below it. Voice leaves ChatState idle, so this uses its own scroll anchor (the latest user bubble, or the agent's first bubble when it speaks first).
  • ChatController now drives the internal VoiceSessionController instead of a plugin session.
  • Docs:
    • getting-started.md has an "Optional: voice conversations" section.
    • The implementation guide has a Concierge.setVoiceTransport(_:) entry (section 7).
    • The reference LiveKitTransport for the sample app lands in a follow-up.

3. Background conversations

  • VoiceTransport.continuesInBackground (default false through a protocol extension, so existing transports are unaffected) lets a transport opt in to keeping the conversation running when the app goes to the background: screen locked, or another app in front. BC reads it once per conversation, right before connect(_:).
  • On backgrounding, a conversation whose transport opted in and was asked to connect keeps running: transcripts, UI payloads and the agent ending the session are applied as they arrive and are visible on return. One without the opt-in, or still asking for microphone permission or fetching credentials, ends as before, since iOS doesn't let an app start the microphone from the background.
  • The app must also declare the audio background mode, and its transport must start the microphone inside connect(_:).
  • Every conversation ends normally 60 minutes after the transport first reports .connected, in the foreground or the background, so a forgotten conversation can't hold a room indefinitely. Reconnects don't restart the count. The cap is fixed.
  • The agent's 60 s inactivity timeout is unchanged, so a silent background conversation still ends after about a minute.
  • Docs: getting-started.md has a "Background conversations" part covering the opt-in, the background mode and the cap.

4. Voice turns: UI payloads, turn states and suggestion taps (second review)

  • UI payloads: the parser decodes the agent's whole ui_payload (sources, promptSuggestions, multimodalElements) into the same models typed chat uses. The agent can send several per turn, each a full snapshot, so the latest one is kept. When the turn ends, the reply bubble gets its sources, and cards, carousels, CTAs and prompt suggestions render through typed chat's code. widgets aren't rendered, as in typed chat.
  • Turn states, matching web's handleTurnDone:
    • The user's transcript decides the current turn (turnId). A new user turn closes the open reply bubble, and messages for another or an already-finished turn are dropped.
    • error or an empty fullText: the reply bubble shows the new voice.turn.failed copy, the payload still renders and the session continues. interrupted counts as completed. A late error after a completed turn (failed playback) is dropped.
    • ChatController gets each turn's end through a new internal listener callback, voiceSession(_:didFinishTurn:).
  • Suggestion taps during voice, as on web: a tap (welcome suggestions included) is sent to the agent as {"type":"text_prompt","turn_id","text"} on topic bc-text-input, through the new VoiceTransport.send(_:topic:). The SDK builds the message, so transports only move bytes. The user's bubble shows at once and the agent's echo of it is not shown again. Taps are ignored while connecting or reconnecting, and from the start of the user's speech until the reply starts. A text_input_error for the tap, or the user speaking before the agent takes it, fails it with voice.turn.failed; a send that throws shows voice.turn.messageSendFailed. The tap is tracked as querySubmitted, like a typed send. The composer stays read-only during voice, as on web. After voice ends, taps go through SSE as before.
  • send(_:topic:) must deliver reliably and throw if it can't. It has no default implementation, so existing transports must add it. The sample app's LiveKitTransport implements it in feat: add voice to the demo app through a LiveKit transport #191.
  • Copy: voice.turn.failed ("Sorry, I couldn't process that. Please try again.") and voice.turn.messageSendFailed ("Sorry, your message couldn't be sent. Please try again."), same keys and defaults as web, in the style guide.
  • Docs: getting-started.md covers send (reliable delivery, throwing) and suggestion taps during voice.

5. Held XDM context during voice

  • The voice bootstrap (feat: add voice session bootstrap request #174) sends the held XDM context (updateXDMContext) for the bootstrap's session, and the service uses it for every turn of the conversation. So the context is captured once, when the conversation starts, as on web. Updates made during the conversation apply from the next voice conversation or typed message.
  • A suggestion tapped during voice is tracked as querySubmitted with that captured context, matching what the service sends.
  • Docs: the implementation guide's XDM context section lists voice conversations and says when the context is captured.

6. Thinking indicator during voice

  • While a voice turn waits for its reply, the chat shows the thinking indicator with the theme's loading.message ("Generating response from our knowledge base"), as typed chat does. It appears when the user's final words (or a suggestion tap) show, and the reply's first text replaces it in the same bubble.
  • VoiceSessionController reports the wait to ChatController through a new internal listener callback, voiceSession(_:didChangeAwaitingReply:). It turns off after the reply's first text, at the turn's end (completed, error, text_input_error, a failed send), when a newer turn replaces the turn, and when voice ends. An indicator still empty at that point is removed, so none is left after a stop or a failure.
  • Not shown for an utterance with no final words, or a turn the agent opens. There's no watchdog, unlike web's 20 s one: a failed turn always ends with turn_completed(state=error).
  • Docs: getting-started.md mentions the indicator.

7. One transport for the app, registered with Concierge.setVoiceTransport

  • Replaces the voiceTransport: argument on show, present and wrap, as proposed in this comment. The argument was never released, so nothing is deprecated.
  • Concierge.setVoiceTransport(_ transport: VoiceTransport?) can be called from any thread, like setAuthTokenProvider. Every chat reads the registered transport, so a new value reaches chats that are already open as well as later ones. The show/present (replace all) vs wrap (replace only what is passed) difference no longer applies to it.
  • A running conversation keeps the transport it started with; a new one is used from the next conversation. After nil, the voice button stays while a conversation runs, so the user can stop it, and disappears once it ends. Resetting identities keeps the registered transport.
  • ChatController reads the transport from a shared holder when voice starts instead of capturing it when the session is created. Voice now stays available while a conversation runs even without a transport, as on Android, so clearing it doesn't hide the stop button.
  • Docs: getting-started.md and the implementation guide register the transport once at launch, and the guide's identity reset notes say a reset ends the voice conversation and keeps the transport.

API note

ChatState (public) is unchanged. ChatController tracks a running voice conversation separately, so apps that switch over ChatState exhaustively keep compiling.

Test plan

  • VoiceSessionControllerTests (64): session lifecycle, connect and reconnect timeouts, the background opt-in snapshot and the 60-minute cap (started on the first .connected, not restarted by reconnects, cancelled on end), credential validation (including ws / http rejected), permission, transport sharing and foreign callbacks, interruptions (including while connecting, and ending without .shouldResume), agent-ended sessions by reason, transcript assembly, turn tracking (new user turn, other and finished turn ids, error / empty / interrupted states, late error), suggestion sends (payload and topic, echo, gating, text_input_error, speech before the echo, send failure) and the thinking indicator's on and off signals, all through a FakeVoiceTransport.
  • DataChannelMessageParserTests (22): including the full ui_payload and text_input_error.
  • ChatControllerVoiceSessionTests (63): availability, backgrounding (kept with the opt-in once connecting, ended without it or before connect), the voice scroll anchor, permission before credentials (a denial starts nothing), makeSession wiring, the registered transport (reaching an open chat, also from a background thread; cleared or replaced during a conversation), bootstrap/connection handoff, transcript rendering, end/failure/stop/cancel (including the agent ending with an error), transport reuse, one conversation app-wide, stale callbacks, gating, identity reset, each turn's end (reply rewritten with sources, cards and suggestions; failure copy), suggestion taps to the transport during voice and over SSE after it, the held XDM context and session sent with the bootstrap, a suggestion tap tracked with that context after it changes, and the thinking indicator (shown, replaced by the reply, removed on stop and on a newer turn).
  • ThemeDecodingTests: the two new copy tokens.
  • ComposerEditingViewTests: voice/send button placement (6 cases).
  • MessageListViewShouldFillRemainingHeightTests (17): space reserved below the voice scroll anchor.
  • Full UnitTests suite: 1128 tests. The only failures are 9 snapshot tests (ProductCardCarouselSnapshotTests, PrivacyNoticeSnapshotTests), which fail the same way without this PR's changes on the local simulator, and the flaky ConciergeTests.test_resetIdentities_staleCompletionDoesNotConsumeActiveRequest, which fails about 1 run in 10 without section 5 too.
  • ConciergeDemoApp builds.
  • The SPM package builds in isolation for device and simulator, with no LiveKit or AEPPluginSupport in its graph.
  • Manual voice conversation with the demo app's LiveKit transport (feat: add voice to the demo app through a LiveKit transport #191).
  • Background on device (iPhone 17 Pro, iOS 27.0.1, demo app from feat: add voice to the demo app through a LiveKit transport #191, cap temporarily shortened to 3 minutes in a local build): screen locked, another app in front, locking while connecting, an incoming call, Wi-Fi ↔ cellular, AirPods, force-quit from the app switcher, the cap ending the conversation, and 60 s of silence in the background. No room was left open.
  • On device again with section 4 and feat: add voice to the demo app through a LiveKit transport #191's LiveKitTransport.send: a product card arriving while the screen is locked renders with the reply after unlocking, and a suggestion tapped during voice reaches the agent, which answers by voice.
  • On device with section 6 (iPhone 16e, iOS 27.2.1, demo app from feat: add voice to the demo app through a LiveKit transport #191, Stage config in a local build only): the thinking indicator shows after speaking and after a suggestion tap, turns into the reply when its text starts, and is removed when voice stops or fails.

@nozokada nozokada mentioned this pull request Oct 23, 2026
7 tasks done
@codecov

codecov Bot commented Oct 26, 2026 •

Copy link
Copy Markdown

nozokada and others added 5 commits October 28, 2026 15:38
Adds the public VoiceTransport protocol, through which an app supplies the
real-time audio and data connection for voice conversations, and brings the
voice session logic into Brand Concierge as internal types: the session
controller, the data-channel message parser and the session state.

The session claims the app's single transport only while connected, and
releases it (clearing the delegate, then disconnecting) before reporting its
end, so the transport can be reused by the next conversation.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Concierge.show(...) and Concierge.present(...) take an optional voiceTransport,
kept across re-shows like textSpeaker. When one is passed, the composer shows a
voice button in the send slot; tapping it fetches session credentials from the
Concierge service and runs the conversation over the app's transport. The
transcript renders in the chat, and typed turns, dictation and data handoffs
are held off until the conversation ends.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
# Conflicts:
#	AEPBrandConcierge/Sources/Controllers/ChatController.swift
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
# Conflicts:
#	AEPBrandConcierge/Tests/UnitTests/ConciergeChatServiceTests.swift
@nozokada
nozokada force-pushed the feat/voice-transport branch from 7e65fa8 to 9bf2102 Compare October 28, 2026 22:42
nozokada and others added 16 commits October 29, 2026 17:09
…redentials

Only the voice session itself watched for the app entering the background,
and it exists only once the credentials arrive. Going to the background
while they were still being fetched left the request running, and the
session then connected and opened the microphone. The chat controller now
stops voice on background in every phase, cancelling a pending credentials
request, so the session no longer watches for it separately.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…re a voice session

Track a running voice conversation with ChatController.isVoiceSessionActive instead of a new public ChatState case, so exhaustive switches in host apps keep compiling.

Ask for microphone permission before requesting voice credentials. A denial starts nothing and shows the Settings dialog worded for voice conversations, matching Android.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
connect(url:token:) becomes connect(_ connection: VoiceConnection), a value
type Brand Concierge creates, so connection details can be added later without
breaking app transports.

VoiceTransportState gains .reconnecting. The conversation stays open with the
connecting indicator, the microphone is left as it was, and the session fails
if the transport does not report .connected again within 30 seconds.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
… seconds

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…ake it

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The overlay chat and the UIKit chat can be open together and share the
app's transport. A chat now claims voice at the voice tap and releases it
when its conversation ends or the chat goes away; meanwhile the other
chats' voice button is disabled, so a second conversation can no longer
take the transport's delegate or hang up the first call.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…hen audio can't resume

An interruption is now tracked apart from the session state, so a
.connected that arrives during a phone call mutes the microphone instead
of leaving it live. When the interruption ends without .shouldResume, the
session fails with the usual error message instead of staying muted with
no way to unmute.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
session_ended always ended the session normally, so a server error showed
nothing and sent no error event. Only the agent's timeouts end normally
now; error, worker_shutdown and unknown or missing reasons fail the
session with the usual voice error.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Voice leaves the chat state idle, so the list reserved no space below the
user's words and the scroll to them clamped near the bottom; the agent's
reply then grew below the screen. Keep a voice scroll anchor (the latest
user bubble, or the agent's first bubble when it speaks first) and reserve
space below it while only agent bubbles follow it.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…ansport opts in

VoiceTransport gains continuesInBackground, false by default in a protocol
extension so existing transports are unaffected. Brand Concierge reads it
once per conversation at connect. When the app goes to the background, a
conversation whose transport opted in and was asked to connect keeps
running; one without the opt-in, or still asking for microphone permission
or fetching credentials, ends as before, since iOS doesn't let an app start
the microphone from the background.

Every conversation now ends normally 60 minutes after the transport first
reports .connected, in the foreground or the background, so a forgotten
conversation can't hold a room indefinitely. Reconnects don't restart the
count.

The getting-started guide describes the opt-in, the audio background mode
the app must declare and the App Review note.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@nozokada nozokada mentioned this pull request Nov 9, 2026
1 task done
@nozokada
nozokada changed the base branch from main to dev November 9, 2026 23:07
@nozokada
nozokada marked this pull request as ready for review November 9, 2026 23:15
@nozokada
nozokada requested a review from ishwetansh November 9, 2026 23:33
@nozokada
nozokada changed the base branch from dev to feature/voice November 10, 2026 02:29

@cdhoffmann cdhoffmann left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Separately, voiceTransport adds another optional parameter across show, present and wrap, while those APIs already differ in which options they accept. Could we consider a shared chat-options object before the public API grows further? This isn't a blocker for the voice behavior, but I'd like to align with Ryan on the iOS/Android direction.

@nozokada

Copy link
Copy Markdown
Member Author

Separately, voiceTransport adds another optional parameter across show, present and wrap, while those APIs already differ in which options they accept. Could we consider a shared chat-options object before the public API grows further? This isn't a blocker for the voice behavior, but I'd like to align with Ryan on the iOS/Android direction.

@cdhoffmann Agreed on the chat-options object. Since voiceTransport isn't released yet, I'd replace it with a shared options object on show, present and wrap in this PR, with Android following. I'll align with @rymorale on the shape first.

nozokada and others added 3 commits November 17, 2026 14:55
Decode ui_payload sources, prompt suggestions and multimodal elements
into the models typed chat already uses, so a voice turn can render
them. Each field decodes on its own, so a malformed field drops only
its own content. Widgets are not modeled because the SDK has no widget
support.

Parse the worker's text_input_error, which rejects a text prompt sent
during a voice session.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Track the current voice turn the way web's handleTurnDone does. The
user's transcript decides the turn; a new user turn closes the open
reply, and messages for any other or already finished turn are dropped.
The latest ui_payload snapshot is held for the turn.

When the turn ends, the reply bubble gets the authoritative text and the
sources, followed by the cards, CTAs and suggestions, through the same
code typed chat uses. An error or an empty reply replaces the bubble
with the new voice.turn.failed copy, still renders the payload and
keeps the conversation open. An interrupted turn counts as completed.

Add the voice.turn.failed and voice.turn.messageSendFailed copy with
web's defaults.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Add VoiceTransport.send(_:topic:), which the app implements with
reliable delivery. During a voice conversation, a tapped prompt
suggestion (including a welcome one) goes to the worker as a
text_prompt on the bc-text-input topic, like on web, and is tracked as
a submitted query. The user's bubble shows at once and the worker's
echo of it is dropped. After the conversation ends, taps stream over
SSE as before; the composer stays read-only during voice, as on web.

Taps are dropped while connecting or reconnecting, and from the start
of the user's speech until the reply starts. A rejected prompt
(text_input_error) fails the turn with voice.turn.failed, and a send
that throws fails it with voice.turn.messageSendFailed.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@nozokada

Copy link
Copy Markdown
Member Author

Separately, voiceTransport adds another optional parameter across show, present and wrap, while those APIs already differ in which options they accept. Could we consider a shared chat-options object before the public API grows further? This isn't a blocker for the voice behavior, but I'd like to align with Ryan on the iOS/Android direction.

@cdhoffmann Agreed on the chat-options object. Since voiceTransport isn't released yet, I'd replace it with a shared options object on show, present and wrap in this PR, with Android following. I'll align with @rymorale on the shape first.

@cdhoffmann On your comment about a shared chat-options object: instead, I'd drop the voiceTransport parameter from show, present and wrap and add a global setter, like setAuthTokenProvider:

Concierge.setVoiceTransport(myVoiceTransport)

Android would do the same, replacing the ConciergeChat(voiceTransport:) parameter and ConciergeChatView.voiceTransport.

• Apps keep one transport instance, and only one voice conversation runs at a time, so a per-call parameter adds nothing.
• The difference between show/present (replace all) and wrap (replace only what's passed) no longer applies to it.

An options object for the existing parameters could come later. Does this work for you? If so, I'll confirm it with @rymorale for both platforms.

nozokada and others added 7 commits November 18, 2026 15:43
A voice session failure now carries a typed reason with a fixed message.
Errors from the app's transport and the bootstrap call can include URLs,
tokens or server responses, so their text only goes to the debug log and
never to Edge or the warning and error logs.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
When the final transcript for a turn has no text, the open bubble is
removed instead of being left empty, and the next bubble becomes the
scroll anchor.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
setMicrophoneEnabled returns immediately and can't throw, so a transport
whose mute or unmute fails is the only one that knows. Brand Concierge
can't tell whether the microphone is live then, so the transport now
reports .failed and the conversation ends.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The voice bootstrap now carries the held XDM context, resolved for the
same session as the bootstrap request. The service replays it on every
voice turn, so a tapped prompt suggestion's Query Submitted event uses
that snapshot rather than the store's current context. Updates made
during a voice conversation apply from the next conversation or typed
message; the implementation guide says so.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The session reports when the current turn starts and stops waiting for
its reply: from the user's final transcript, spoken or sent as text,
until the reply's first text, the turn's end, a newer turn or the end of
the session. The chat shows the wait the way a typed turn does, as an
empty reply bubble with the theme's loading message, and the reply fills
that bubble. An empty bubble left behind is removed.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
show, present and wrap no longer take a voiceTransport. The app
registers one transport with Concierge.setVoiceTransport(_:), from any
thread, and every chat reads it, so a new value reaches chats that are
already open as well as later ones. A running conversation keeps the
transport it started with. After nil, the voice button stays while a
conversation runs, so the user can stop it, and disappears once it
ends. Resetting identities keeps the registered transport.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@nozokada

Copy link
Copy Markdown
Member Author

@cdhoffmann I went ahead with the setter from my earlier comment so you can see it in code: show, present and wrap no longer take voiceTransport, and the app calls Concierge.setVoiceTransport(_:) once (section 7 of the description). A running conversation keeps its transport, and nil hides the voice button once it ends. #191 registers the demo's transport at launch, and Android adobe/aepsdk-concierge-android#205 has the same change. Ryan hasn't weighed in yet, so this can still change if he prefers something else.

nozokada and others added 2 commits November 23, 2026 14:12
Say a transport is registered rather than provided in the composer
comments, and note in the getting-started guide that taps are ignored
while connecting and that setVoiceTransport can be called from any
thread.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Resetting identities ends a running voice conversation and keeps the
transport registered with Concierge.setVoiceTransport.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
nozokada and others added 2 commits November 24, 2026 13:53
The voice bootstrap now takes the app's auth token, as a chat turn does.
Resolve it after the microphone check and before the bootstrap request.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@nozokada
nozokada merged commit afb667e into adobe:feature/voice Nov 24, 2026
12 checks passed
@nozokada
nozokada deleted the feat/voice-transport branch November 24, 2026 23:28
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.

2 participants