Forward client voice session IDs in realtime requests (#53784)

## What changed

Add optional `voiceSessionId` to realtime start parameters and forward it as the `voice-session-id` header for WebSocket, WebRTC, and existing-call transports. Keep this client-generated voice session identifier distinct from `realtimeSessionId`, which uses `x-session-id`.

## Testing

Extend serialization tests and add coverage for distinct session ID headers, WebRTC request forwarding, and existing-call handshake forwarding.

GitOrigin-RevId: cb558dbb9d438f2d34e281199a7e81fe5d33b879
This commit is contained in:
Chris Dong
2026-10-13 22:21:31 +00:00
committed by copyberry
parent b56a579fc6
commit 6786dccbe7
19 changed files with 139 additions and 0 deletions
@@ -257,6 +257,10 @@ pub struct ThreadRealtimeStartParams {
pub prompt: Option<Option<String>>,
#[ts(optional = nullable)]
pub realtime_session_id: Option<String>,
/// Client-generated identifier for the product voice session. This is distinct from
/// `realtimeSessionId`.
#[ts(optional = nullable)]
pub voice_session_id: Option<String>,
#[ts(optional = nullable)]
pub transport: Option<ThreadRealtimeStartTransport>,
/// Overrides the configured realtime protocol version for this session only.