Skip to content

api: send hyphenated session and thread headers#21757

Merged
jif-oai merged 2 commits into
mainfrom
jif/dash-headers
May 8, 2026
Merged

api: send hyphenated session and thread headers#21757
jif-oai merged 2 commits into
mainfrom
jif/dash-headers

Conversation

@jif-oai
Copy link
Copy Markdown
Collaborator

@jif-oai jif-oai commented May 8, 2026

Why

Some consumers expect conventional hyphenated HTTP headers. Codex already sends the session and thread IDs on outbound Responses requests, but it only uses the underscore spellings today, which makes those IDs harder to consume in systems that normalize or reject underscore header names.

Full context here: https://openai.slack.com/archives/C08KCGLSPSQ/p1778248578422369

What changed

  • build_session_headers now emits both session_id and session-id when a session ID is present.
  • It does the same for thread_id and thread-id.
  • Added regression coverage in codex-api/tests/clients.rs and core/tests/suite/client.rs so both the lower-level client tests and the end-to-end request tests assert the two header spellings are present.

Test plan

  • Added header assertions in codex-api/tests/clients.rs.
  • Added request-header assertions in core/tests/suite/client.rs for both the /v1/responses and /api/codex/responses request paths.

@jif-oai jif-oai marked this pull request as ready for review May 8, 2026 14:50
@jif-oai jif-oai requested a review from a team as a code owner May 8, 2026 14:50
@jif-oai jif-oai changed the title feat: dash headers api: send hyphenated session and thread headers May 8, 2026
@jif-oai jif-oai merged commit bd8fc9a into main May 8, 2026
26 checks passed
@jif-oai jif-oai deleted the jif/dash-headers branch May 8, 2026 15:11
@github-actions github-actions Bot locked and limited conversation to collaborators May 8, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants