Repository navigation
fix(codex): use session-id header for cache affinity - #156
Merged
Merged
Conversation
Keep the WebSocket continuation integration checks aligned with the current Codex wire header and verify that the obsolete underscore spelling is absent. Describe the header as protocol conformance rather than asserting an unverified backend cache implementation detail.
Owner
|
Thanks for catching this and for the careful upstream investigation. I updated the continuation integration coverage for Merged, thanks! |
9 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
session-idinstead ofsession_idprompt_cache_key,x-client-request-id, andx-codex-window-idbehavior unchangedWhy
build_codex_headerscurrently emitssession_id. The official OpenAI Codex client emitssession-id, and the current Codex source notes that ChatGPT derives Responses cache affinity from that header.The proxy already supplies a stable
prompt_cache_keyfrom the Claude Code session ID. This patch therefore fixes the missing cache-routing signal without changing request-body semantics, continuation state, or session ownership.Related upstream investigation:
openai/codex#44716reports thatsession-idcan affect reported cache reuse independently ofprompt_cache_keyon the ChatGPT-authenticated Codex backend. The backend mechanism is still under discussion there, so this PR intentionally stays limited to matching the official Codex wire format.Scope
This does not add
thread-id,prompt_cache_options, or cache breakpoints. It also does not change the existing per-agent continuation ownership logic. Those are separate behavior changes and should be evaluated independently.Testing
cargo fmt --checkcargo test codex_headers_