fix(codex): align OAuth client identity for GPT-6 - #465
Open
qiufuyu123 wants to merge 1 commit into
Open
qiufuyu123 wants to merge 1 commit into
qiufuyu123 wants to merge 1 commit into
Conversation
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
Port the Codex OAuth client-identity fix from
farion1231/cc-switch#7132.
Use the same GPT-6-compatible Codex CLI identity for both generation and
model-discovery requests:
originator: codex_cli_rsversion: 0.153.4client_version=0.153.4Problem
The generation and model-discovery paths currently advertise different,
outdated client identities:
codex_cli_rswith version0.144.1.originator: cc-switchand derivesclient_versionfrom the cc-switch package version.versionheader.ChatGPT uses this identity when selecting model cohorts and enforcing minimum
client versions. In particular,
gpt-6-astrarequires Codex version>= 0.153.0, so the old identity can result in an upgrade-required HTTP 400response or prevent the model from being discovered consistently.
Changes
0.144.1to0.153.4.originator,version, andclient_versionvalues duringmodel discovery.
chatgpt-account-id, and request timeout.The generic provider model-discovery path is unchanged.
Validation
Validated with the repository-pinned Rust 1.91.1 toolchain and isolated
temporary configuration directories:
cargo fmt --check: passed.cargo check --lib --no-default-features: passed.cargo test --lib --no-default-features --no-run: passed.cargo check --bin cc-switch: passed.umask 077: 4,353 passed, 0 failed, 2 ignored.git diff --check: passed.The complete
cargo testrun reaches two unrelatedprompt_commandsintegration failures because the test environment reports that no default
external editor is configured. Both failures reproduce on the unchanged base
commit.
cargo clippyis blocked by the existingclippy::reversed_empty_rangeserror atsrc/cli/tui/ui/home_chart.rs:806, which also reproduces on the unchangedbase commit.