Skip to content

fix(core): compare Codex GPT versions by major and minor - #47404

Merged
rekram1-node merged 1 commit into
v2from
codex-gpt-versions
Sep 5, 2026
Merged

fix(core): compare Codex GPT versions by major and minor#47404
rekram1-node merged 1 commit into
v2from
codex-gpt-versions

Conversation

@rekram1-node

Copy link
Copy Markdown
Collaborator

Ports the Codex OAuth model filter fixes from dev (#47384, #47385).

The filter matched /^gpt-(\d+\.\d+)/ and parseFloat-ed the prefix, so:

  • integer version ids like gpt-6-astra / gpt-6 were not admitted at all
  • parseFloat also misranked future versions (gpt-5.10 → 5.1 < 5.4)

Now the match captures the major and minor separately and compares them numerically:

const match = apiID.match(/^gpt-(\d+)(?:\.(\d+))?/)
const major = Number(match?.[1])
const minor = Number(match?.[2] ?? 0)
// admitted when major > 5 || (major === 5 && minor > 4)

The explicit allowlist/disallowlist entries (codexAllowed, codexDisallowed, including gpt-5.5-pro and gpt-5.6) still take precedence, so older-model blacklisting behavior is unchanged.

Extends provider-openai.test.ts with gpt-6-astra, gpt-5.10, gpt-5, gpt-5.04-astra, and gpt-4.99 cases mirroring the dev test suite.

Ports the Codex OAuth model filter fixes from dev (#47384, #47385):
integer GPT versions like gpt-6-astra were rejected by the strict
decimal-version regex. Compare major and minor numerically instead of
parseFloat-ing a decimal-only prefix, so gpt-5.10 outranks gpt-5.9 and
integer versions without a minor are allowed.
@rekram1-node
rekram1-node merged commit baab057 into v2 Sep 5, 2026
10 checks passed
@rekram1-node
rekram1-node deleted the codex-gpt-versions branch September 5, 2026 00:22
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