fix(codex): allowlist gpt-6.1-terra for ChatGPT-subscription users
Issue for this PR
Closes #1623
Type of change
- Bug fix
- New feature
- Refactor / code improvement
- Documentation
What does this PR do?
Not backend-probed. @anandgupta42, please probe gpt-6.1-terra before merging. I couldn't call the live POST https://chatgpt.com/backend-api/codex/responses endpoint because I don't have a ChatGPT credential, so this addition rests on catalog evidence only. If it returns 400 … not supported when using Codex with a ChatGPT account, drop it from OAUTH_ALLOWED_MODELS and move it to VERIFIED_REJECTED. If it returns 200, move it from CATALOG_VERIFIED_UNPROBED to VERIFIED_ACCEPTED.
OAUTH_ALLOWED_MODELS in packages/opencode/src/plugin/codex.ts hides gpt-6.1-terra from ChatGPT Plus/Pro users, even though the official Codex client lists it for them.
Added (catalogs fetched 2026-11-05):
| id | Codex catalog (openai/codex codex-rs/models-manager/models.json on main) | models.dev openai |
|---|---|---|
gpt-6.1-terra | added in openai/codex@126a0ee92e (2026-10-26, "Add GPT-6.1 Terra to model catalogs"). visibility: "list", priority 7, upgrade: null, minimal_client_version 0.153.0, plus/pro in available_in_plans | present, release_date 2026-10-26 |
Removed: none. No allowlisted id has a retirement date or visibility: "hide":
gpt-5.5 list upgrade -> gpt-6-sol retirement_at: null
gpt-5.6-sol list upgrade -> gpt-6-sol retirement_at: null
gpt-5.6-terra list upgrade -> gpt-6-sol retirement_at: null
gpt-5.6-luna list upgrade -> gpt-6-luna retirement_at: null
gpt-5.3-codex-spark not in the shipped catalog
gpt-5.3-codex-spark is missing from the catalog, but it is missing from every revision I checked (back to openai/codex@cf6754e6, 2026-09-21), and #1565 records the same back to 2026-04. It stays because it was backend-probed (VERIFIED_ACCEPTED). The replacement targets gpt-6-sol and gpt-6-luna aren't allowlisted on main yet. #1565 adds them.
Relationship to #1565. #1565 (open, closes #1564) adds gpt-6-astra, gpt-6-luna, gpt-6-sol and gpt-6.1-sol. It was written before openai/codex added gpt-6.1-terra, so it doesn't include it. Both PRs use the same structure: a CATALOG_VERIFIED_UNPROBED test constant and an altimate_change block at the end of the set. Whichever merges second will hit a small textual conflict. The fix is to merge the two CATALOG_VERIFIED_UNPROBED arrays and the two marker blocks.
How the change is structured. Same convention as #1565:
gpt-6.1-terragoes into a new test constant,CATALOG_VERIFIED_UNPROBED, notVERIFIED_ACCEPTED. The probed truth table stays honest.- The trip-wire test now asserts
OAUTH_ALLOWED_MODELS == VERIFIED_ACCEPTED ∪ CATALOG_VERIFIED_UNPROBED. - New tests assert that catalog ids are allowlisted and don't overlap either probed list.
- In
codex.ts, the id sits inside analtimate_changeblock (codex.tsis inrequireMarkers). The block records the catalog evidence.
Not touched:
plugin/openai/codex.tsALLOWED_MODELS. That file still isn't wired, and its comments don't ask for parity. ItsparseFloat > 5.4fallback would already admitgpt-6.1-terra.- API-key behaviour. The filter only runs when
auth.type === "oauth".
Cold-cache caveat. The committed provider/models-snapshot.ts has no GPT-6 entry, so a source checkout won't show this model until the catalog refreshes. Release builds embed the live models.dev catalog (#1188), and that catalog has it.
How did you verify your code works?
bun test test/plugin/codex-allowlist.test.ts test/plugin/codex.test.tsinpackages/opencode: 34 pass, 0 fail.bun typecheck: the default parallel run is OOM-killed on this 7 GB sandbox, which has nothing to do with this diff.bun turbo typecheck --concurrency=1passes for the other 12 packages, andtsgo --noEmit --singleThreadedinpackages/opencodeis clean.bun run script/upstream/analyze.ts --markers --base origin/main --strict: ok.bun script/check-tracker-leaks.ts: clean.- Re-parsed both catalogs to build the tables above.
- Not done: a live backend probe of
gpt-6.1-terra(see the top of this description).
Cost side effects
None. This only changes which ids the OAuth model picker keeps. It adds no model calls, queries or resources.
Screenshots / recordings
N/A, not a UI change.
Checklist
- I have tested my changes locally
- I have not included unrelated changes in this PR
- I checked for cost side effects (model calls, queries or cloud resources that grow with user data) and described them, or wrote "none"
Summary by cubic
Adds gpt-6.1-terra to OAUTH_ALLOWED_MODELS in packages/opencode/src/plugin/codex.ts so ChatGPT Plus/Pro users can pick it, matching the official Codex client catalog. Closes #1623.
The model is catalog-verified but hasn't been backend-probed, so it's kept in a new CATALOG_VERIFIED_UNPROBED test bucket and the allowlist trip-wire now asserts OAUTH_ALLOWED_MODELS == VERIFIED_ACCEPTED ∪ CATALOG_VERIFIED_UNPROBED.
Notes
- Probe
gpt-6.1-terraagainst the live Codex endpoint before merging; move it toVERIFIED_ACCEPTEDon HTTP 200, or drop it from the allowlist on HTTP 400. - A source checkout won't list the model until the catalog snapshot refreshes; release builds embed the live models.dev catalog, which carries it.
- If #1565 merges first, this will need a small conflict fix (merge the catalog bucket and marker blocks).