Responses: set x-client-request-id as convesration_id when talking to responses (#14312)

Right now we're sending the header session_id to responses which is
ignored/dropped. This sets a useful x-client-request-id to the
conversation_id.
This commit is contained in:
Channing Conger
2026-03-10 23:46:05 -07:00
committed by Michael Bolin
parent f385199cc0
commit fd4a673525
3 changed files with 15 additions and 3 deletions

View File

@@ -49,10 +49,12 @@ use tracing_test::traced_test;
const MODEL: &str = "gpt-5.2-codex";
const OPENAI_BETA_HEADER: &str = "OpenAI-Beta";
const WS_V2_BETA_HEADER_VALUE: &str = "responses_websockets=2026-02-06";
const X_CLIENT_REQUEST_ID_HEADER: &str = "x-client-request-id";
struct WebsocketTestHarness {
_codex_home: TempDir,
client: ModelClient,
conversation_id: ThreadId,
model_info: ModelInfo,
effort: Option<ReasoningEffortConfig>,
summary: ReasoningSummary,
@@ -88,6 +90,10 @@ async fn responses_websocket_streams_request() {
handshake.header(OPENAI_BETA_HEADER),
Some(WS_V2_BETA_HEADER_VALUE.to_string())
);
assert_eq!(
handshake.header(X_CLIENT_REQUEST_ID_HEADER),
Some(harness.conversation_id.to_string())
);
server.shutdown().await;
}
@@ -1606,6 +1612,7 @@ async fn websocket_harness_with_options(
WebsocketTestHarness {
_codex_home: codex_home,
client,
conversation_id,
model_info,
effort,
summary,