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
Unverified
parent f385199cc0
commit fd4a673525
3 changed files with 15 additions and 3 deletions
+5 -3
View File
@@ -487,14 +487,16 @@ impl ModelClient {
turn_metadata_header: Option<&str>,
) -> ApiHeaderMap {
let turn_metadata_header = parse_turn_metadata_header(turn_metadata_header);
let conversation_id = self.state.conversation_id.to_string();
let mut headers = build_responses_headers(
self.state.beta_features_header.as_deref(),
turn_state,
turn_metadata_header.as_ref(),
);
headers.extend(build_conversation_headers(Some(
self.state.conversation_id.to_string(),
)));
if let Ok(header_value) = HeaderValue::from_str(&conversation_id) {
headers.insert("x-client-request-id", header_value);
}
headers.extend(build_conversation_headers(Some(conversation_id)));
headers.insert(
OPENAI_BETA_HEADER,
HeaderValue::from_static(RESPONSES_WEBSOCKETS_V2_BETA_HEADER_VALUE),