feat(models): fetch the openai-codex catalog live
The ChatGPT Codex catalog was compiled in: four models read once from the Codex CLI cache. The backend moved on — `gpt-6-astra` shipped, and `gpt-5.3-codex-spark` left — so the picker showed a table that no longer matched the account. `GET https://chatgpt.com/backend-api/codex/models?client_version=<v>` serves that table. Verified against a live ChatGPT account: the OAuth Bearer alone returns 200, the query is required (400 without it), and the backend gates the catalog on it — `0.104.0` answers with `codex-auto-review` alone, `0.150.0` omits `gpt-6-astra`, `0.155.1` serves the full set. `CODEX_CLIENT_VERSION` pins the current upstream release (openai/codex rust-v0.155.1) and the codex `User-Agent` now derives from it, so the two can never drift. `ListingDialect::OpenaiCodex` + `parse_openai_codex_listing` keep the `visibility == "list" && supported_in_api` models and carry the wire context window and per-model reasoning levels; `hardcoded_catalog` and its short-circuit in the fetch path are gone. The catalog advertises an `ultra` tier kigi has no level for — `think_efforts_to_options` drops it with a warning, as it does any unknown token.
This commit is contained in:
4 files changed
+213
-240
No files matched your search
@@ -383,13 +383,18 @@ client-side, no backend surface.
|
||||
API-key `openai` Responses requests carry NONE of this
|
||||
(byte-identical, pinned by a control wire test). `reasoning.effort`
|
||||
carries the thinking level. NO websocket, NO base_instructions.
|
||||
CATALOG is HARDCODED (`PlatformId::hardcoded_catalog` →
|
||||
`openai_codex_wire_models`, mapped through the SAME
|
||||
`platform_wire_model_to_entry` output): exactly the 4 `visibility=list` &&
|
||||
`supported_in_api=true` models (`gpt-5.6-sol/terra/luna`, `gpt-5.5`, ctx
|
||||
272000, per-model efforts) — NO live `/models` fetch, NO codex-CLI /
|
||||
`~/.codex` dependency; `gpt-5.3-codex-spark` (api=false) and
|
||||
`gpt-5.4`/`gpt-5.4-mini`/`codex-auto-review` (hidden) are EXCLUDED.
|
||||
CATALOG is LIVE (`ListingDialect::OpenaiCodex` →
|
||||
`parse_openai_codex_listing`): `GET {base}/models?client_version=
|
||||
{CODEX_CLIENT_VERSION}` with the Bearer alone (no identity headers —
|
||||
verified), keeping the `visibility=="list" && supported_in_api` models
|
||||
and carrying their context window + per-model efforts. The query is
|
||||
REQUIRED (400 without it) and the backend GATES the catalog on it:
|
||||
`0.104.0` answers with `codex-auto-review` alone, `0.150.0` omits
|
||||
`gpt-6-astra`, `0.155.1` serves the full set — so
|
||||
`CODEX_CLIENT_VERSION` (kigi-sampling-types, also the `User-Agent`
|
||||
version) must track a real upstream codex release, and a model that
|
||||
never appears is a version-gate symptom first. NO codex-CLI / `~/.codex`
|
||||
dependency.
|
||||
- `OAuthFlow::GithubDeviceCopilot` → `auth::github_copilot` (TWO-STAGE).
|
||||
Provider: `github-copilot` (`scope_key oauth/github-copilot`, base
|
||||
`api.individual.githubcopilot.com`, ChatCompletions wire). Stage 1 is an
|
||||
@@ -532,9 +537,14 @@ client-side, no backend surface.
|
||||
`~/.kigi/models_dev_cache.json`). Wire values always win; enrichment
|
||||
never invents model availability. Canonical reasoning efforts:
|
||||
none/minimal/low/medium/high/xhigh/max (`max` split from `xhigh` 2026-07;
|
||||
`ultra` was dropped the same month, no backend accepts it; Kimi wire
|
||||
spells its top tier `max`, kimi_compat renames). config.toml accepts any
|
||||
letter case: `ReasoningEffort` deserializes through `FromStr`.
|
||||
Kimi wire spells its top tier `max`, kimi_compat renames). config.toml
|
||||
accepts any letter case: `ReasoningEffort` deserializes through `FromStr`.
|
||||
The codex catalog advertises an `ultra` tier above `max` for
|
||||
`gpt-6-astra`/`gpt-5.6-sol`/`gpt-5.6-terra`; kigi has no such level and
|
||||
`think_efforts_to_options` drops it with a warning. The models.dev provider
|
||||
for the Kimi coding plan is `kimi-code-plan-cn` (api.kimi.com — kigi's
|
||||
endpoint); it was renamed from `kimi-for-coding` in 2026-09 and
|
||||
`kimi-code-plan-global` is the api.kimi.ai twin.
|
||||
|
||||
## Milestones (PRD §8.3)
|
||||
|
||||
|
||||
Reference in new issue
Block a user