Repository navigation
Commit c59a5a2
fix: correct the ChatGPT-subscription model allowlist against the live backend (#1179)
* fix: correct the ChatGPT-subscription model allowlist against the live backend
The OAuth model filter was built from the models.dev catalog rather than from
what the Codex endpoint actually serves, so it was wrong in both directions.
Verified every gpt-5.x id against `POST /backend-api/codex/responses` on a
ChatGPT Pro credential and rebuilt the allowlist from the results.
Removed (offered in the picker, rejected by the backend with HTTP 400):
- `gpt-5.2` and `gpt-5.6`, both explicitly allowlisted
- `gpt-5.3-codex`, admitted by the `modelId.includes("codex")` auto-allow
Added (served by the backend, previously hidden from the picker):
- `gpt-5.6-sol`, `gpt-5.6-luna`, `gpt-5.6-terra` — the current flagship
subscription models, excluded on an untested assumption that the
sol/luna/terra variants were API-tier-only
Dropped the `includes("codex")` substring auto-allow. It cannot express the
real policy: the tier accepts `gpt-5.3-codex-spark` but rejects
`gpt-5.3-codex`, and accepts `gpt-5.6-sol` but rejects `gpt-5.6`. Membership
is now exact-match only.
Transport was never involved. Plain HTTP with our own `originator: altimate`
identity reaches every working model; no websocket, `openai-beta`, or
`x-codex-beta-features` header changes any outcome.
Rewrote `codex-allowlist.test.ts` around the verified truth table so both
failure directions are guarded, plus a regression barrier against
reintroducing a substring rule.
Closes #1178
Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01VqnuBDGkh1ZT65Ti7e6DHZ
* docs: record why the Codex model allowlist is static, not discovered
The obvious objection to the allowlist this PR corrects is that any static
list drifts. There is an authoritative per-account endpoint that would let us
derive it instead — `GET /backend-api/codex/models?client_version=<v>` — so I
probed it rather than leave the objection unanswered.
It works, and it accepts our own identity: `originator: altimate` plus our own
User-Agent, no impersonation. Its `visibility: "list"` slugs are exactly the
seven ids in `OAUTH_ALLOWED_MODELS`, which independently confirms the table
built by request-level probing.
It is still unusable as a runtime source of truth. `client_version` is
mandatory and is gated against each model's `minimal_client_version`, today
0.98.0 through 0.144.0 — Codex CLI release numbers, a line we are not on. Our
versions sit below all of them and the gate fails silently: our published
`0.9.7` returns `HTTP 200 {"models":[]}`, and a dev build's `local` returns
`400 {"detail":"Invalid client_version format"}`. Deriving the list would mean
asserting a Codex CLI version we are not, so the list stays static.
Comment-only; no behavior change. Records the endpoint, the corroboration, the
blocker, and the drop-in shape should a legitimate client_version ever exist,
so the next person does not repeat the investigation.
Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01VqnuBDGkh1ZT65Ti7e6DHZ
* fix: match the OAuth model filter on api.id, not the config map key
Addresses review on #1179.
`shouldAllowOAuthModel` was called with the model map KEY. For every
models.dev catalog entry the key equals `api.id`, so this was invisible —
but a user can alias a model in config:
provider.openai.models.fast-spark.id = "gpt-5.3-codex-spark"
Config models are folded into the provider database ("extend database from
config" in `Provider.state`) BEFORE auth loaders run, so that entry reaches
this loader keyed `fast-spark` with the real id on `api.id`. Matching the
key deleted it, hiding a model the backend actually serves. The sibling
`plugin/openai/codex.ts` filter already matches on `model.api.id`.
Extracted `disallowedOAuthModelKeys`, which resolves `api.id ?? key` — the
fallback matters because the database only backfills
`model.api.id ?? model.id ?? modelID` after this hook runs, so the field is
not guaranteed populated despite the type. Behaviour is unchanged for every
catalog model (key === api.id verified against models.dev/api.json); only
aliases move, and an alias of a rejected id is still deleted.
Comment corrections, no behaviour change:
- The allowlist claimed every other gpt-5.x catalog id had been probed. It
had not: gpt-5-mini, gpt-5-nano, gpt-5-pro and gpt-5.2-chat-latest are in
the catalog and in neither list. Recorded as unprobed and fail-closed
rather than left as an overclaim.
- Recorded that the truth table is one Pro account's entitlements and has
not been checked against a Plus credential.
- Recorded that the codex-tagged ids reviewers keep asking about
(gpt-5.1-codex, gpt-5.1-codex-max, gpt-5.1-codex-mini, gpt-5.2-codex,
gpt-5.3-codex-xhigh) are absent from the models.dev catalog entirely, so
no filter here can hide them.
- Disambiguated the two version numbers. What reaches the wire is
`Installation.VERSION` (the npm-published 0.9.7, or `local` for a dev
build), not the 1.17.9 in packages/opencode/package.json, which is
inherited from upstream and never sent. Also stated that the blocker is
not arithmetic: bumping our number would not lift it, because the field
asserts which Codex CLI release we are.
Six new tests cover the alias fix in both directions, the missing-api.id
fallback, and that the catalog set resolves identically either way.
The allowlist membership is byte-for-byte unchanged, as is the
`originator: "altimate"` identity.
Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01VqnuBDGkh1ZT65Ti7e6DHZ
* docs: correct a false catalog claim, and record the cold-cache caveat
My previous commit asserted that gpt-5.1-codex, gpt-5.1-codex-max,
gpt-5.1-codex-mini, gpt-5.2-codex and gpt-5.3-codex-xhigh "are not in the
models.dev catalog at all", and concluded that no filter here could hide
them. That was wrong, and the review that caught it was right.
I had checked live https://models.dev/api.json and stopped there. There is a
second catalog: the bundled provider/models-snapshot.ts. ModelsDev.Data
resolves disk cache -> bundled snapshot -> fetch, so on a fresh install or
cold cache the snapshot IS the catalog. Its `openai` provider still carries
gpt-5-codex, gpt-5.1-codex, gpt-5.1-codex-max, gpt-5.1-codex-mini and
gpt-5.2-codex. Those five did reach the loader, the removed
includes("codex") rule did offer them, and exact matching does now delete
them. None was individually probed.
They stay excluded, on the same fail-closed reasoning applied to gpt-5.2: an
unverified inclusion fails opaquely mid-request, an unverified exclusion
fails visibly at selection. But that is a decision, and it is now recorded as
one rather than dressed up as a discovery.
The same staleness cuts the other way and is also now recorded: the bundled
snapshot contains no gpt-5.6 variant at all, so on a cold cache sol/luna/terra
are absent from the catalog and this allowlist cannot conjure them — the
filter only deletes. The allowlist is necessary for them to appear but, on a
cold cache, not sufficient; they surface once the catalog refreshes from
models.dev or the snapshot is regenerated at the next release build.
Adds a test pinning the five unprobed snapshot codex ids as excluded-by-
decision, asserting they are in neither verified list, so a future probe has
an obvious place to land.
Comments and tests only. The allowlist membership is unchanged, as is
request-time behaviour.
Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01VqnuBDGkh1ZT65Ti7e6DHZ
---------
Co-authored-by: Claude Opus 5 <[email protected]>1 parent 6f6037f commit c59a5a2
2 files changed
Lines changed: 318 additions & 106 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
25 | 115 | | |
26 | | - | |
| 116 | + | |
27 | 117 | | |
28 | 118 | | |
29 | 119 | | |
30 | | - | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
31 | 123 | | |
32 | 124 | | |
33 | 125 | | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
38 | 134 | | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
44 | 139 | | |
45 | | - | |
46 | 140 | | |
47 | 141 | | |
48 | 142 | | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
49 | 165 | | |
50 | 166 | | |
51 | 167 | | |
| |||
429 | 545 | | |
430 | 546 | | |
431 | 547 | | |
432 | | - | |
433 | | - | |
434 | | - | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
435 | 552 | | |
436 | 553 | | |
437 | 554 | | |
438 | 555 | | |
439 | 556 | | |
440 | 557 | | |
441 | 558 | | |
442 | | - | |
443 | | - | |
| 559 | + | |
| 560 | + | |
444 | 561 | | |
445 | 562 | | |
446 | 563 | | |
| |||
0 commit comments