Repository navigation
feat: add voice session bootstrap request - #197
Merged
Merged
Conversation
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
1 of 3 tasks
Adds bootstrapVoiceSession, which posts a livekit-bootstrap conversation event to the region-less voice endpoint and emits the first livekit_session credentials from the response stream. Chat turns and the bootstrap share the streaming request path and the request envelope. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
nozokada
force-pushed
the
feat/voice-bootstrap
branch
from
October 27, 2026 22:31
1579e3f to
3b82efe
Compare
This was referenced Oct 27, 2026
Voice used /brand-concierge-voice/conversations without the region, so EU
customers' bootstraps did not reach their region. The service now serves the
bootstrap from the regular /brand-concierge/{region}/conversations route when
the request carries xdm.eventType "conversation.voice" together with
conversation.data.type "livekit-bootstrap".
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
nozokada
marked this pull request as ready for review
November 10, 2026 03:30
rymorale
reviewed
Nov 16, 2026
Android's org.json quotes the whole input in its syntax errors, so logging the exception message for a malformed bootstrap frame could write the LiveKit token to the log. The parser now logs a fixed message. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The service keeps the bootstrap's xdm for the whole voice session and replays it on every voice turn. bootstrapVoiceSession now takes the held context snapshot next to the session ID it was resolved for and merges it into xdm like a chat turn (identityMap stays reserved and the SDK's eventType wins). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…th token
The voice bootstrap now marks the request with
query.conversation.voice = {"action": "start"} instead of
data = {"type": "livekit-bootstrap"} plus xdm.eventType = "conversation.voice".
The data slot now carries the auth token, as in a chat turn, and the SDK
no longer sets xdm.eventType.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
rymorale
approved these changes
Nov 24, 2026
rymorale
left a comment
Contributor
There was a problem hiding this comment.
there is one remaining area which still prints the token. other than that the PR looks good to me. feel free to merge after resolving.
SSEParser logged every raw line and every event's data at debug level, so a successful voice bootstrap wrote the LiveKit URL and token to the log. The bootstrap now turns payload logging off for its stream; the lines and events are still logged without their content. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.
Important
Waiting on a service change. The bootstrap now uses the request shape from a Concierge Conversation Service change that isn't merged yet:
query.conversation.voice = {"action": "start"}. Stage still accepts only the old shape, so don't merge this intofeature/voiceuntil that change is on Stage. Until then, #205 and #206 stay on the previous head of this branch, and they still show the old shape.Description
Adds the client side of the voice session bootstrap handshake, matching the iOS SDK. It has no voice transport and no UI; those come in a follow-up PR.
ConversationService.bootstrapVoiceSession(xdmFields, sessionId)returns a coldFlow<VoiceSessionBootstrap>. It posts a conversation event to the regional conversations route,/brand-concierge/{region}/conversations, the same route chat uses.conversation.voice = {"action": "start"}replacesmessageand marks the request as a voice bootstrap. The service rejectsvoicetogether withmessage.livekit_sessioncredentials (livekitUrl,token) at most once, as a transport-neutralVoiceSessionBootstrap(url, token), then completes when the stream closes.VOICE_NOT_SUPPORTED_DURING_HANDOFF). A region where voice isn't enabled answers with HTTP 400, which surfaces as an HTTP error.Concierge.setAuthTokenProvidergoes inconversation.data({"type": "auth", "payload": {"token": …}}), resolved the same way as for a chat turn, and is left out when there's none. The service accepts the token but doesn't pass it to the agent during voice yet.updateXDMContext) passed inxdmFields, merged intoxdmas in a chat turn.identityMapis reserved, as in chat. The SDK doesn't setxdm.eventType, so aneventTypein the held context passes through as in a chat turn. The service drops it from thexdmit stores. The service keeps thisxdmfor the voice session and sends it with every voice turn. The request uses the passedsessionId, so the caller resolves the context for the same session.ConversationResponseParser.parseVoiceBootstrapreadsresponse.voiceand type-checks it. Text-turn parsing is unchanged.streamConversationEvents) and one envelope builder. Chat behavior, including cancellation, generation checks, and checking surfaces before resolving the auth token, is preserved. The bootstrap also checks surfaces before resolving the token.Everything is
internal. The public API is unchanged.How Has This Been Tested?
ConciergeConversationServiceClientVoiceBootstrapTest(17) covers:/brand-concierge/va6/conversations), method and headers, explicit session id, and request body. That includes thevoicestart marker (and its absence from chat bodies), the auth token as thedatapart and not in a header, noxdm.eventType, and the held XDM context next to the identityMap, with itseventTypepassed through;ConversationResponseParserVoiceTest(7) covers voice payload parsing, checks that text-turn parsing is unaffected, and checks that a malformed frame's token isn't logged.spotlessCheckpass.livekit_sessioncredentials, keeps the held context in the session'sxdmwithouteventType, and doesn't store the token. It rejects the same body withmessageadded and withdata: {"type": "livekit-bootstrap"}.va7) used the old shape.Types of changes