Update realtime websocket API (#13265)

- migrate the realtime websocket transport to the new session and
handoff flow
- make the realtime model configurable in config.toml and use API-key
auth for the websocket

---------

Co-authored-by: Codex <noreply@openai.com>
This commit is contained in:
Ahmed Ibrahim
2026-03-02 16:05:40 -08:00
committed by GitHub
parent d473e8d56d
commit b20b6aa46f
21 changed files with 1449 additions and 507 deletions

View File

@@ -390,10 +390,15 @@ impl WebSocketRequest {
#[derive(Debug, Clone)]
pub struct WebSocketHandshake {
uri: String,
headers: Vec<(String, String)>,
}
impl WebSocketHandshake {
pub fn uri(&self) -> &str {
&self.uri
}
pub fn header(&self, name: &str) -> Option<String> {
self.headers
.iter()
@@ -1223,10 +1228,10 @@ pub async fn start_websocket_server_with_headers(
.map(|value| (name.as_str().to_string(), value.to_string()))
})
.collect();
handshake_log
.lock()
.unwrap()
.push(WebSocketHandshake { headers });
handshake_log.lock().unwrap().push(WebSocketHandshake {
uri: req.uri().to_string(),
headers,
});
let headers_mut = response.headers_mut();
for (name, value) in &response_headers {