mirror of
https://github.com/openai/codex.git
synced 2026-10-29 19:08:43 +00:00
## 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
53 lines
1.9 KiB
Rust
53 lines
1.9 KiB
Rust
//! Start diagnostics retain routing-independent metadata without exposing input content.
|
|
|
|
use super::*;
|
|
use pretty_assertions::assert_eq;
|
|
|
|
#[test]
|
|
fn realtime_start_debug_redacts_text_and_transport() {
|
|
let secret = "credential-bearing-content";
|
|
let mut params = ConversationStartParams {
|
|
client_managed_handoffs: false,
|
|
delegation_ack_filler: None,
|
|
flush_transcript_tail_on_session_end: false,
|
|
codex_responses_as_items: false,
|
|
codex_response_item_prefix: Some(secret.to_owned()),
|
|
codex_response_handoff_mode: Default::default(),
|
|
backend_reasoning_status: false,
|
|
codex_response_handoff_channel_prefixes: Some(BTreeMap::from([(
|
|
secret.to_owned(),
|
|
vec![secret.to_owned()],
|
|
)])),
|
|
model: Some(secret.to_owned()),
|
|
output_modality: RealtimeOutputModality::Audio,
|
|
include_startup_context: true,
|
|
initial_items: vec![ConversationTextParams {
|
|
role: ConversationTextRole::Developer,
|
|
text: secret.to_owned(),
|
|
}],
|
|
realtime_start_instructions: Some(secret.to_owned()),
|
|
realtime_end_instructions: Some(secret.to_owned()),
|
|
prompt: Some(Some(secret.to_owned())),
|
|
realtime_session_id: Some(secret.to_owned()),
|
|
voice_session_id: Some(secret.to_owned()),
|
|
transport: None,
|
|
version: Some(RealtimeConversationVersion::V3),
|
|
voice: None,
|
|
};
|
|
for transport in [
|
|
ConversationStartTransport::ExistingCall {
|
|
call_id: secret.to_owned(),
|
|
sideband_base_url: Some(format!("wss://example.test/?token={secret}")),
|
|
},
|
|
ConversationStartTransport::Webrtc {
|
|
sdp: secret.to_owned(),
|
|
},
|
|
] {
|
|
params.transport = Some(transport);
|
|
assert_eq!(
|
|
format!("{params:?}"),
|
|
"ConversationStartParams { output_modality: Audio, initial_items_count: 1, version: Some(V3), .. }"
|
|
);
|
|
}
|
|
}
|