Repository navigation
Description
Version / branch / commit
main @ d37de92 (zero 0.6.0)
OS and environment
Windows 11 / PowerShell / Go 1.26.5
Summary
Live model discovery for the chatgpt (Codex OAuth) provider never succeeds. Every attempt fails, so the model picker silently falls back to the hardcoded list in internal/providermodelcatalog/catalog.go:109 ├ö├ç├ which is stale (gpt-5.5, gpt-5.4, gpt-5.4-mini, gpt-5.3-codex-spark).
The practical consequence is that models the user's ChatGPT subscription does have access to (currently the gpt-5.6-* family) are unreachable via the subscription. The only way to select them is to type the model ID under the API-key openai provider, which silently bills platform.openai.com instead of the subscription ├ö├ç├ and produces a confusing rate limit error: You have no credits remaining that the TUI renders as "Rate limited ├ö├ç├ wait a moment".
There are three independent defects stacked on top of each other.
Steps to reproduce
- Log in to the
chatgptprovider via OAuth (zero auth). - Run
zero providers models chatgpt.
Expected behavior
The models the Codex backend actually reports for the account are listed and selectable in /model.
Actual behavior
$ zero providers models chatgpt
[zero] models endpoint returned 400 Bad Request: {
"error": {
"message": "[{'type': 'missing', 'loc': ('query', 'client_version'), 'msg': 'Field required', 'input': None}]",
"type": "invalid_request_error",
...
}
}
Root cause
1. Missing required client_version query param  400.
discoverOpenAIModels builds the endpoint via modelsEndpoint (internal/providermodeldiscovery/discovery.go:284), which explicitly clears the query string (parsed.RawQuery = "", line 294). The Codex backend at https://chatgpt.com/backend-api/codex/models requires ?client_version=... and rejects the request otherwise.
2. Response shape doesn't match the parser.
Patching in ?client_version= locally makes the endpoint return 200, but the Codex response is not the OpenAI {"data":[{"id":}]} shape. It is:
{"models":[{"slug":"gpt-5.6-sol","display_name":"GPT-5.6-Sol",
"description":"Latest frontier agentic coding model.",
"context_window":272000,"minimal_client_version":"0.144.0", ...}]}parseModelsResponse (discovery.go:326) only reads data[].id, so it produces zero models and errors with models endpoint returned no model ids.
The slugs actually returned for a Plus/Pro account today:
codex-auto-review
gpt-5.3-codex-spark
gpt-5.4
gpt-5.4-mini
gpt-5.5
gpt-5.6-luna
gpt-5.6-sol
gpt-5.6-terra
Note the payload also carries display_name, description, and context_window ├ö├ç├ strictly better metadata than the curated catalog currently hardcodes.
3. Even a correct parse would be filtered back out.
mergeLiveModels (discovery.go:386) intersects live results with the curated catalog and drops anything not already present:
if hasCatalog {
continue
}Since the curated chatgpt catalog lists only the four older IDs, newly discovered gpt-5.6-* models would still be discarded even after fixes 1 and 2.
Suggested fix
- Append
client_versionto the discovery URL whenprovidercatalog.NormalizeID(profile.CatalogID) == "chatgpt"(alongside the existingApplyCodexHeadersspecial-case atdiscovery.go:196). - Teach the parser the Codex
models[].slugshape, mappingdisplay_name/description/context_windowontoModel. - Allow live results through
mergeLiveModelsforchatgptrather than intersecting against the curated list, so the subscription's real entitlements win over a static list that will always lag.
Secondary, and arguably worth a separate issue: the TUI collapses the Codex/OpenAI 402-style "no credits remaining" error into Rate limited ├ö├ç├ wait a moment, or switch model with /model, which sends users to wait out a limit that will never clear.
Happy to send a PR for the discovery fixes if the approach above looks right.
Activity
PierrunoYT commentedon Jul 31, 2026
I have this fixed locally, including all three discovery defects: the required Codex client_version query parameter, parsing the models[].slug response shape and metadata, and treating the authenticated ChatGPT model list as authoritative instead of filtering new models against the stale curated catalog. Regression tests and the full validation suite pass. I can open a focused PR as soon as this issue is approved.
anandh8x commentedon Aug 28, 2026