fix: drop underscored id headers (#22193)

## Why
Stop sending duplicate `session_id`/`thread_id` headers. We only want
the hyphenated forms as `_` is rejected by some proxies

Related discussion here:
https://openai.slack.com/archives/C095U48JNL9/p1778508316923179

## What
- Keep `session-id` and `thread-id`
- Remove the underscore aliases
This commit is contained in:
jif-oai
2026-05-13 18:21:02 +02:00
committed by GitHub
Unverified
parent fdda59c00b
commit 7c7b4861d8
5 changed files with 10 additions and 34 deletions
@@ -5,11 +5,9 @@ use http::HeaderValue;
pub fn build_session_headers(session_id: Option<String>, thread_id: Option<String>) -> HeaderMap {
let mut headers = HeaderMap::new();
if let Some(id) = session_id {
insert_header(&mut headers, "session_id", &id);
insert_header(&mut headers, "session-id", &id);
}
if let Some(id) = thread_id {
insert_header(&mut headers, "thread_id", &id);
insert_header(&mut headers, "thread-id", &id);
}
headers