Repository navigation
Conversation
|
This is a critical fix, please prioritise it |
|
go merge it |
Qurtison
pushed a commit
to Qurtison/9router
that referenced
this pull request
Sep 8, 2026
…with model discovery
|
Woud love this. Does this target gpt-image-2.5 too??? |
Contributor
Author
|
This PR only fixes the Codex client version headers, it doesn’t explicitly select GPT-Image-2.5. Image generation works in my tests, but the responses don’t identify the image model, so I’m not able to confirm 2.5 support yet. |
|
@Jordannst #3943 supports it now |
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
Align the existing Codex image adapter's advertised client version with model
discovery. This fixes the reproducible GPT-5.6 image request version rejection
without changing the requested model, image tool payload, or authentication.
Related to #3846 and the
requires a newer version of Codexerror in #3829.This does not claim to fix the separate
gpt-image-2account/model rejection.Root cause
On master (
eb712ca8, v0.5.69), model discovery already requests the Codex catalogwith
client_version=0.144.6. Image requests independently hardcode bothversion: 0.136.0anduser-agent: codex_cli_rs/0.136.0.The official Codex manifest specifies
minimal_client_version: 0.144.0forgpt-5.6-sol,gpt-5.6-terra, andgpt-5.6-luna:pinned upstream manifest.
Thus discovery advertises newer models, but generation identifies itself as an
older client. Updating a user's locally installed Codex CLI cannot change those
hardcoded 9router request headers.
Changes
0.144.6toopen-sse/config/codexConstants.js.retain checks for bearer/account authentication, suffix removal, image tool
payload, and SSE image extraction.
The version is the one master already uses for discovery, not an arbitrary
latest-version bump. A future update of the shared constant updates both paths.
Live A/B verification
Tested on 2026-09-07 using two authenticated Codex accounts and six requests.
Within each pair, the account, model, prompt, body, and all other headers were
identical. Only
versionanduser-agentchanged. The baseline used the currentadapter with its headers overridden to master's values; the patched arm used
the new values. Credentials remained in process memory and are not included in artifacts.
Prompt:
Generate a solid green square.Output format: PNG.The image adapter's SSE parser extracted each image, then
sharpfully decoded it to raw pixels. Success was not inferred from HTTP 200 alone.
These probes exercised request construction and parsing directly, not the
dashboard, account failover, or the complete public HTTP route.
Separate
gpt-image-2checkWith the patched
0.144.6headers,gpt-image-2returned HTTP 400 on both tested Codex accounts: "not supported when using Codex with a ChatGPT account". A control request usinggpt-5.6-luna-imageon the same account returned HTTP 200 with a fully decoded 1254x1254 PNG. This confirms a separate upstream rejection for the tested model/endpoint/account combination, not the client-version error fixed here; nogpt-image-2remapping or support is claimed.Automated verification
the outbound
0.136.0headers.git diff --check: passed.Scope and related work
0.136.0image identity.model mapping, or image payload options.
was not explained by this investigation and is not claimed as fixed here.
gpt-image-2as a Codex Responses model.