From b7bfd5fafbcf5a38c5a6d7d479d75c1114527798 Mon Sep 17 00:00:00 2001 From: Sawyer Cutler Date: Tue, 29 Sep 2026 13:35:10 -0700 Subject: [PATCH 1/2] feat: export the models a ChatGPT login serves --- README.md | 1 + src/constants.ts | 15 +++++++++++++++ 2 files changed, 16 insertions(+) diff --git a/README.md b/README.md index 572210c..021a994 100644 --- a/README.md +++ b/README.md @@ -104,6 +104,7 @@ process.stdout.write("\n"); | `CodexTokens`, `FetchLike` | Types. | | `CODEX_PROVIDER` | The `"codex"` provider id. | | `CODEX_BASE_URL`, `CODEX_RESPONSES_PATH` | `https://chatgpt.com/backend-api` and `/codex/responses`. | +| `CODEX_DEFAULT_MODELS` | The models a ChatGPT login serves, from the Codex CLI's bundled catalog. | | `CODEX_ACCOUNT_ID_OPTION` | `providerOptions` key sent as the `chatgpt-account-id` header. | | `CODEX_SESSION_ID_OPTION` | `providerOptions` key sent as `prompt_cache_key` and the `session_id` header. | | `CODEX_REASONING_EFFORT_OPTION` | `providerOptions` key sent as `reasoning.effort`; `"none"` omits it. | diff --git a/src/constants.ts b/src/constants.ts index c336635..8f44470 100644 --- a/src/constants.ts +++ b/src/constants.ts @@ -62,6 +62,21 @@ export const CODEX_AUTHORIZE_EXTRA_PARAMS: Record = { export const CODEX_BASE_URL = "https://chatgpt.com/backend-api"; export const CODEX_RESPONSES_PATH = "/codex/responses"; +// The Codex CLI's bundled catalog (openai/codex@b1e72963c3, +// codex-rs/models-manager/models.json) in its priority order, less the +// gpt-daybreak-* entries. +export const CODEX_DEFAULT_MODELS = [ + "gpt-6.1-sol", + "gpt-6-astra", + "gpt-6-sol", + "gpt-6-luna", + "gpt-5.6-sol", + "gpt-5.6-terra", + "gpt-5.6-luna", + "gpt-5.5", + "codex-auto-review", +] as const; + // Refresh a token this many milliseconds before its stated expiry so a // request is never sent with a token about to lapse mid-flight. export const CODEX_REFRESH_SKEW_MS = 60_000; From 391e557f6c368dd794b35d9212894f09614a33b9 Mon Sep 17 00:00:00 2001 From: Sawyer Cutler Date: Tue, 29 Sep 2026 13:40:16 -0700 Subject: [PATCH 2/2] fix: list only the models the Codex CLI shows in its picker --- README.md | 2 +- src/constants.ts | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 021a994..3c83813 100644 --- a/README.md +++ b/README.md @@ -104,7 +104,7 @@ process.stdout.write("\n"); | `CodexTokens`, `FetchLike` | Types. | | `CODEX_PROVIDER` | The `"codex"` provider id. | | `CODEX_BASE_URL`, `CODEX_RESPONSES_PATH` | `https://chatgpt.com/backend-api` and `/codex/responses`. | -| `CODEX_DEFAULT_MODELS` | The models a ChatGPT login serves, from the Codex CLI's bundled catalog. | +| `CODEX_DEFAULT_MODELS` | The models the Codex CLI's bundled catalog lists in its picker. | | `CODEX_ACCOUNT_ID_OPTION` | `providerOptions` key sent as the `chatgpt-account-id` header. | | `CODEX_SESSION_ID_OPTION` | `providerOptions` key sent as `prompt_cache_key` and the `session_id` header. | | `CODEX_REASONING_EFFORT_OPTION` | `providerOptions` key sent as `reasoning.effort`; `"none"` omits it. | diff --git a/src/constants.ts b/src/constants.ts index 8f44470..c27121b 100644 --- a/src/constants.ts +++ b/src/constants.ts @@ -62,9 +62,9 @@ export const CODEX_AUTHORIZE_EXTRA_PARAMS: Record = { export const CODEX_BASE_URL = "https://chatgpt.com/backend-api"; export const CODEX_RESPONSES_PATH = "/codex/responses"; -// The Codex CLI's bundled catalog (openai/codex@b1e72963c3, -// codex-rs/models-manager/models.json) in its priority order, less the -// gpt-daybreak-* entries. +// The models the Codex CLI's bundled catalog lists in its picker +// (openai/codex@b1e72963c3, codex-rs/models-manager/models.json, visibility +// "list"), by priority. export const CODEX_DEFAULT_MODELS = [ "gpt-6.1-sol", "gpt-6-astra", @@ -74,7 +74,6 @@ export const CODEX_DEFAULT_MODELS = [ "gpt-5.6-terra", "gpt-5.6-luna", "gpt-5.5", - "codex-auto-review", ] as const; // Refresh a token this many milliseconds before its stated expiry so a