Repository navigation
fix(models): show every chat model a signed-in provider lists - #167462
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. What this changesThe branch publishes unfamiliar chat models from provider listings, filters unsupported models, and preserves explicitly selected older OpenAI references. Example: An OpenAI API-key user selects openai/gpt-5.5-2026-04-23
Review scores
ProductKind: Feature · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review This PR remains useful because current main does not provide the broader discovery behavior. Both prior findings are resolved, the shared-default direction is accepted, and no actionable patch defect remains. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherProvider plugins combine account model listings with known model metadata to populate OpenClaw’s model pickers and CLI. The shared plugin SDK handles discovery, while providers retain their eligibility and transport rules. flowchart TD
A[Provider credentials] --> B[Guarded account listing]
B --> C[Provider model ID selector]
C --> D[Shared chat model projection]
E[Known model metadata] --> D
D --> F[Provider eligibility rules]
F --> G[Model picker and CLI]
G --> H[Agent runtime request]
Technical reviewBest possible solution: Keep discovery in the shared SDK owner, enrich listed models with provider metadata, and retain explicit older-model selections with accurate runtime instructions. Do we have a high-confidence way to reproduce the issue? Yes: current-main admission rules establish why unfamiliar listed IDs disappear, and recorded CLI/Gateway comparisons demonstrate the user flow. This review did not execute target code. Is this the best way to solve the issue? Yes: the patch reuses the existing shared acquisition and classifier owners, preserves custom selectors, and follows the recorded SDK direction. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 98457908cf3e. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
PR surfaceSource +25, Tests +68, Docs +25. Total +118 across 11 files. Added test files: 0. View PR surface stats
LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (5 earlier review cycles)
Reviewed October 8, 2026, 8:01 PM ET / October 9, 2026, 00:01 UTC (Revision 6). |
|
Maintainer decision: unify default discovery. |
The default projection ignored the public readModelId selector, so a plugin whose rows carry their id elsewhere published an empty catalog and rows a selector rejects were admitted. Apply the selector (default: id on object: model rows) before the shared chat classifier, document the default admission contract, and note that old OpenAI models reject hosted web search.
|
Landed in 6b3a4ec. Signed-in providers using the shared live listing now show every listed chat model (non-chat, retired and pre-GPT-5 OpenAI families stay out of browse lists; explicitly selected refs still resolve; plugin readModelId selectors still normalize/reject). Proof: real OpenAI /v1/models (main 33 → 36 shown, every shown row answers on the default runtime), a third-party fixture plugin through the shared helper, regressions that failed on main, and a published 2026.9.9 → candidate upgrade. |
…aw#167462) ## What Problem This Solves Fixes: when you sign in to OpenAI with an API key, or to xAI or any provider that uses the shared live model listing, chat models the provider lists stay hidden from the model pickers until an OpenClaw release adds them. ## User Impact User impact: signed-in users see every chat model their provider lists, including models released after their OpenClaw version. Catalog rows still supply names, prices and context limits for models OpenClaw already knows. Embedding, image, video, audio, realtime, speech, transcription, moderation, legacy-completions and retired models stay hidden. On the OpenAI API-key listing, pre-GPT-5 families (GPT-3.5, GPT-4, GPT-4o, GPT-4.1, o1, o3, o4, and fine-tunes of them) are now hidden from `models list` and the pickers, including the 11 such rows `main` shows today. Ayaan chose this over changing the default runtime: these models fail on the default runtime, so listing them offers a choice that breaks on the first turn. GPT-5+ and IDs OpenClaw does not recognize keep appearing without a release. Existing setups keep working: a pre-GPT-5 model named as the default model, an `agents.defaults.models` key, an allowlist entry or a session model override still resolves, with the same conservative metadata the listing used to give it. To use one, reference it and pin the OpenClaw runtime: ```json5 { agents: { defaults: { model: { primary: "openai/gpt-4o" }, models: { "openai/gpt-4o": { agentRuntime: { id: "openclaw" } } }, }, }, } ``` ## Why This Change Was Made - **Shared listing.** `buildLiveModelProviderConfig` without `projectRows` used to keep only the static rows whose IDs were listed. It now runs listed rows through the existing shared chat classifier, the same one that `liveModelDiscovery` already uses. Static rows describe matching IDs, and other chat IDs get conservative rows. The plugin's `readModelId` selector still runs first (default: `id` on `object: "model"` rows, as on `main`): the ID it returns names the row, and a row it rejects stays out. Strict and advisory failure handling is unchanged: a failed listing keeps the fallback rows, and a successful empty listing stays empty. The direct consumer is the xAI API-key catalog. Third-party plugins that call this helper without `projectRows` get the same behavior; `docs/plugins/sdk-provider-plugins/model-catalogs.md` now describes this default and how `readModelId` restricts it. - **Classifier.** The classifier also excludes realtime, audio, bare `image`/`video` IDs and legacy completions models (`babbage`, `davinci`, `gpt-3.5-turbo-instruct`), plus rows whose `shutdown_date` has passed. On the real OpenAI listing, all 25 rows with a past shutdown date fail on `/v1/responses` (22 × 404, 3 × 400). Exclusions also apply to IDs in the static catalog. `<modality>-text-to-text` kinds (Hugging Face vision/audio chat models) stay admitted. - **OpenAI API key.** The catalog now uses the same shared builder. This removes the GPT-4o/4.1/5+/o family allowlist and the broad deny list from openclaw#162563. OpenClaw sends API-key turns through the Responses API, so narrow, named exclusions remain: - Pre-GPT-5 families (`^(?:ft:)?(?:gpt-3\.5|gpt-4|o[134])`): on the default runtime the Codex harness rejects every one of them with `400 Invalid value: 'custom'`, and 13 of them (gpt-3.5, gpt-4, gpt-4-turbo, gpt-4.1-nano, o1, o3-mini and snapshots) also reject hosted web search on the OpenClaw runtime. The rule also applies to catalog rows; the OpenAI manifest has none of these families (on `main` they came only from openclaw#162563's allowlist). Hiding only affects browsing: the OpenAI provider's `resolveDynamicModel` hook, which core calls only for a specific selected ref, returns the same conservative row for these IDs, so config defaults, allowlist entries and session overrides still resolve. - `search` models: Chat Completions only, per the [official model page](https://developers.openai.com/api/docs/models/gpt-4o-search-preview). On our key, `/v1/responses` returned 400 "not supported with the Responses API". - `live`, `cyber`, experiment (`exp`) and `alpha` codename IDs: our key lists them, but `/v1/responses` returns 404 or a persistent 500 for them. - Subscription-only route IDs (`gpt-5.3-codex-spark`) stay hidden, so the platform and ChatGPT routes stay separate. OpenAI IDs without a catalog row keep the existing conservative metadata from openclaw#162563 (Responses, text input, 128k context, 16,384 max output, reasoning for GPT-5+ and o-series, unknown cost). The shared prefix template is not used for OpenAI: every OpenAI ID starts with `gpt-`, so an unknown ID would inherit GPT-5 reasoning settings from an unrelated row. - **xAI.** Multi-agent models stay hidden: they reject the client-side tools that every OpenClaw turn sends (documented xAI limitation). - Retained gates: Anthropic `acceptUnknownModel`, OpenAI OAuth visibility, xAI OAuth backend eligibility, Google, Bedrock, Copilot, routed providers, replace mode and allowlists are unchanged. ## Evidence **Regression tests (each fails on `main`, passes here):** - `src/plugin-sdk/provider-catalog-live-runtime.test.ts`: a listed unknown chat ID shows. Realtime, audio, image, video, legacy-completions and past-shutdown rows stay out, including a static ID with image-only output. A Hugging Face `image-text-to-text` row stays. A failed listing keeps the static rows. The existing strict test still covers authoritative empty and failure. - `src/plugin-sdk/provider-catalog-live-runtime.test.ts` (selector): a strict plugin whose selector reads `slug` keeps static `model-a`, admits an unknown `fresh-chat` slug, drops a `fresh-embedding` slug, and keeps out an ordinary `{ id: "model-b", object: "model" }` row the selector rejects. On `ceaccc6` it fails (received only `model-b`); on this head it passes. - `extensions/openai/openai-api-key-catalog.test.ts`: dated snapshots, `gpt-5.3-codex` and a future `gpt-6.2` show with conservative metadata. `gpt-4-0613`, `gpt-4.1-mini`, `o3` and an `ft:gpt-4.1-mini:...` fine-tune stay hidden, as do search, live, cyber, experiment, alpha, subscription-only, non-chat and retired IDs. Without the pre-GPT-5 rule the test fails (1 failed, 6 passed); with it, 7/7 pass. A listing with only non-chat IDs is authoritative-empty. - `extensions/xai/index.test.ts`: an unknown `grok-5-preview` shows. Multi-agent and `grok-imagine-*` stay hidden. - `extensions/openai/openai-dynamic-model.test.ts`: selected `gpt-4o`, `o3` and `ft:gpt-4.1-mini:...` refs resolve through `resolveDynamicModel` with the conservative listing row (reasoning only for `o3`). Without the hook change, all 3 fail; with it, the 3 OpenAI suites pass 84/84. **Real OpenAI API key, isolated profiles** (`pnpm openclaw --profile <p> models list --provider openai --all --refresh --plain`; key read into process memory only): - `/v1/models` listed 168 rows. `main` (`618f4d2`, this branch's base) shows **33**, this branch shows **36**. The 11 `main` rows that disappear are all pre-GPT-5: gpt-4.1, gpt-4.1-mini, gpt-4.1-nano, gpt-4o, gpt-4o-mini, o1, o1-pro, o3, o3-mini, o3-pro, o4-mini. The 14 new rows are dated GPT-5 snapshots and `gpt-5.3-codex`. - Each listed ID got one direct `/v1/responses` call. Every row shown here returned 200, except `gpt-daybreak-red-latest` (a manifest row `main` also shows; 404 for this key). - Rows hidden on this branch, by family: image 10, realtime 10, transcription 7, TTS 7, audio 6, embeddings 3, moderation 2, `gpt-3.5-turbo-instruct` 2, Sora 2, Whisper 1, Babbage 1, Davinci 1, past shutdown date 18 (the other 7 already fall under a family above), experiment 22, search 4, cyber 2, alpha 2, live 1, pre-GPT-5 31. **Real turns through an isolated Gateway:** - `main`: `openai/gpt-4o-2024-11-20` fails with `Unknown model`. - Branch, default runtime: every shown row was run in the earlier matrix, including the `*-pro` rows (only `o1-pro`, now hidden, was skipped for cost). All 35 shown rows other than `gpt-daybreak-red-latest` reply on the default (Codex) runtime. `chat-latest` and `gpt-5.5-2026-04-23` were re-run on `897f27f` and reply `ROW_OK` with `agentHarnessId: "codex"`. `gpt-daybreak-red-latest` fails on both runtimes with "model not found" for this key; `main` shows it too. - Before the pre-GPT-5 rule, 29 shown rows failed on the default runtime with `Invalid value: 'custom'`; all 29 are now hidden. - Upgrade check, `main` (`618f4d2`) vs this branch, one turn each, isolated profiles: 1. `agents.defaults.model.primary: "openai/gpt-4o"` plus its `agentRuntime.id: "openclaw"`, nothing else: `main` replies `C1_OK`. Before the hook change, the branch failed with `Unknown model: openai/gpt-4o`; on this head it replies `C1_OK` (`agentHarnessId: "openclaw"`). 2. Existing session with a `gpt-4o` override set through `sessions.patch` (`modelOverride: "gpt-4o"`), then a turn in that session: `main` replies `C2_OK`. Before the hook change, the branch failed with `Unknown model`; on this head it replies `C2_OK` (`agentHarnessId: "openclaw"`). - With a `models.providers.openai` row for `gpt-4o` as well, it replies `GPT4O_OK` on `897f27f`. - `models list --provider openai --all --refresh --plain` on this head still shows 36 rows, none of them pre-GPT-5. - Hosted web search on old models: a direct `/v1/responses` call to `o3-mini` with `tools: [{ type: "web_search" }]` returns 400 "Tool 'web_search_preview' is not supported with o3-mini."; the same call without the tool returns 200. `docs/providers/openai/models.md` now says these models need `tools.web.search.provider` set to a managed provider or `tools.web.search.enabled: false` (the two switches `resolveNativeWebSearch` in `extensions/openai/native-web-search-policy.ts` checks, documented in `docs/tools/web.md#native-openai-web-search`). **Shared default listing through a third-party plugin and a fake OpenAI-compatible server** (the xAI API-key path uses the same builder; no xAI key was available): - `main`: `models list --provider listing-fixture --all --refresh --plain` shows only `fixture-known`, and a turn on `fixture-chat-next` fails with `Unknown model`. - Branch: the same command shows `fixture-known` and `fixture-chat-next`. Embedding, realtime, image and audio rows stay hidden. The turn replies `FIXTURE_OK from fixture-chat-next`. **Checks:** On `f6e1266`, `node scripts/check-changed.mjs` passes every lane except the dead-export scan, which fails only on `src/talk/client-voice-session-store.ts: ClientVoiceToolEffect`, a file this PR does not touch (same as on `897f27f`). `pnpm exec oxlint --type-aware` on the changed SDK files is clean. Focused tests on `f6e1266`: SDK live-runtime + strict 25/25, OpenAI API-key catalog + dynamic-model 44/44, xAI 47/47. **Known gaps:** `gpt-5.6` would show with conservative metadata if listed, because the manifest has no row for it. The hosted-search restriction for gpt-3.5, gpt-4, gpt-4-turbo, gpt-4.1-nano, o1 and o3-mini is now documented and was checked with a raw `o3-mini` API call; a full OpenClaw turn on one of these models with web search off was not run. A selected pre-GPT-5 ref now resolves even when the key does not list it (`main` reported `Unknown model` for unlisted IDs), so such a turn fails at OpenAI instead of before the request. No overlap with Pash/Sarah changes: `git log origin/main [email protected] [email protected]` shows no commits to the touched files. **Merge danger:** two-way door. There are no schema, config, stored-data or protocol changes, and a revert restores the old lists. Blast radius: model pickers and `models list` for signed-in OpenAI API-key users, xAI API-key users, and plugins that call `buildLiveModelProviderConfig` without `projectRows`. The shared classifier's new exclusions also apply to every `liveModelDiscovery` provider. Pre-GPT-5 OpenAI models drop out of the browse lists but still resolve when referenced; on the default runtime they fail as they do on `main`. Worst case otherwise, a listed model that OpenClaw cannot drive shows up and fails on its first turn instead of being hidden. Co-authored-by: Ayaan Zaidi <[email protected]>
Three fork-only test copies still asserted contracts upstream changed: - usage.sessions-usage-details: openclaw#163182 usage target (red since before the absorb) - provider-catalog-live-runtime.config: stale split of upstream's rewritten test (openclaw#167462, step 11) - user-turn-transcript.recorder: openclaw#168394 keeps the admission generation (step 20) Test files only. GREEN/RED/GREEN, neighbours and static gates recorded in the lane's .lane/DONE. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Jhynq2GVpzuVQQieebEubg
… of being refused (#200102) ## What Problem This Solves Fixes: listed models are refused before any request when OpenClaw only *guesses* they are not chat models. Examples are an ID that names a non-text family, an OpenAI live/cyber/exp/alpha ID, or an unfamiliar kind value. Other guesses show a model that fails for the listing key, such as `gpt-5.6-cyber`. ## User Impact - Rows that **declare** non-chat support (native kind, output modality, catalog) are unchanged: hidden and refused before any request. - Rows that are only **unlikely** chat leave the default picker and setup choices but appear in "all" views. Typed and configured refs to them still run. - OpenAI default picker on a real listing: wrongly shown 1 → 0, wrongly hidden 3 → 3. Typed `openai/o3` replies while it is absent from the default list. - Tencent TokenHub: an uncatalogued, unlabeled listed ID (the #198288 TTS case) stays out of the default picker without hiding new chat models from typed refs. ## Why This Change Was Made #199998 made "no evidence" unknown, but kept an interim rule: an ID that names a non-text family got `chat: false`. This PR separates guesses from declarations: | state | encoding | default picker / setup | "all", typed, configured | pre-run guard | |---|---|---|---|---| | yes / unknown | no `inference`, or `chat: true` | shown | shown, runs | passes | | unlikely | `inference: { chat: true, chatEvidence: "unlikely" }` | hidden | shown, runs | passes | | declared no | `inference: { chat: false }` | hidden | hidden | refused (#184996) | - **Marker:** an optional `chatEvidence` key inside `inference`; `chat` is not widened. Old readers drop it and see plain chat: - the 2026.11.5 beta inference schema is a non-strict `z.object`; - released stable readers have no `inference` at all (v1/v2 bundles only); - the v3 hosted reader drops unknown `inference` keys. - The registry runtime model and the v3 row schema accept the key. - No wire, protocol, config or cache-scope change. `ModelChoice` is a closed protocol object, so there is no "unverified" badge. - **Weak evidence** applies only to uncatalogued rows without capability fields: - the ID-family pattern; - an unfamiliar value in a kind field the same listing uses for chat; - a provider prior, set with the new discovery option `unknownModelChatEvidence: "unlikely"`. - **Surfaces:** - The visibility owner (default picker, `models.list`, `/models`) treats unlikely like `deprecated`: listed only in `all`, configured and retained views. - The setup picker, oMLX and Bifrost offer likely chat only. - The guard still refuses only `chat === false`. - **OpenAI:** - `live|cyber|exp|alpha` IDs are demoted instead of dropped, and the `gpt-5.6-cyber` exception is removed. - `search` IDs stay dropped: Responses rejects them with a 400, dated snapshots too. - The pre-GPT-5 rule stays (#167462). - **Tencent:** opts into the prior. Its list has IDs and status only and includes speech models (#198288). - **Docs:** `model-catalogs.md` and `src/plugins/AGENTS.md` each state the rule once, citing #198288 and #199998. The OpenAI and Tencent provider pages are updated to match. - **Supersedes #199545:** the name-matched OpenAI IDs are demoted, not revealed, so their 404/500 IDs stay out of the default picker. ## Evidence **Replay of saved real listings, main `84a378cf` vs this head.** Same truth labels as #199998. | provider | listed | proven | default picker main / branch | wrongly shown / hidden, main | wrongly shown / hidden, branch | |---|---|---|---|---|---| | OpenAI (after account projection) | 125 | 31 | 37 / 36 | 1 / 3 | **0 / 3** | | HF router + OpenRouter | 600 | 600 | 600 / 600 | 0 / 0 | 0 / 0 | | Vercel AI Gateway | 508 | 508 | 323 / 323 | 0 / 0 | 0 / 0 | | DeepInfra | 178 | 178 | 92 / 92 | 0 / 0 | 0 / 0 | | Venice | 414 | 414 | 142 / 142 | 0 / 0 | 0 / 0 | | NVIDIA (no proof) | 39 | 0 | 29 / 29 | – | – | | Ollama library | 24 | 24 | 23 / 23 | 0 / 0 | 0 / 0 | | models.dev | 9,878 | 9,545 | 9,414 / 9,414 | 0 / 0 | 0 / 0 | - **OpenAI wrongly hidden (3):** `gpt-4o-mini` and `o3` fall under the pre-GPT-5 rule and run by typed ref. `gpt-5-search-api` is Chat-Completions-only. - **OpenAI rows refused pre-run:** 46 on main, 0 on this branch. 38 of the 46 are now unlikely; 8 hit the pre-GPT-5 drop. - **TokenHub:** its authenticated listing is uncaptured, so a fixture of that shape is tested instead. **Real Gateway (built dist, real OpenAI key).** - **Setup:** each side ran under `env -i` with only PATH, a temp HOME, TMPDIR, `OPENCLAW_STATE_DIR` and `OPENCLAW_CONFIG_PATH`. The key came through stdin only. - **Isolation:** loopback, its own port and token, no channels (the harness refuses one). Reads waited for a `ready` live listing. | | main | branch | |---|---|---| | OpenAI rows: default `models list` / `--all --provider openai` | 39 / 39 | 36 / 102 | | `gpt-5.6-cyber` default / all | shown / shown | absent / shown | | `gpt-image-2` default / all | absent / absent | absent / shown | | typed `openai/o3` turn (absent from default on both) | reply `ok` | reply `ok` | | typed `openai/gpt-image-2` turn | refused pre-run `model_chat_unsupported` | sent; provider 404 | - **Cleanup:** 0 key hits in outputs and state, both Gateways exited and ports closed. The host Gateway was untouched. - `models list --provider X` already uses the `all` view (#142063). **Tests and gates.** - **New cases** are red on `84a378cf` and green here: - the gate table (shown / unlikely / declared no) and the provider prior; - visibility: default, `all` and configured views; - discovery → prepared snapshot → visibility → `resolveModelAsync`: the bare ID-pattern row passes the pre-run check, and the declared-no pin test still rejects; - the setup picker; - the OpenAI API-key catalog; - a Tencent ID-only listing; - an old-reader schema fixture; - the v3 reader keeping the marker. - **Consumer suites updated and green:** live-runtime, OpenCode Zen/Go, oMLX, Bifrost, LiteLLM, Anthropic discovery, Codex cyber-failover, utility model. - **Typecheck and lint:** `tsgo:core`, `tsgo:extensions`, `check:test-types`, oxlint and oxfmt are clean. - **Prefix stability:** `agent-tools.prefix-stability.test.ts` passes (14/14). - **Ratchets:** test lines +178 (allowance 400); line-cap passes. - **Builds:** `ocx build --dts` and `build:plugin-sdk:strict-smoke` pass on this head. - **`plugin-sdk:api:diff`:** one changed signature, `ModelInferenceCapabilitiesSchema` (optional `chatEvidence`), digest `47bba3f8`. - **Size:** production +96 / −40 in 10 files; no new module, state, cache or config. **Accepted edges (no code)** - The existing route-change overlay replaces a route-moved row's `inference` with `chat: false`, as it already does for any such row. - A future `chatEvidence` value would fail this build's schema, so a later state should use a new key. - Main or nightly state saved under #199998 keeps an ID-pattern row as `chat: false` until rediscovery. ## Merge danger - **Two-way door:** a revert restores #199998's behavior, and older builds read the marker as plain chat. No migration, config or protocol change. - **Blast radius if wrong:** listed non-chat models appear in `all` views. A typed ref to one gets the provider error instead of the pre-run refusal. <!-- openclaw-publication:8af8ed4a-ce4e-471b-9465-c401900ac501 --> Co-authored-by: Ayaan Zaidi <[email protected]>
… of being refused (openclaw#200102) ## What Problem This Solves Fixes: listed models are refused before any request when OpenClaw only *guesses* they are not chat models. Examples are an ID that names a non-text family, an OpenAI live/cyber/exp/alpha ID, or an unfamiliar kind value. Other guesses show a model that fails for the listing key, such as `gpt-5.6-cyber`. ## User Impact - Rows that **declare** non-chat support (native kind, output modality, catalog) are unchanged: hidden and refused before any request. - Rows that are only **unlikely** chat leave the default picker and setup choices but appear in "all" views. Typed and configured refs to them still run. - OpenAI default picker on a real listing: wrongly shown 1 → 0, wrongly hidden 3 → 3. Typed `openai/o3` replies while it is absent from the default list. - Tencent TokenHub: an uncatalogued, unlabeled listed ID (the openclaw#198288 TTS case) stays out of the default picker without hiding new chat models from typed refs. ## Why This Change Was Made openclaw#199998 made "no evidence" unknown, but kept an interim rule: an ID that names a non-text family got `chat: false`. This PR separates guesses from declarations: | state | encoding | default picker / setup | "all", typed, configured | pre-run guard | |---|---|---|---|---| | yes / unknown | no `inference`, or `chat: true` | shown | shown, runs | passes | | unlikely | `inference: { chat: true, chatEvidence: "unlikely" }` | hidden | shown, runs | passes | | declared no | `inference: { chat: false }` | hidden | hidden | refused (openclaw#184996) | - **Marker:** an optional `chatEvidence` key inside `inference`; `chat` is not widened. Old readers drop it and see plain chat: - the 2026.11.5 beta inference schema is a non-strict `z.object`; - released stable readers have no `inference` at all (v1/v2 bundles only); - the v3 hosted reader drops unknown `inference` keys. - The registry runtime model and the v3 row schema accept the key. - No wire, protocol, config or cache-scope change. `ModelChoice` is a closed protocol object, so there is no "unverified" badge. - **Weak evidence** applies only to uncatalogued rows without capability fields: - the ID-family pattern; - an unfamiliar value in a kind field the same listing uses for chat; - a provider prior, set with the new discovery option `unknownModelChatEvidence: "unlikely"`. - **Surfaces:** - The visibility owner (default picker, `models.list`, `/models`) treats unlikely like `deprecated`: listed only in `all`, configured and retained views. - The setup picker, oMLX and Bifrost offer likely chat only. - The guard still refuses only `chat === false`. - **OpenAI:** - `live|cyber|exp|alpha` IDs are demoted instead of dropped, and the `gpt-5.6-cyber` exception is removed. - `search` IDs stay dropped: Responses rejects them with a 400, dated snapshots too. - The pre-GPT-5 rule stays (openclaw#167462). - **Tencent:** opts into the prior. Its list has IDs and status only and includes speech models (openclaw#198288). - **Docs:** `model-catalogs.md` and `src/plugins/AGENTS.md` each state the rule once, citing openclaw#198288 and openclaw#199998. The OpenAI and Tencent provider pages are updated to match. - **Supersedes openclaw#199545:** the name-matched OpenAI IDs are demoted, not revealed, so their 404/500 IDs stay out of the default picker. ## Evidence **Replay of saved real listings, main `6851ad05` vs this head.** Same truth labels as openclaw#199998. | provider | listed | proven | default picker main / branch | wrongly shown / hidden, main | wrongly shown / hidden, branch | |---|---|---|---|---|---| | OpenAI (after account projection) | 125 | 31 | 37 / 36 | 1 / 3 | **0 / 3** | | HF router + OpenRouter | 600 | 600 | 600 / 600 | 0 / 0 | 0 / 0 | | Vercel AI Gateway | 508 | 508 | 323 / 323 | 0 / 0 | 0 / 0 | | DeepInfra | 178 | 178 | 92 / 92 | 0 / 0 | 0 / 0 | | Venice | 414 | 414 | 142 / 142 | 0 / 0 | 0 / 0 | | NVIDIA (no proof) | 39 | 0 | 29 / 29 | – | – | | Ollama library | 24 | 24 | 23 / 23 | 0 / 0 | 0 / 0 | | models.dev | 9,878 | 9,545 | 9,414 / 9,414 | 0 / 0 | 0 / 0 | - **OpenAI wrongly hidden (3):** `gpt-4o-mini` and `o3` fall under the pre-GPT-5 rule and run by typed ref. `gpt-5-search-api` is Chat-Completions-only. - **OpenAI rows refused pre-run:** 46 on main, 0 on this branch. 38 of the 46 are now unlikely; 8 hit the pre-GPT-5 drop. - **TokenHub:** its authenticated listing is uncaptured, so a fixture of that shape is tested instead. **Real Gateway (built dist, real OpenAI key).** - **Setup:** each side ran under `env -i` with only PATH, a temp HOME, TMPDIR, `OPENCLAW_STATE_DIR` and `OPENCLAW_CONFIG_PATH`. The key came through stdin only. - **Isolation:** loopback, its own port and token, no channels (the harness refuses one). Reads waited for a `ready` live listing. | | main | branch | |---|---|---| | OpenAI rows: default `models list` / `--all --provider openai` | 39 / 39 | 36 / 102 | | `gpt-5.6-cyber` default / all | shown / shown | absent / shown | | `gpt-image-2` default / all | absent / absent | absent / shown | | typed `openai/o3` turn (absent from default on both) | reply `ok` | reply `ok` | | typed `openai/gpt-image-2` turn | refused pre-run `model_chat_unsupported` | sent; provider 404 | - **Cleanup:** 0 key hits in outputs and state, both Gateways exited and ports closed. The host Gateway was untouched. - `models list --provider X` already uses the `all` view (openclaw#142063). **Tests and gates.** - **New cases** are red on `6851ad05` and green here: - the gate table (shown / unlikely / declared no) and the provider prior; - visibility: default, `all` and configured views; - discovery → prepared snapshot → visibility → `resolveModelAsync`: the bare ID-pattern row passes the pre-run check, and the declared-no pin test still rejects; - the setup picker; - the OpenAI API-key catalog; - a Tencent ID-only listing; - an old-reader schema fixture; - the v3 reader keeping the marker. - **Consumer suites updated and green:** live-runtime, OpenCode Zen/Go, oMLX, Bifrost, LiteLLM, Anthropic discovery, Codex cyber-failover, utility model. - **Typecheck and lint:** `tsgo:core`, `tsgo:extensions`, `check:test-types`, oxlint and oxfmt are clean. - **Prefix stability:** `agent-tools.prefix-stability.test.ts` passes (14/14). - **Ratchets:** test lines +178 (allowance 400); line-cap passes. - **Builds:** `ocx build --dts` and `build:plugin-sdk:strict-smoke` pass on this head. - **`plugin-sdk:api:diff`:** one changed signature, `ModelInferenceCapabilitiesSchema` (optional `chatEvidence`), digest `47bba3f8`. - **Size:** production +96 / −40 in 10 files; no new module, state, cache or config. **Accepted edges (no code)** - The existing route-change overlay replaces a route-moved row's `inference` with `chat: false`, as it already does for any such row. - A future `chatEvidence` value would fail this build's schema, so a later state should use a new key. - Main or nightly state saved under openclaw#199998 keeps an ID-pattern row as `chat: false` until rediscovery. ## Merge danger - **Two-way door:** a revert restores openclaw#199998's behavior, and older builds read the marker as plain chat. No migration, config or protocol change. - **Blast radius if wrong:** listed non-chat models appear in `all` views. A typed ref to one gets the provider error instead of the pre-run refusal. <!-- openclaw-publication:8af8ed4a-ce4e-471b-9465-c401900ac501 --> Co-authored-by: Ayaan Zaidi <[email protected]>
What Problem This Solves
Fixes: when you sign in to OpenAI with an API key, or to xAI or any provider that uses the shared live model listing, chat models the provider lists stay hidden from the model pickers until an OpenClaw release adds them.
User Impact
User impact: signed-in users see every chat model their provider lists, including models released after their OpenClaw version. Catalog rows still supply names, prices and context limits for models OpenClaw already knows. Embedding, image, video, audio, realtime, speech, transcription, moderation, legacy-completions and retired models stay hidden.
On the OpenAI API-key listing, pre-GPT-5 families (GPT-3.5, GPT-4, GPT-4o, GPT-4.1, o1, o3, o4, and fine-tunes of them) are now hidden from
models listand the pickers, including the 11 such rowsmainshows today. Ayaan chose this over changing the default runtime: these models fail on the default runtime, so listing them offers a choice that breaks on the first turn. GPT-5+ and IDs OpenClaw does not recognize keep appearing without a release.Existing setups keep working: a pre-GPT-5 model named as the default model, an
agents.defaults.modelskey, an allowlist entry or a session model override still resolves, with the same conservative metadata the listing used to give it. To use one, reference it and pin the OpenClaw runtime:Why This Change Was Made
Shared listing.
buildLiveModelProviderConfigwithoutprojectRowsused to keep only the static rows whose IDs were listed. It now runs listed rows through the existing shared chat classifier, the same one thatliveModelDiscoveryalready uses. Static rows describe matching IDs, and other chat IDs get conservative rows. The plugin'sreadModelIdselector still runs first (default:idonobject: "model"rows, as onmain): the ID it returns names the row, and a row it rejects stays out. Strict and advisory failure handling is unchanged: a failed listing keeps the fallback rows, and a successful empty listing stays empty. The direct consumer is the xAI API-key catalog. Third-party plugins that call this helper withoutprojectRowsget the same behavior;docs/plugins/sdk-provider-plugins/model-catalogs.mdnow describes this default and howreadModelIdrestricts it.Classifier. The classifier also excludes realtime, audio, bare
image/videoIDs and legacy completions models (babbage,davinci,gpt-3.5-turbo-instruct), plus rows whoseshutdown_datehas passed. On the real OpenAI listing, all 25 rows with a past shutdown date fail on/v1/responses(22 × 404, 3 × 400). Exclusions also apply to IDs in the static catalog.<modality>-text-to-textkinds (Hugging Face vision/audio chat models) stay admitted.OpenAI API key. The catalog now uses the same shared builder. This removes the GPT-4o/4.1/5+/o family allowlist and the broad deny list from fix(openai): show account chat models missing from the manifest for API-key users #162563. OpenClaw sends API-key turns through the Responses API, so narrow, named exclusions remain:
^(?:ft:)?(?:gpt-3\.5|gpt-4|o[134])): on the default runtime the Codex harness rejects every one of them with400 Invalid value: 'custom', and 13 of them (gpt-3.5, gpt-4, gpt-4-turbo, gpt-4.1-nano, o1, o3-mini and snapshots) also reject hosted web search on the OpenClaw runtime. The rule also applies to catalog rows; the OpenAI manifest has none of these families (onmainthey came only from fix(openai): show account chat models missing from the manifest for API-key users #162563's allowlist). Hiding only affects browsing: the OpenAI provider'sresolveDynamicModelhook, which core calls only for a specific selected ref, returns the same conservative row for these IDs, so config defaults, allowlist entries and session overrides still resolve.searchmodels: Chat Completions only, per the official model page. On our key,/v1/responsesreturned 400 "not supported with the Responses API".live,cyber, experiment (exp) andalphacodename IDs: our key lists them, but/v1/responsesreturns 404 or a persistent 500 for them.gpt-5.3-codex-spark) stay hidden, so the platform and ChatGPT routes stay separate.OpenAI IDs without a catalog row keep the existing conservative metadata from fix(openai): show account chat models missing from the manifest for API-key users #162563 (Responses, text input, 128k context, 16,384 max output, reasoning for GPT-5+ and o-series, unknown cost). The shared prefix template is not used for OpenAI: every OpenAI ID starts with
gpt-, so an unknown ID would inherit GPT-5 reasoning settings from an unrelated row.xAI. Multi-agent models stay hidden: they reject the client-side tools that every OpenClaw turn sends (documented xAI limitation).
Retained gates: Anthropic
acceptUnknownModel, OpenAI OAuth visibility, xAI OAuth backend eligibility, Google, Bedrock, Copilot, routed providers, replace mode and allowlists are unchanged.Evidence
Regression tests (each fails on
main, passes here):src/plugin-sdk/provider-catalog-live-runtime.test.ts: a listed unknown chat ID shows. Realtime, audio, image, video, legacy-completions and past-shutdown rows stay out, including a static ID with image-only output. A Hugging Faceimage-text-to-textrow stays. A failed listing keeps the static rows. The existing strict test still covers authoritative empty and failure.src/plugin-sdk/provider-catalog-live-runtime.test.ts(selector): a strict plugin whose selector readsslugkeeps staticmodel-a, admits an unknownfresh-chatslug, drops afresh-embeddingslug, and keeps out an ordinary{ id: "model-b", object: "model" }row the selector rejects. Onceaccc6it fails (received onlymodel-b); on this head it passes.extensions/openai/openai-api-key-catalog.test.ts: dated snapshots,gpt-5.3-codexand a futuregpt-6.2show with conservative metadata.gpt-4-0613,gpt-4.1-mini,o3and anft:gpt-4.1-mini:...fine-tune stay hidden, as do search, live, cyber, experiment, alpha, subscription-only, non-chat and retired IDs. Without the pre-GPT-5 rule the test fails (1 failed, 6 passed); with it, 7/7 pass. A listing with only non-chat IDs is authoritative-empty.extensions/xai/index.test.ts: an unknowngrok-5-previewshows. Multi-agent andgrok-imagine-*stay hidden.extensions/openai/openai-dynamic-model.test.ts: selectedgpt-4o,o3andft:gpt-4.1-mini:...refs resolve throughresolveDynamicModelwith the conservative listing row (reasoning only foro3). Without the hook change, all 3 fail; with it, the 3 OpenAI suites pass 84/84.Real OpenAI API key, isolated profiles (
pnpm openclaw --profile <p> models list --provider openai --all --refresh --plain; key read into process memory only):/v1/modelslisted 168 rows.main(6070074, this branch's base) shows 33, this branch shows 36. The 11mainrows that disappear are all pre-GPT-5: gpt-4.1, gpt-4.1-mini, gpt-4.1-nano, gpt-4o, gpt-4o-mini, o1, o1-pro, o3, o3-mini, o3-pro, o4-mini. The 14 new rows are dated GPT-5 snapshots andgpt-5.3-codex./v1/responsescall. Every row shown here returned 200, exceptgpt-daybreak-red-latest(a manifest rowmainalso shows; 404 for this key).gpt-3.5-turbo-instruct2, Sora 2, Whisper 1, Babbage 1, Davinci 1, past shutdown date 18 (the other 7 already fall under a family above), experiment 22, search 4, cyber 2, alpha 2, live 1, pre-GPT-5 31.Real turns through an isolated Gateway:
main:openai/gpt-4o-2024-11-20fails withUnknown model.*-prorows (onlyo1-pro, now hidden, was skipped for cost). All 35 shown rows other thangpt-daybreak-red-latestreply on the default (Codex) runtime.chat-latestandgpt-5.5-2026-04-23were re-run on897f27fand replyROW_OKwithagentHarnessId: "codex".gpt-daybreak-red-latestfails on both runtimes with "model not found" for this key;mainshows it too.Invalid value: 'custom'; all 29 are now hidden.main(6070074) vs this branch, one turn each, isolated profiles:agents.defaults.model.primary: "openai/gpt-4o"plus itsagentRuntime.id: "openclaw", nothing else:mainrepliesC1_OK. Before the hook change, the branch failed withUnknown model: openai/gpt-4o; on this head it repliesC1_OK(agentHarnessId: "openclaw").gpt-4ooverride set throughsessions.patch(modelOverride: "gpt-4o"), then a turn in that session:mainrepliesC2_OK. Before the hook change, the branch failed withUnknown model; on this head it repliesC2_OK(agentHarnessId: "openclaw").models.providers.openairow forgpt-4oas well, it repliesGPT4O_OKon897f27f.models list --provider openai --all --refresh --plainon this head still shows 36 rows, none of them pre-GPT-5./v1/responsescall too3-miniwithtools: [{ type: "web_search" }]returns 400 "Tool 'web_search_preview' is not supported with o3-mini."; the same call without the tool returns 200.docs/providers/openai/models.mdnow says these models needtools.web.search.providerset to a managed provider ortools.web.search.enabled: false(the two switchesresolveNativeWebSearchinextensions/openai/native-web-search-policy.tschecks, documented indocs/tools/web.md#native-openai-web-search).Shared default listing through a third-party plugin and a fake OpenAI-compatible server (the xAI API-key path uses the same builder; no xAI key was available):
main:models list --provider listing-fixture --all --refresh --plainshows onlyfixture-known, and a turn onfixture-chat-nextfails withUnknown model.fixture-knownandfixture-chat-next. Embedding, realtime, image and audio rows stay hidden. The turn repliesFIXTURE_OK from fixture-chat-next.Checks: On
f6e1266,node scripts/check-changed.mjspasses every lane except the dead-export scan, which fails only onsrc/talk/client-voice-session-store.ts: ClientVoiceToolEffect, a file this PR does not touch (same as on897f27f).pnpm exec oxlint --type-awareon the changed SDK files is clean. Focused tests onf6e1266: SDK live-runtime + strict 25/25, OpenAI API-key catalog + dynamic-model 44/44, xAI 47/47.Known gaps:
gpt-5.6would show with conservative metadata if listed, because the manifest has no row for it. The hosted-search restriction for gpt-3.5, gpt-4, gpt-4-turbo, gpt-4.1-nano, o1 and o3-mini is now documented and was checked with a rawo3-miniAPI call; a full OpenClaw turn on one of these models with web search off was not run. A selected pre-GPT-5 ref now resolves even when the key does not list it (mainreportedUnknown modelfor unlisted IDs), so such a turn fails at OpenAI instead of before the request.Merge danger: two-way door. There are no schema, config, stored-data or protocol changes, and a revert restores the old lists. Blast radius: model pickers and
models listfor signed-in OpenAI API-key users, xAI API-key users, and plugins that callbuildLiveModelProviderConfigwithoutprojectRows. The shared classifier's new exclusions also apply to everyliveModelDiscoveryprovider. Pre-GPT-5 OpenAI models drop out of the browse lists but still resolve when referenced; on the default runtime they fail as they do onmain. Worst case otherwise, a listed model that OpenClaw cannot drive shows up and fails on its first turn instead of being hidden.