Skip to content

fix(model): restore Codex cache affinity - #489

Merged
mohitranka merged 1 commit into
mainfrom
fix/codex-cache-affinity
Sep 3, 2026
Merged

mohitranka merged 1 commit into
mainfrom
fix/codex-cache-affinity

Conversation

@mohitranka

Copy link
Copy Markdown
Contributor

Summary

  • send a stable workspace-scoped prompt_cache_key on Codex Responses requests
  • keep unsupported inline cache_control markers out of ChatGPT backend requests
  • cover both cache-enabled and cache-disabled request construction

Root cause

The Codex transport correctly stopped sending inline cache_control after the ChatGPT backend rejected it, but incorrectly treated that as prompt caching being unsupported. Unlike the OpenAI-compatible path, it never sent the top-level cache-affinity key, allowing byte-identical prompt prefixes to land on different cache shards and reducing observed cache hits.

Validation

  • cargo test --package forge-model --locked
  • cargo fmt --all -- --check

@mohitranka
mohitranka merged commit e5f8b3b into main Sep 3, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant