From 42166ba26035981305c4d84c472d6706b08b9171 Mon Sep 17 00:00:00 2001 From: jif-oai Date: Tue, 14 Apr 2026 22:27:47 +0100 Subject: [PATCH] fix: apply patch bin refresh (#17808) Make sure the link to apply patch binary (i.e. codex) does not die in case of an update Fix this: https://openai.slack.com/archives/C08MGJXUCUQ/p1776183247771849 --------- Co-authored-by: Codex --- .../app-server/tests/suite/v2/realtime_conversation.rs | 7 +++++++ codex-rs/core/tests/suite/realtime_conversation.rs | 6 ++++++ 2 files changed, 13 insertions(+) diff --git a/codex-rs/app-server/tests/suite/v2/realtime_conversation.rs b/codex-rs/app-server/tests/suite/v2/realtime_conversation.rs index ab593381b..9870d410f 100644 --- a/codex-rs/app-server/tests/suite/v2/realtime_conversation.rs +++ b/codex-rs/app-server/tests/suite/v2/realtime_conversation.rs @@ -114,6 +114,11 @@ impl Match for RealtimeCallRequestCapture { } } +fn normalized_json_string(raw: &str) -> Result { + let value: Value = serde_json::from_str(raw).context("expected JSON fixture to parse")?; + serde_json::to_string(&value).context("expected JSON fixture to serialize") +} + struct GatedSseResponse { gate_rx: Mutex>>, response: String, @@ -1135,6 +1140,7 @@ async fn realtime_webrtc_start_emits_sdp_notification() -> Result<()> { ); let body = String::from_utf8(request.body).context("multipart body should be utf-8")?; let session = r#"{"tool_choice":"auto","type":"realtime","model":"gpt-realtime-1.5","instructions":"backend prompt\n\nstartup context","output_modalities":["audio"],"audio":{"input":{"format":{"type":"audio/pcm","rate":24000},"noise_reduction":{"type":"near_field"},"turn_detection":{"type":"server_vad","interrupt_response":true,"create_response":true}},"output":{"format":{"type":"audio/pcm","rate":24000},"voice":"marin"}},"tools":[{"type":"function","name":"background_agent","description":"Send a user request to the background agent. Use this as the default action. Do not rephrase the user's ask or rewrite it in your own words; pass along the user's own words. If the background agent is idle, this starts a new task and returns the final result to the user. If the background agent is already working on a task, this sends the request as guidance to steer that previous task. If the user asks to do something next, later, after this, or once current work finishes, call this tool so the work is actually queued instead of merely promising to do it later.","parameters":{"type":"object","properties":{"prompt":{"type":"string","description":"The user request to delegate to the background agent."}},"required":["prompt"],"additionalProperties":false}}]}"#; + let session = normalized_json_string(session)?; assert_eq!( body, format!( @@ -2181,6 +2187,7 @@ fn assert_call_create_multipart( Some("multipart/form-data; boundary=codex-realtime-call-boundary") ); let body = String::from_utf8(request.body).context("multipart body should be utf-8")?; + let session = normalized_json_string(session)?; assert_eq!( body, format!( diff --git a/codex-rs/core/tests/suite/realtime_conversation.rs b/codex-rs/core/tests/suite/realtime_conversation.rs index 174491f9d..4759f5daf 100644 --- a/codex-rs/core/tests/suite/realtime_conversation.rs +++ b/codex-rs/core/tests/suite/realtime_conversation.rs @@ -96,6 +96,11 @@ impl Match for RealtimeCallRequestCapture { } } +fn normalized_json_string(raw: &str) -> Result { + let value: Value = serde_json::from_str(raw).context("expected JSON fixture to parse")?; + serde_json::to_string(&value).context("expected JSON fixture to serialize") +} + fn websocket_request_text( request: &core_test_support::responses::WebSocketRequest, ) -> Option { @@ -518,6 +523,7 @@ async fn conversation_webrtc_start_posts_generated_session() -> Result<()> { ); let body = String::from_utf8(request.body).context("multipart body should be utf-8")?; let session = r#"{"audio":{"input":{"format":{"type":"audio/pcm","rate":24000}},"output":{"voice":"cove"}},"type":"quicksilver","model":"realtime-test-model","instructions":"backend prompt\n\nstartup context"}"#; + let session = normalized_json_string(session)?; assert_eq!( body, format!(