fix(codex): bound cache keys at provider boundaries - #66330
Merged
Conversation
teknium1
force-pushed
the
fix/codex-cache-key-boundaries
branch
from
July 17, 2026 13:53
6bc5ba8 to
3603ee0
Compare
Collaborator
tonydwb
reviewed
Jul 17, 2026
tonydwb
left a comment
There was a problem hiding this comment.
Code Review Summary
Verdict: Approved
Clean, well-scoped change with good test coverage. No security concerns.
Reviewed by Hermes Agent
Exercise the real transport path for long session ids, including stable hashing and bounded body/header cache keys.
Fold #62349's broader provider-boundary handling into the header fix: bound top-level and xAI override keys again at preflight after middleware, preserve unrelated headers, and cover boundaries and collisions. Co-authored-by: Nick Taylor <nicktaylor@TheWorldofNick-Lappy.local>
teknium1
force-pushed
the
fix/codex-cache-key-boundaries
branch
from
July 17, 2026 20:22
3603ee0 to
b2d6d92
Compare
This was referenced Jul 17, 2026
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
Provider-facing Codex/Responses cache-routing keys are now bounded at every mutable boundary, including after request middleware.
Changes
session_id/x-client-request-idcache-scope headers while preserving short IDs and unrelated caller headers.extra_body.prompt_cache_keyoverrides.preflight_kwargs()so execution middleware cannot reintroduce an oversized key immediately before the provider call.This preserves @webtecnica's #66272 commit authorship, folds in the broader provider-boundary design from #62349 by @thegoodguysla, credits @Armib20's earliest #24273 submission, and follows @gracejudy's live diagnosis that isolated the production failure to the cache-scope headers.
Validation
tests/agent/transports/test_codex_transport.pytests/run_agent/test_run_agent_codex_responses.pygit diff --checkpassedFixes #66045.
Infographic