Skip to content

Commit 0d8f6c2

Browse files
committed
fix(auth): order the ChatGPT model list as the Codex backend does
gpt-6.1-terra sat third, ahead of gpt-6-sol, gpt-6-luna and gpt-5.6-sol, although the backend lists it after gpt-5.6-sol. Nothing pinned the order, since the other tests read the constant, so a test now does. The comment no longer says the retirement applies to ChatGPT sign-in only. The retirement notice is OpenAI documentation, which does not say whether API access is affected, so the comment states only that the three models are left out because the documentation lists them as retired for ChatGPT.
1 parent 260d6d7 commit 0d8f6c2

2 files changed

Lines changed: 33 additions & 5 deletions

File tree

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

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

‎src/auth/codex/constants.ts‎

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,19 @@ 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 the Codex backend lists
25+
// them (GET /codex/models); the first entry is the ChatGPT default. gpt-5.4,
26+
// gpt-5.4-mini and gpt-5.5 are left out because OpenAI's documentation lists
27+
// them as retired for ChatGPT, whether or not the backend still returns them.
28+
// The OpenAI API-key path has its own list and default and does not follow
29+
// this one.
2830
export const CODEX_DEFAULT_MODELS = [
2931
"gpt-6.1-sol",
3032
"gpt-6-astra",
31-
"gpt-6.1-terra",
3233
"gpt-6-sol",
3334
"gpt-6-luna",
3435
"gpt-5.6-sol",
36+
"gpt-6.1-terra",
3537
"gpt-5.6-terra",
3638
"gpt-5.6-luna",
3739
] as const;

0 commit comments

Comments
 (0)