Repository navigation
fix(models): read provider model kinds at one owner; unknown is not chat:false - #199998
Conversation
…hat:false The shared live-listing translator now reads each provider's capability vocabulary: LiteLLM `mode`, DeepInfra `metadata.tags`, Venice/Together/ Vercel/models.dev `type`, oMLX/NVIDIA `model_type`, Hugging Face `pipeline_tag` and the Ollama `capabilities` list. `chat` and `text` kinds are affirmative; a declared non-chat kind beats text output, so embedding and reranking rows that list `text` output are no longer shown. A row with no evidence is unknown and treated as chat instead of being recorded as `inference.chat: false`; as an interim rule, an unknown ID that names a non-text family still gets `chat: false`. Within one listing, rows that carry a kind field holding another value than a chat kind used by other rows are not chat (Together `language`). The LiteLLM `mode` patch from #198582 is removed; the shared translator yields the same rows. Co-authored-by: obviyus <[email protected]>
…hat:false OpenClaw-Publication: b583c461-57f1-4932-a8d9-1ab3794de058
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Codex review: needs maintainer review before merge. What this changesThis PR centralizes provider model-kind parsing and stops recording missing capability metadata as an explicit chat denial. Example: OpenAI lists gpt-5-mini without chat-capability metadata.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Regression provenancePossible regression — suspected (reviewed change). No predecessor PR is attributed. Merge readiness✅ Ready for maintainer review Keep this maintainer-authored PR open: current main still has the discovery regression, and the shared repair has no blocking correctness or security findings. Priority: P1 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherThe shared catalog normalizer converts provider listings and upstream metadata into model rows consumed by pickers and agent admission. flowchart LR
A[Provider listings] --> C[Shared capability translator]
B[Upstream metadata] --> C
C --> D[Prepared model catalog]
D --> E[Model picker]
D --> F[Agent admission]
F --> G[Provider transport]
Technical reviewBest possible solution: Land the shared translator repair after required CI passes, preserving explicit denials and the documented restart tradeoff. Do we have a high-confidence way to reproduce the issue? Current-main source deterministically assigns chat:false to unfamiliar metadata-free rows, and the supplied Gateway replay records the resulting refusal; this read-only review ran no target code. Is this the best way to solve the issue? The smallest complete repair extends the existing capability owner, distinguishes unknown from denial in both projections, and removes the replaced LiteLLM adapter without adding state or configuration. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 7f234bd91294. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +28, Tests +97, Docs -3. Total +122 across 12 files. Added test files: 0. View PR surface stats
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. LabelsLabel changes: No label 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 (4 earlier review cycles)
Reviewed November 16, 2026, 3:45 AM ET / 08:45 UTC (Revision 5). |
LiteLLM `mode: "completion"` is now a declared non-chat kind, so a proxy listing only completion models no longer admits them as chat; the closed-world pass stays for unfamiliar values in a field the listing uses for chat. The model-catalog pin test cleared no live-row cache, so its audio-only case was served the previous case's bare listing; it now clears the cache, and the bare-row case asserts the new unknown contract. Cite the incident beside the Model Listing rule. Co-authored-by: obviyus <[email protected]>
OpenClaw-Publication: adde80a3-c327-43b4-86a9-35026a695cf9
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
… rule A Gateway built before this change saved listed models without capability metadata as `inference.chat: false` in the persisted plugin model catalog. After an upgrade, the startup catalog loaded those rows and the pre-run guard kept refusing session and config pins to them for the whole first run, even after discovery republished them without the veto; they recovered only on the next restart. Saved catalogs now use the `plugin-model-catalog-v2` cache scope, so this build starts from discovery instead of the stale rows. v1 rows stay for older builds after a downgrade, and backups keep sanitizing them. Co-authored-by: obviyus <[email protected]>
OpenClaw-Publication: 9690d624-6407-4e9e-aa3e-746a0a90a9c5
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
Reverts the plugin-model-catalog-v2 cache scope. Logout credential cleanup searched only the new scope, so retained v1 rows kept plaintext credentials, and every release user would cold-start after upgrading. No release saved the old unknown-is-false value; a main or nightly install that ran #198288 can see an affected pin refused until its first restart after upgrading, which self-heals. Name that accepted edge beside the pre-run fallback. Co-authored-by: obviyus <[email protected]>
OpenClaw-Publication: 3f0e5160-67d1-4c56-bc7a-5f51e798bcdb
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
) ## Problem #199998 made models that a provider lists without capability metadata visible and runnable. A listed model that is not a chat model, or is not enabled for the account, now fails at its first request instead of being hidden. Live probes on OpenAI and Google AI Studio show these failures return a 4xx in 0.3–1.0 s. About half of the bodies say the model "does not exist" (404), so OpenClaw reported "This model was not found". That is misleading for a model that the provider itself lists. Others ("not supported with the Responses API", "response modalities", "bidiGenerateContent", "not allowed to sample") ended as a raw request rejection or a sign-in error. ## Solution Both conditions below must hold: - The provider answers with a deterministic **400, 403 or 404** that contains one of these phrases: "model … does not exist", "not supported with the Responses API", "not supported for generateContent", "response modalities", "bidiGenerateContent" or "not allowed to sample". - The **successful listing made with the same credential** (same provider and auth profile) returned that model ID. The check reads the outcome's `listedModelIds` or `modelIdCatalog`. When both hold, the turn says: > The provider lists this model but rejected a chat request. It may not be a chat model, or it isn't enabled for this account. Choose another model. Code changes: - `live-model-errors.ts`: `isListedModelChatRejection(status, message)`. It sits next to the model-not-found matcher, so the classifier owner stays the same. - `failover/error.ts` + `user-copy.ts`: code `model_chat_rejected` and its copy. The code is rendered through the existing `renderFailoverCodeUserCopy` path, which every reply surface already uses for `model_chat_unsupported`. - `provider-catalog-outcome.ts`: `isModelInCredentialListing`, which uses the same credential rule as the account-entitlement check. - `assistant-failure.ts` + `failover-policy.ts`: the run produces a stateless `format` failure. This failure skips auth refresh, profile rotation, profile cooldown and session-model revert. It also skips the deterministic-format fallback stop, so a configured fallback runs next. Like the deterministic-400 handling from #198288, there is no retry and no compaction. - Catalog owners publish their listing: the OpenAI API-key catalog's ready outcome carries `modelIdCatalog`, as the shared OpenAI-compatible live catalog already does. The Google AI Studio catalog's ready outcome carries `listedModelIds`: every ID `models.list` returned, including the non-chat rows its projection hides. Before this, the Google catalog published no listing, so the Google rules could never apply. These cases stay on their current paths: 5xx, 429, 401/402, timeouts, any 200 (including empty output), and 404s for models that are not in the current listing (the real model-not-found case). ## Impact - Users see an honest reason and the next configured model runs. Nothing is persisted. - Side effect: OpenAI API-key users with configured OpenAI model IDs that their listing does not return now get the existing "unlisted configured model" advisory. Other live-listing providers already show it. - Accepted edge: a turn that is admitted before the first listing of the Gateway's life completes cannot prove listing membership. It keeps the current model-not-found copy. The next turn after discovery uses the new copy. - Not covered: failures produced inside a plugin-owned harness transport (prompt stage, for example Codex app-server requests). In the real run below, the listed model went through OpenClaw's own transport. ## Evidence **Regression tests (red on the merge base `84a378cfe2df`, green here).** `assistant-failure.listed-model.test.ts` replays sanitized live bodies through `projectProviderError` → `handleEmbeddedAssistantFailure` → `runWithModelFallback` → reply copy. Model IDs are synthetic, and request IDs and headers are removed. The positive bodies are an OpenAI Responses 404 and 400, an OpenAI Chat 403, and Google generateContent 404, modalities 400 and bidi 400. Each case uses its owner's listing shape: OpenAI `modelIdCatalog`, Google `listedModelIds`. - On base, all 6 copy cases fail: they show "This model was not found", "Couldn't sign in…" or "LLM request rejected: …". - On base, the two Google 400 cases also stop the fallback chain. - Negative fixtures pass on both: 500, 429, 401, an empty 200, and a 404 for a model missing from the listing. - A unit test checks that only 400/403/404 qualify, and never 200, 401, 402, 408, 429, 500 or 503. - `extensions/google/provider-registration.test.ts` runs the registered Google catalog against a `models.list` body with a chat row and an `embedContent`-only row. The picker gets only the chat row; the ready outcome lists both IDs under the selected auth profile. **Real Gateway turn.** I built both sides with `ocx build --dist`. Each Gateway ran isolated under `env -i` with only `PATH`, a temporary `HOME`, `TMPDIR`, `OPENCLAW_STATE_DIR` and `OPENAI_API_KEY`. Each used loopback only, its own port and token, and no channels. The harness refreshed the OpenAI listing through the Gateway, then ran one `openclaw agent` turn on a model that this key's `/v1/models` lists but cannot use. Public listed non-chat IDs such as `text-embedding-3-small` are still refused before the run. Google has no real-Gateway turn; its proof is the two tests above. | | Reply | Provider requests (`[model-fetch] start POST /v1/responses`) | Decision | |---|---|---|---| | merge base `84a378cfe2df` | `This model was not found. Choose another model in the OpenClaw app. \| model_not_found` | 1 (404) | `surface_error reason=model_not_found` | | this branch | `The provider lists this model but rejected a chat request. It may not be a chat model, or it isn't enabled for this account. \| model_chat_rejected` | 1 (404) | `surface_error reason=format`, no compaction | The real run used the copy before review added the trailing "Choose another model."; the regression test asserts the final copy. An exact-key scan of every Gateway log and state directory found 0 hits. All Gateways and ports were confirmed gone afterwards. **Checks.** Focused tests pass (agents failover, OpenAI catalog, Google registration and catalog). `pnpm tsgo:core`, `pnpm tsgo:extensions`, `pnpm check:test-types`, oxfmt, oxlint, the line-cap ratchet, the mock-exports ratchet and the test-lines ratchet pass. I left broad suites to CI. Co-authored-by: Ayaan Zaidi <[email protected]>
… 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]>
…claw#200073) ## Problem openclaw#199998 made models that a provider lists without capability metadata visible and runnable. A listed model that is not a chat model, or is not enabled for the account, now fails at its first request instead of being hidden. Live probes on OpenAI and Google AI Studio show these failures return a 4xx in 0.3–1.0 s. About half of the bodies say the model "does not exist" (404), so OpenClaw reported "This model was not found". That is misleading for a model that the provider itself lists. Others ("not supported with the Responses API", "response modalities", "bidiGenerateContent", "not allowed to sample") ended as a raw request rejection or a sign-in error. ## Solution Both conditions below must hold: - The provider answers with a deterministic **400, 403 or 404** that contains one of these phrases: "model … does not exist", "not supported with the Responses API", "not supported for generateContent", "response modalities", "bidiGenerateContent" or "not allowed to sample". - The **successful listing made with the same credential** (same provider and auth profile) returned that model ID. The check reads the outcome's `listedModelIds` or `modelIdCatalog`. When both hold, the turn says: > The provider lists this model but rejected a chat request. It may not be a chat model, or it isn't enabled for this account. Choose another model. Code changes: - `live-model-errors.ts`: `isListedModelChatRejection(status, message)`. It sits next to the model-not-found matcher, so the classifier owner stays the same. - `failover/error.ts` + `user-copy.ts`: code `model_chat_rejected` and its copy. The code is rendered through the existing `renderFailoverCodeUserCopy` path, which every reply surface already uses for `model_chat_unsupported`. - `provider-catalog-outcome.ts`: `isModelInCredentialListing`, which uses the same credential rule as the account-entitlement check. - `assistant-failure.ts` + `failover-policy.ts`: the run produces a stateless `format` failure. This failure skips auth refresh, profile rotation, profile cooldown and session-model revert. It also skips the deterministic-format fallback stop, so a configured fallback runs next. Like the deterministic-400 handling from openclaw#198288, there is no retry and no compaction. - Catalog owners publish their listing: the OpenAI API-key catalog's ready outcome carries `modelIdCatalog`, as the shared OpenAI-compatible live catalog already does. The Google AI Studio catalog's ready outcome carries `listedModelIds`: every ID `models.list` returned, including the non-chat rows its projection hides. Before this, the Google catalog published no listing, so the Google rules could never apply. These cases stay on their current paths: 5xx, 429, 401/402, timeouts, any 200 (including empty output), and 404s for models that are not in the current listing (the real model-not-found case). ## Impact - Users see an honest reason and the next configured model runs. Nothing is persisted. - Side effect: OpenAI API-key users with configured OpenAI model IDs that their listing does not return now get the existing "unlisted configured model" advisory. Other live-listing providers already show it. - Accepted edge: a turn that is admitted before the first listing of the Gateway's life completes cannot prove listing membership. It keeps the current model-not-found copy. The next turn after discovery uses the new copy. - Not covered: failures produced inside a plugin-owned harness transport (prompt stage, for example Codex app-server requests). In the real run below, the listed model went through OpenClaw's own transport. ## Evidence **Regression tests (red on the merge base `6851ad055e6e`, green here).** `assistant-failure.listed-model.test.ts` replays sanitized live bodies through `projectProviderError` → `handleEmbeddedAssistantFailure` → `runWithModelFallback` → reply copy. Model IDs are synthetic, and request IDs and headers are removed. The positive bodies are an OpenAI Responses 404 and 400, an OpenAI Chat 403, and Google generateContent 404, modalities 400 and bidi 400. Each case uses its owner's listing shape: OpenAI `modelIdCatalog`, Google `listedModelIds`. - On base, all 6 copy cases fail: they show "This model was not found", "Couldn't sign in…" or "LLM request rejected: …". - On base, the two Google 400 cases also stop the fallback chain. - Negative fixtures pass on both: 500, 429, 401, an empty 200, and a 404 for a model missing from the listing. - A unit test checks that only 400/403/404 qualify, and never 200, 401, 402, 408, 429, 500 or 503. - `extensions/google/provider-registration.test.ts` runs the registered Google catalog against a `models.list` body with a chat row and an `embedContent`-only row. The picker gets only the chat row; the ready outcome lists both IDs under the selected auth profile. **Real Gateway turn.** I built both sides with `ocx build --dist`. Each Gateway ran isolated under `env -i` with only `PATH`, a temporary `HOME`, `TMPDIR`, `OPENCLAW_STATE_DIR` and `OPENAI_API_KEY`. Each used loopback only, its own port and token, and no channels. The harness refreshed the OpenAI listing through the Gateway, then ran one `openclaw agent` turn on a model that this key's `/v1/models` lists but cannot use. Public listed non-chat IDs such as `text-embedding-3-small` are still refused before the run. Google has no real-Gateway turn; its proof is the two tests above. | | Reply | Provider requests (`[model-fetch] start POST /v1/responses`) | Decision | |---|---|---|---| | merge base `6851ad055e6e` | `This model was not found. Choose another model in the OpenClaw app. \| model_not_found` | 1 (404) | `surface_error reason=model_not_found` | | this branch | `The provider lists this model but rejected a chat request. It may not be a chat model, or it isn't enabled for this account. \| model_chat_rejected` | 1 (404) | `surface_error reason=format`, no compaction | The real run used the copy before review added the trailing "Choose another model."; the regression test asserts the final copy. An exact-key scan of every Gateway log and state directory found 0 hits. All Gateways and ports were confirmed gone afterwards. **Checks.** Focused tests pass (agents failover, OpenAI catalog, Google registration and catalog). `pnpm tsgo:core`, `pnpm tsgo:extensions`, `pnpm check:test-types`, oxfmt, oxlint, the line-cap ratchet, the mock-exports ratchet and the test-lines ratchet pass. I left broad suites to CI. 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]>
Problem
Since #198288, a listed model with no capability metadata is stored as
inference.chat: false, so it is hidden and refused before any request. But the shared translator (readLiveModelChatCapability) did not read most providers' capability fields:/v1/modelshas none, sogpt-5-mini,gpt-5-nano,gpt-5.3-codexand other listed, working models are refused with "This model doesn't support chat".mode, DeepInframetadata.tags, Venicetype: "text"and Togethertype: "chat"were ignored and patched per provider (fix(litellm): LiteLLM proxy chat models are hidden from model lists and refused as not chat #198582, fix(providers): Together chat models are hidden from model lists and refused as not chat #198703).type: "reranking"rows withtextoutput passed as chat.Change
provider-catalog-live-normalize.internal.ts. The translator readstype,task,model_type,pipeline_tag, LiteLLMmode, DeepInframetadata.tagsand Ollamacapabilities.chat,text,llm,vlm,text-generationand*-text-to-textare affirmative.completion.languageis neither (the review point on fix: allow listed models with missing chat metadata #199544).NON_TEXT_MODEL_ID_PATTERNstill getschat: false.languagenext tochat). Rows missing the field stay unknown.modepatch from fix(litellm): LiteLLM proxy chat models are hidden from model lists and refused as not chat #198582; the shared translator yields the same rows.src/plugins/AGENTS.md(with the incident citation) andmodel-catalogs.mdeach state the rule once.languagerows.Proof
Replay of saved real listings (merge base
4ff607aa61f3vs head; unchanged on this head)gpt-4o-mini,o3, and one entitlement-gated ID) and fromgpt-5-search-api, which works on Chat Completions only.mode, 0 differ from main with the fix(litellm): LiteLLM proxy chat models are hidden from model lists and refused as not chat #198582 patch.Tests
3edf4c06.model-catalog.test.ts: the audio-only pin case is unchanged. It had failed only because the test shared a cached listing between cases; the test now clears the cache. The bare-row case asserts the new unknown contract.ocx testpasses for plugin-model-catalog (read, write, auth), models-config write serialization,auth-logout, doctor catalog and credentials, snapshot/backup, prepared-model-runtime andmodel-catalog.test.ts. The Postgres lanes are skipped without a server.extensions/meta/muse-login.test.tsalso times out on the merge base.tsgo:core,check:test-types, oxlint and oxfmt are clean. The test-lines ratchet passes (+97).Upgrade proof (built dist, real OpenAI key)
env -i(PATH, temp HOME, TMPDIR,OPENCLAW_STATE_DIR; the key was passed only through stdin into the environment), on loopback with its own port and token, refusing to start if any channel was configured.openai/gpt-5-mini(primary plusagents.defaults.models); a session pin is set with/model openai/gpt-5-mini.2026.11.4and every beta through2026.11.5-beta.4predate fix: hide non-chat models from chat selection #198288, and2026.11.4savesgpt-5-miniwithoutchat:false. Only main and nightly installs that ran fix: hide non-chat models from chat selection #198288 have it.These phases were run on
cec46be8, which has the same code as this head:models list --all --provider openai4ff607aa(old rule)gpt-5-miniabsent; saved catalog holdsgpt-5-miniwithchat:falsemodel_chat_unsupportedgpt-5-minilistedgpt-5-minilisted immediatelyokfromgpt-5-miniembedded-agent-runner/model.ts.model_chat_unsupported).2026.11.4on main-written state refuses to start with a clear schema message (schema 40 from main; this diff has no schema change), with no crash.Known gap (pre-existing, follow-up)
A turn within about 10 s of Gateway start can get "Unknown model" for a live-only model, because the run-time registry lags the prepared catalog. This will be fixed separately.