fix(codex): floor upstream client version to unblock gated models (gpt-5.6-sol) - #884
Open
xky-at-pku wants to merge 1 commit into
Open
fix(codex): floor upstream client version to unblock gated models (gpt-5.6-sol)#884xky-at-pku wants to merge 1 commit into
xky-at-pku wants to merge 1 commit into
Conversation
ChatGPT's Codex backend rejects requests for newer models (e.g. gpt-5.6-sol) when the client advertises an old Codex version, returning: The 'gpt-5.6-sol' model requires a newer version of Codex. The relay was hitting this for two reasons: 1. The built-in identity defaults were stale (codex-tui/0.118.0, codex_cli_rs/0.76.0) and no Version header was sent by default. 2. The identity-fingerprint learning layer replays a previously observed client version (e.g. codex_exec/0.130.0) as the outbound identity. Once a stale version is learned, it overrides the defaults and keeps tripping the upstream version gate even after the defaults are bumped. Changes: - Bump the built-in codex-tui / codex_cli_rs identity to 0.147.0. - Send a current Codex "Version" header (0.147.0) when the inbound client did not provide one, instead of leaving it empty. - Add a minimum-version floor (0.147.0) in the codex identity-fingerprint resolution so any learned or configured version older than the floor is raised, and the User-Agent product/parenthesized version tokens are rewritten to stay consistent. OS/terminal numbers in the UA are preserved. Versions at or above the floor pass through untouched. Verified against a live deployment: gpt-5.6-sol now succeeds through the relay with both claude-cli and (stale) codex_exec client identities, and gpt-5.5 still works. Co-Authored-By: Claude <noreply@anthropic.com>
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.
问题
ChatGPT 的 Codex 后端对较新模型(如
gpt-5.6-sol)做了客户端版本门槛。当 relay 以旧版本 Codex 客户端身份请求时,上游返回 400:根因(两层)
codex-tui/0.118.0、codex_cli_rs/0.76.0,且默认不发送Version头。codex_exec/0.130.0)记录为出站身份。一旦学进旧版本,它会在后续的 fingerprint 选择中覆盖默认值,即使升级了常量也依然复现该报错。修复内容
codex-tui/codex_cli_rs身份升级到 0.147.0。Version头时,默认发送当前 Codex 版本(0.147.0),不再留空。(product; ver)版本会被一致改写(保留 OS / 终端等其余数字)。不低于下限的版本原样透传。改动文件
internal/config/identity_fingerprint.go— 默认 UA / Version 升级internal/runtime/executor/codex_auth.go— 默认 UA 升级 + Version 头默认值internal/runtime/executor/codex_websockets_helpers.go— websocket 路径 Version 默认值internal/management/aiaccountstatus/probe_codex.go— 探测 UA 升级internal/identityfingerprint/resolve.go— 新增版本下限钳制 + UA 版本改写internal/identityfingerprint/resolve_floor_test.go— 新增钳制单元测试验证
在真实部署环境验证通过:
gpt-5.6-solcodex_exec/0.130.0身份 +gpt-5.6-solgpt-5.5回归go test ./...通过(仅容器缺bash导致的部署脚本测试失败,与本改动无关)。🤖 Generated with Claude Code