Stop sending cache_control to the Codex/ChatGPT endpoint - #121
Merged
Conversation
The ChatGPT backend-api Codex endpoint (chatgpt.com/backend-api) rejects an input[].content[].cache_control field outright: HTTP 400 "Unknown parameter: 'input[0].content[0].cache_control'." on literally the first message, unlike the Anthropic and OpenAI-compatible transports, which cache correctly with the same kind of field. codex.rs is the only consumer of the Codex responses API shape and talks exclusively to this endpoint, so there is no capability split to gate on here — prompt caching for this profile isn't supported, not merely disabled. Remove the apply_codex_prompt_cache call from codex.rs::complete, and delete the now-dead apply_codex_prompt_cache/ attach_codex_cache_to_input_item from prompt_cache.rs (no other caller). Adds a regression test asserting the codex request body never contains cache_control. Live-verified against the real release binary on OpenAI Codex/ChatGPT sign-in with gpt-5.4: the exact repro from the 2026-08-01 usability audit now succeeds end-to-end for the first time in either audit pass -- real tool call, real diff, file change confirmed on disk via git diff.
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
chatgpt.com/backend-api) rejects aninput[].content[].cache_controlfield outright withHTTP 400 "Unknown parameter: 'input[0].content[0].cache_control'."— blocking the entireopenai_codex(ChatGPT subscription) provider profile on literally the first message, with no successful chat completion observed in either prior audit pass.codex.rsis the only caller ofapply_codex_prompt_cacheand talks exclusively to this one endpoint, so there's no capability split to gate on — this transport doesn't support prompt-cache breakpoints at all, unlike the Anthropic and OpenAI-compatible transports (both left untouched and still cache correctly).apply_codex_prompt_cachecall fromcodex.rs::complete, and deleted the now-deadapply_codex_prompt_cache/attach_codex_cache_to_input_itemfromprompt_cache.rsrather than leaving unreferenced code behind.Test plan
cargo test --package forge-model— 49/49, including a new regression testcodex_request_body_never_contains_cache_control.cargo fmt --all -- --check,cargo clippy --workspace --all-targets --locked -- -D warnings,cargo test --workspace --all-targets --locked— all clean.gpt-5.4: for the first time across either audit pass, the request succeeded completely end-to-end — real tool call ("Explored repository"), a real diff shown in the TUI, header✓ Completed, andgit diffon disk confirms the actual file change (Hello, {name}!→Hi there, {name}!).