Repository navigation
Commit bbc2a2b
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_01VqnuBDGkh1ZT65Ti7e6DHZ1 parent a279b9d commit bbc2a2b
2 files changed
Lines changed: 156 additions & 28 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
24 | | - | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
25 | 26 | | |
26 | | - | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
27 | 43 | | |
28 | | - | |
29 | | - | |
30 | | - | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
31 | 52 | | |
32 | 53 | | |
33 | 54 | | |
| |||
45 | 66 | | |
46 | 67 | | |
47 | 68 | | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
59 | 91 | | |
60 | 92 | | |
61 | 93 | | |
| |||
86 | 118 | | |
87 | 119 | | |
88 | 120 | | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
89 | 143 | | |
90 | 144 | | |
91 | 145 | | |
| |||
469 | 523 | | |
470 | 524 | | |
471 | 525 | | |
472 | | - | |
473 | | - | |
474 | | - | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
475 | 530 | | |
476 | 531 | | |
477 | 532 | | |
478 | 533 | | |
479 | 534 | | |
480 | 535 | | |
481 | 536 | | |
482 | | - | |
483 | | - | |
| 537 | + | |
| 538 | + | |
484 | 539 | | |
485 | 540 | | |
486 | 541 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
6 | | - | |
7 | | - | |
8 | | - | |
9 | | - | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
13 | 23 | | |
14 | 24 | | |
15 | 25 | | |
| |||
30 | 40 | | |
31 | 41 | | |
32 | 42 | | |
33 | | - | |
| 43 | + | |
34 | 44 | | |
35 | 45 | | |
36 | 46 | | |
| |||
120 | 130 | | |
121 | 131 | | |
122 | 132 | | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
0 commit comments