Repository navigation
feat(provider): list the models each ChatGPT account serves - #1579
Conversation
Self-Review (
|
The ChatGPT picker offered a built-in list that went stale as OpenAI added models and retired others for ChatGPT sign-in, so a fresh login could default to a model its account no longer serves. The backend returns no models to client_version 0.50.0, so requests now send the current Codex CLI version, including the sign-in scope check.
9ca662d to
a5f74c3
Compare
|
Stack merge order: #1580 → #1581 → #1579. This repo keeps merged branches, so GitHub does not retarget the next PR on its own:
|
There was a problem hiding this comment.
Review · Request changes
A ChatGPT profile fetches the models that account can use and shows those in the picker. The first one is the default. A failed fetch is supposed to keep the last good list, or the built-in list if there has never been one.
-
The fetched list is saved under the account id from the first token read (
src/provider/codex-model-catalog.ts:119). If that read fails, the list is saved under "no account." The fetch then reads the token again, succeeds, and learns the real account id. The picker looks the list up under that new id, finds nothing, and shows the built-in models instead of the ones just fetched. The comment on that function says the second read fails the same way. It does not. A temporary test of this sequence failed and was removed. Save the list under the account id the successful fetch used. Startup only fetches once, so the picker stays on the built-in list until something fetches again. -
Two logins that have no account id share one saved list. Switch accounts and have the new fetch fail or come back empty, and the picker still shows the previous account's models, while the request uses the new account's token. Logins that both have account ids do not share a list.
-
The models shown while connecting are not saved. That fetch builds a throwaway list (
src/provider/codex-model-catalog.ts:140). If the fetch after connect then fails, the fallback is the built-in list, not the models just shown.
|
Triage: Fail Asking a maintainer about:
Notes:
Triage will label. |
Summary
GET /codex/modelsafter startup and after/connect, keeps the listed entries in the backend's priority order, and makes the first one the profile's default. Requests sendclient_version0.165.0, the current Codex CLI release; the backend returns no models to the previous 0.50.0.Verification
bun run checkandbun run testpass.codex/pluswithgpt-6.1-solcompletes.Fixes CL-11727