Skip to content

feat(codex): send version header so backend serves newer models (gpt-5.6-luna)#41

Open
skulidropek wants to merge 5 commits into
link-assistant:mainfrom
skulidropek:codex-version-header
Open

feat(codex): send version header so backend serves newer models (gpt-5.6-luna)#41
skulidropek wants to merge 5 commits into
link-assistant:mainfrom
skulidropek:codex-version-header

Conversation

@skulidropek

Copy link
Copy Markdown
Contributor

Problem

For Codex (ChatGPT) subscriptions the router forwards POST /v1/responses to
https://chatgpt.com/backend-api/codex/responses, preserving the caller's model verbatim.
The ChatGPT Codex backend gates newer models behind a recent client version, advertised via
a version HTTP header (the Codex CLI sends version: <cli-version>). The router sets
chatgpt-account-id, openai-beta and originator, but not version.

As a result, newer models are rejected even though the account has access:

# model gpt-5.6-luna, identical body/token
without version header ->  404 {"error":{"message":"Model not found gpt-5.6-luna",...}}
with    version: 0.144.1 -> 200 event: response.created ...

Verified end-to-end: the same ChatGPT account that returns Model not found through the router
serves the model fine via the Codex CLI (which sends the version header), and adding the header
to the router's request makes gpt-5.6-luna work while gpt-5.4 / gpt-5.5 keep working.

Change

Send a version header on Codex requests, defaulting to 0.144.1 and overridable via
CODEX_CLIENT_VERSION, mirroring the Codex CLI. Adds a unit test (codex_headers_include_version)
and a changelog fragment.

Notes

The router remains a transparent proxy — this only advertises a client version so the backend
exposes the models the account is entitled to. Model availability is still governed by the account.

skulidropek and others added 5 commits July 12, 2026 07:44
The ChatGPT Codex backend gates newer models (e.g. gpt-5.6-luna) behind a recent
client version advertised via the `version` HTTP header. Without it POST /responses
returns 404 `Model not found`; with `version: 0.144.1` it returns 200. Mirror the
Codex CLI so newer models are usable through the router; overridable via
CODEX_CLIENT_VERSION. Adds a unit test and changelog fragment.
…c_markdown

The Lint and Format Check job runs `cargo clippy --all-targets --all-features`
with `-D warnings`, which fails on two doc comments in subscription_proxy.rs that
referenced `ChatGPT` and `OpenClaw` without backticks (clippy::doc_markdown).
Wrap them in backticks to match the rest of the file. No functional change.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
The Build Package job runs `cargo build --release` then `cargo package --list`.
Cargo.toml was bumped to 0.20.0 but Cargo.lock's own package entry still recorded
0.19.0, so every build rewrote Cargo.lock, leaving the working tree dirty and
`cargo package --list` aborting ("files ... not yet committed into git: Cargo.lock").
Sync the lockfile's self-version so the tree stays clean. No dependency changes.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
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