Skip to content

Commit d2c486f

Browse files
committed
test(auth): pin the built-in ChatGPT model list to the served catalog
Nothing pinned the list's order or its default, since the other tests read the constant, so a test now records what GET /codex/models listed for a ChatGPT Plus account on 2026-11-01. The comment says where the order comes from and that availability varies by plan and rollout, so it no longer implies every account is served this list. It also gives the reason the three models are left out: OpenAI retired them from Codex with ChatGPT sign-in, and API-key sessions are not affected.
1 parent 260d6d7 commit d2c486f

2 files changed

Lines changed: 34 additions & 4 deletions

File tree

‎src/auth/codex/constants.test.ts‎

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import { describe, expect, test } from "bun:test";
2+
3+
import { CODEX_DEFAULT_MODELS } from "./constants.js";
4+
5+
describe("CODEX_DEFAULT_MODELS", () => {
6+
// Recorded from GET /codex/models for a ChatGPT Plus account (client_version
7+
// 0.165.0, 2026-11-01). Nothing else pins the order or the default: the other
8+
// tests read the constant.
9+
test("follows the order the Codex backend listed the models in", () => {
10+
expect([...CODEX_DEFAULT_MODELS]).toEqual([
11+
"gpt-6.1-sol",
12+
"gpt-6-astra",
13+
"gpt-6.1-terra",
14+
"gpt-6-sol",
15+
"gpt-6-luna",
16+
"gpt-5.6-sol",
17+
"gpt-5.6-terra",
18+
"gpt-5.6-luna",
19+
]);
20+
});
21+
22+
test("leaves out the models OpenAI retired for ChatGPT sign-in", () => {
23+
for (const retired of ["gpt-5.4", "gpt-5.4-mini", "gpt-5.5"]) {
24+
expect(CODEX_DEFAULT_MODELS as readonly string[]).not.toContain(retired);
25+
}
26+
});
27+
});

‎src/auth/codex/constants.ts‎

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,13 @@ export const CODEX_CLIENT_VERSION = "0.50.0";
2121
// the public Codex CLI originator.
2222
export const CODEX_ORIGINATOR = "codex_cli_rs";
2323

24-
// The models a ChatGPT sign-in can select, in the Codex backend's priority
25-
// order (GET /codex/models); the first entry is the ChatGPT default. OpenAI
26-
// retires models for ChatGPT sign-in on its own schedule, independently of the
27-
// OpenAI API, so this list and its default do not follow the API-key path.
24+
// The models a ChatGPT sign-in offers, in the order GET /codex/models listed
25+
// them for a ChatGPT Plus account (client_version 0.165.0, 2026-11-01); the
26+
// first entry is the ChatGPT default. Availability varies by plan and rollout,
27+
// so other accounts may be served a different set. gpt-5.4, gpt-5.4-mini and
28+
// gpt-5.5 are left out because OpenAI retired them from Codex with ChatGPT
29+
// sign-in. API-key sessions are not affected, so the API-key path keeps its
30+
// own list and default.
2831
export const CODEX_DEFAULT_MODELS = [
2932
"gpt-6.1-sol",
3033
"gpt-6-astra",

0 commit comments

Comments
 (0)