Repository navigation
fix: hide non-chat models from chat selection - #198288
Conversation
Require declared text/chat capabilities or a matching catalog entry for chat discovery. Retain negative inference facts so saved pins produce an actionable error without changing the saved selection. Stop compaction retries on deterministic provider request failures and avoid treating service/model mismatches as missing models.
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
@clawsweeper review Please review the current head's shared capability projection, preservation of non-chat facts for saved pins, and deterministic compaction HTTP 400 retry behavior. The regression fails on the exact base and the focused candidate tests pass. Unclassified IDs intentionally require a catalog declaration or affirmative chat/text metadata. |
|
🦞👀 Re-review progress:
|
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c7a6f9a072
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
Codex review: needs maintainer review before merge. What this changesThis PR filters chat choices by declared capabilities, preserves unsupported saved selections with an actionable error, and stops deterministic compaction retries. Example: A session is pinned to bifrost/voice when discovery declares audio-only output.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep this maintainer-authored PR open: prior findings are resolved, no actionable correctness or security findings remain, and current-head CI is pending. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherProvider plugins supply model listings to shared catalog normalization; prepared snapshots carry capability facts into picker publication, model selection, and execution. flowchart TD
A[Provider listings] --> B[Shared capability projection]
B --> C[Prepared catalog snapshot]
C --> D[Chat picker]
C --> E[Saved model selection]
E --> F[Actionable unsupported error]
E --> G[Supported inference request]
Technical reviewBest possible solution: Land the shared capability and pin-preservation repair after the current-head CI gate is satisfied. Do we have a high-confidence way to reproduce the issue? Current-main source exposes the admission gap, and the supplied red/green regressions and Gateway replays establish the affected paths; this review ran no target code. Is this the best way to solve the issue? The patch uses existing catalog, selection, error, and retry owners, removes identity-keyed capture maps, and covers the distinct publication and reply boundaries without adding a competing subsystem. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against c19ae286a00c. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +118, Tests +388, Docs +15. Total +521 across 48 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 (3 earlier review cycles)
Reviewed November 13, 2026, 11:35 AM ET / 16:35 UTC (Revision 4). |
|
🦞👀 Re-review progress:
|
|
Merged via explicitly authorized admin squash with attributed pre-existing CI failures.
|
…nd refused as not chat (#198582) fix(litellm): list and run LiteLLM models that declare chat mode Since #198288 the model list only treats a model as chat when it declares chat support, but LiteLLM declares it as mode "chat", which the shared check did not read. So models list --provider litellm --refresh hid the proxy's chat models and agent --model litellm/<model> refused them with "This model doesn't support chat". LiteLLM model discovery now maps its own mode "chat" into the existing chat flag. Embedding models and models without a mode stay hidden as #198288 intends, and shared selection and allowlist rules are unchanged. No new text. Evidence: the built CLI in a secretless node:24.22.1 container against a real LiteLLM proxy (official image) with a mode chat model, an embedding model and a model without mode, upstream a local stand-in, main twice and candidate twice. On main the chat model was not listed and the turn failed with "doesn't support chat" with no request reaching the proxy. With this change the chat model is listed and the turn reaches the proxy and returns the fixture reply. The embedding and no-mode models stay hidden on both, and a built-in model the proxy serves is listed on both. Net -1 test lines. Details: #198582 (comment). Fixes #198581. Thanks @masatohoshino. Co-authored-by: Ayaan Zaidi <[email protected]>
* fix: hide non-chat models from chat selection Require declared text/chat capabilities or a matching catalog entry for chat discovery. Retain negative inference facts so saved pins produce an actionable error without changing the saved selection. Stop compaction retries on deterministic provider request failures and avoid treating service/model mismatches as missing models. * test: construct chat discovery fixtures directly * fix(models): preserve chat capabilities through setup and run admission * fix: deliver unsupported chat errors before channel runs * fix: exclude configured non-chat models at picker publication * test: avoid shadowing the catalog model fixture * test(ui): route Home proof through the real Gateway lane Register the Home reader proof with the existing prepared real-Gateway inventory and serial local owner. The ordinary parallel shard timed out twice while starting its unprepared Gateway. Preserve the timeout and all behavior assertions; extend the ownership guard to catch omitted real-Gateway fixtures. The missing registration came with openclaw#196902.
…nd refused as not chat (openclaw#198582) fix(litellm): list and run LiteLLM models that declare chat mode Since openclaw#198288 the model list only treats a model as chat when it declares chat support, but LiteLLM declares it as mode "chat", which the shared check did not read. So models list --provider litellm --refresh hid the proxy's chat models and agent --model litellm/<model> refused them with "This model doesn't support chat". LiteLLM model discovery now maps its own mode "chat" into the existing chat flag. Embedding models and models without a mode stay hidden as openclaw#198288 intends, and shared selection and allowlist rules are unchanged. No new text. Evidence: the built CLI in a secretless node:24.22.1 container against a real LiteLLM proxy (official image) with a mode chat model, an embedding model and a model without mode, upstream a local stand-in, main twice and candidate twice. On main the chat model was not listed and the turn failed with "doesn't support chat" with no request reaching the proxy. With this change the chat model is listed and the turn reaches the proxy and returns the fixture reply. The embedding and no-mode models stay hidden on both, and a built-in model the proxy serves is listed on both. Net -1 test lines. Details: openclaw#198582 (comment). Fixes openclaw#198581. Thanks @masatohoshino. Co-authored-by: Ayaan Zaidi <[email protected]>
Follow the resolver contract introduced by 2110db5 (#198288): unsupported chat preparation rejects with a typed FailoverError instead of returning an error result. Keep the credential and route isolation, positive preparation, and real completion assertions intact. The original test fails on both runtimes; the updated full file passes on the pinned Bun fork and Node with maxWorkers=1.
Follow the resolver contract introduced by 60fa014 (openclaw#198288): unsupported chat preparation rejects with a typed FailoverError instead of returning an error result. Keep the credential and route isolation, positive preparation, and real completion assertions intact. The original test fails on both runtimes; the updated full file passes on the pinned Bun fork and Node with maxWorkers=1.
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]>
…hat:false * fix(models): read provider model kinds at one owner; unknown is not chat: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]> * fix(models): read provider model kinds at one owner; unknown is not chat:false OpenClaw-Publication: b583c461-57f1-4932-a8d9-1ab3794de058 * fix(models): classify explicit non-chat kinds on their own 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]> * Publish openclaw/chat-capability-step1 OpenClaw-Publication: adde80a3-c327-43b4-86a9-35026a695cf9 * fix(models): ignore saved catalogs written under the unknown-is-false 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]> * Publish openclaw/chat-capability-step1 OpenClaw-Publication: 9690d624-6407-4e9e-aa3e-746a0a90a9c5 * revert(models): keep saved catalogs in the v1 cache scope 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]> * Publish openclaw/chat-capability-step1 OpenClaw-Publication: 3f0e5160-67d1-4c56-bc7a-5f51e798bcdb --------- Co-authored-by: obviyus <[email protected]>
) ## 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]>
…hat:false * fix(models): read provider model kinds at one owner; unknown is not chat: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 openclaw#198582 is removed; the shared translator yields the same rows. Co-authored-by: obviyus <[email protected]> * fix(models): read provider model kinds at one owner; unknown is not chat:false OpenClaw-Publication: b583c461-57f1-4932-a8d9-1ab3794de058 * fix(models): classify explicit non-chat kinds on their own 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]> * Publish openclaw/chat-capability-step1 OpenClaw-Publication: adde80a3-c327-43b4-86a9-35026a695cf9 * fix(models): ignore saved catalogs written under the unknown-is-false 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]> * Publish openclaw/chat-capability-step1 OpenClaw-Publication: 9690d624-6407-4e9e-aa3e-746a0a90a9c5 * revert(models): keep saved catalogs in the v1 cache scope 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 openclaw#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]> * Publish openclaw/chat-capability-step1 OpenClaw-Publication: 3f0e5160-67d1-4c56-bc7a-5f51e798bcdb --------- Co-authored-by: obviyus <[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]>
…ns start at once (#192534) ## What Problem This Solves Fixes: a Gateway using the Claude CLI runtime can push its host into memory exhaustion when several conversations start new Claude processes close together. On an 8 GB Linux VM without swap, several Slack/Teams turns arrived within about 3 minutes. The Gateway went from 3 to 7 warm Claude CLI processes, available memory fell from ~3.8 GB to ~250 MB and stayed there, and the VM thrashed (no OOM kill, CPU ~5%) until a reboot about 2 hours later. The only limit on warm processes was a fixed count of 16; idle warm processes were kept even while the host ran out of memory. ## User Impact User impact: when host memory is low, a new Claude CLI conversation first closes idle warm processes (least recently used first). If memory is still low and every warm process is busy, that turn fails over instead of starting another process, and a channel reply says: "⚠️ This host is low on memory, so it could not start another session. Try again after active conversations finish." (Before, any such failure would have shown the generic "AI service needs a short break" rate-limit copy.) Hosts with enough free memory behave as before; turns that reuse their own warm process are unaffected; busy turns are never closed. ## Why This Change Was Made Before a turn starts a new warm process, the live-session registry reads host free memory through the existing `readHostFreeMemoryBytes()` helper (`os.freemem()`, which is `MemAvailable` on Linux; `process.availableMemory()` on macOS). It walks the warm processes once in least-recently-used order: while memory is below 1 GiB, it closes each idle process and waits for it to exit before the next reading. If memory is still below the floor after that pass, the turn fails over with the `rate_limit` category the 16-session cap already uses, plus a distinct `cli_live_session_host_memory` code. The existing failover-code copy (`renderFailoverCodeUserCopy`) owns its user text, and the rate-limit reply renderer now returns a host-authored code's copy before generic rate-limit text (auth-profile cooldown keeps its expiry-aware copy). The registry map is now kept in least-recently-used order, so both the memory path and the existing count cap close the conversation that has waited longest. The 1 GiB floor comes from measurements of one warm session: | Measurement | RSS | | --- | --- | | Claude Code 2.1.314, Linux arm64 container, stream-json, idle after start | ~180 MiB | | Same, after one Haiku turn / three concurrent Sonnet turns | ~195–198 MiB each | | Full warm session under a Gateway (macOS): Claude Code + two Node supervisor helpers | ~490 MiB (264 + 138 + 87) | 1 GiB leaves room for about two more warm sessions before the kernel has to reclaim. The 16-session cap stays as the upper bound. No config key is added. ## Evidence - Two `executePluginOwnedProcess` tests (an entry point on both `main` and this branch), with host memory simulated at `readHostFreeMemoryBytes`: - Low memory, new conversation: the least recently used idle process closes; the busy one and the recently used one stay. On `main` this fails on behavior (`recent.close` not called). - Low memory, only a busy process: the turn rejects with `rate_limit` / `cli_live_session_host_memory` before the plugin runs, the busy process stays, and `resolveReplyFailureSummary` returns the host-memory copy. On `main` this fails on behavior (the turn runs: `reason: "exit"`). - `src/agents/cli-runner/`, `extensions/anthropic`, and the CLI attempt-execution tests: 1479 passed on the candidate; the registry and `execute-plugin` tests pass on the exact head (108). One failure, `extensions/anthropic/session-catalog.test.ts` ("reports the discovery frontier…"), also fails alone on this host and does not touch the changed files. - Real path on the previous head `a646b6b8` (the repair batch after it adds the failover code and copy and makes eviction one bounded pass; the tests above cover both): isolated Gateway (own state, config and Claude config dir, test API key from env only), `anthropic/claude-haiku-4-5` with `agentRuntime.id: "claude-cli"`, turns sent with `openclaw agent`. Memory pressure was simulated at the same seam the code reads (`os.freemem` / `process.availableMemory`), with each live Claude process under the Gateway counted as 700 MiB, so closing a process really raises the reading. - Real memory: 4 concurrent sessions start (`activeSessions=1…4`), no closures. - Low memory, new 5th session: `free-memory read: live claude processes=4 reported=424MiB` → `memory pressure: closing idle session activeSessions=4` → `processes=3 reported=1124MiB` → `cli live session start … activeSessions=4`; the turn replied. - Low memory, existing session: reused its warm process, no memory read, no closure; replied. - Low memory, all four warm sessions busy with long turns, new session: failed over in 54 ms (`Host memory is too low for another CLI live session.`); all four busy turns completed. ## Limits - Admission only. A warm process that grows during a long turn after it started is not limited here. - `readHostFreeMemoryBytes()` reads host memory on Linux, not a container cgroup limit; that helper is shared and unchanged. - Turns that start at the same instant can each read the same free-memory value before any process exists; the floor's headroom covers a small burst, and the 16-session cap still holds. - The failover category stays `rate_limit`, as the existing count cap uses; the distinct code carries the cause. - The live check ran on macOS with a simulated reading; the Linux numbers come from an isolated Claude Code container run. ## Merge danger Two-way door: a revert restores the previous behavior. No config, schema, stored state or published contract changes. Blast radius: Gateways using a CLI runtime with warm live sessions (today Claude CLI). If the floor is wrong for a host, the effect is more closed idle sessions (a cold start on the next turn) or a failover when memory is below 1 GiB and every warm session is busy. Other runtimes and channels are not affected. Co-authored-by: Ayaan Zaidi <[email protected]> (cherry picked from commit de07e00) Release adaptation: revalidate the existing current-run authority between awaited idle-process cleanup and before capability creation; use the abort-race lazy factory so an already-aborted request starts no close. Preserve baseline cleanup-finally repair. Add one execution-boundary regression for revoked requester authority; no unrelated follow-ups. # #192534 companion dispositions Signed baseline e13cf15; audit bd692e9. Working base 8b3ca5d lacks the memory floor and activation LRU refresh; 16-count limit exists. Mechanical probe: clean, six touched files. Exact merged source de07e00. Later same-path commits, each reviewed in saved relevant-followups.patch / other-followups.patch: - 30e9d3e #200073: not-applicable, listed model chat rejection code/copy independent of host memory. - 3a3eed8 #199591: not-applicable, tool loop policy refactor independent of memory admission. - 8fc58f8 #199226: not-applicable, app naming copy independent of memory. - 8ccba17 #198426: not-applicable to this admission change, warm callback async-context repair independent; do not silently absorb. Existing requestToolPermission is bound; no callback change required by memory. - 2110db5 #198288: not-applicable, model chat eligibility and code/copy independent. - 4527846 #198324: not-applicable, provider rate-limit reset deadlines; host-local memory refusal has no provider deadline. - 4f8df80 #198224: present-equivalent, baseline registry remove already uses finally and releases retired map after failed cleanup. - 8cd7d87 #197655: not-applicable, main test allocation pruning; retain this release allocation. - 5dc6683 #197163: present-equivalent, buildHarnessHostRequester used in baseline; separate tool hook metadata. - 7786960 #197051: not-applicable, managed WebSearch availability, independent tool policy. - ac7e941 #196677: not-applicable, expired API-key copy independent of host admission. - 4d6205c #194439: not-applicable, provider failure/tool warning handling independent of pre-execution host refusal. - 4845a0f #193508: not-applicable, native credential removal propagation; no new credentials accessed by memory policy. Existing live assertion retained/rechecked. - 6f69195 #193250: not-applicable, exhausted upstream credit failover category independent of local resource refusal. No later #192534 mentions. Prerequisites: readHostFreeMemoryBytes exists unchanged in baseline; @openclaw/retry abort race accepts lazy factory; createCliFailoverError preserves explicit code; FailoverError carries code; existing rate-limit reply renderer consumes it; registry closeRecord joins process exit and owned cleanup. These are present-equivalent. Neighbor tests: cli-live-session-registry.test.ts, execute-plugin.test.ts, execute-plugin.policy.test.ts, execute-plugin.steering.test.ts, failover/user-copy.test.ts are existing consumers, not missing implementation companions. execute-plugin.warm-context.test.ts exists only after the independent #198426 change and is not applicable to this baseline or memory fix. Run focused registry/execution/copy siblings. Selected-file references: broad generic filename inventory is mostly incidental error/execute references; traced actual owners/imports above. Docs and allocation are non-runtime references; no generated exports or workflow changes needed. Focused proof: baseline 2 failed/36 passed (LRU eviction missing; busy-only admission incorrectly exits successfully). Green 135 passed across five existing owner/consumer files, including host-memory failure copy and revoked-requester preservation. Format and diff checks clean. Type-aware lint blocked by the established shared TypeScript declaration-confinement boundary; no bypass/install. Parent owns integration and broad release qualification. Co-authored-by: RomneyDa <[email protected]> Parent qualification: corrected the authority regression's required braces and matching test allocation (102 lines); no production change from worker. Combined 145/145 tests across seven files passed; post-braces changed suite 39/39 passed. Supported parent type-aware lint and formatting passed six files, executable syntax and diff checks passed. Worker dependency-layout lint limitation resolved. Parent self-review and source/companion comparison recorded in cli-resources-parent-review.md. Full stable/FRV remains pending; publication held.
What Problem This Solves
Non-chat models could appear as chat choices, saved selections could fail with a misleading missing-model error, and deterministic provider HTTP 400 failures triggered three compaction attempts.
User Impact
Chat choices now exclude models without declared chat support. Existing selections stay saved and receive an instruction to pick another model, including through the pre-run channel reply path.
Why This Change Was Made
Shared discovery now requires declared chat/text support or an exact catalog declaration. Explicit audio-only or disabled-chat declarations win; unfamiliar ID-only rows remain hidden until support is declared. Negative facts use the existing route-bound
inference.chatcontract. Anthropic capability trees and oMLX model types are translated by their provider owners; Bifrost/oMLX setup selects only supported chat rows. Upstream snapshots and OpenAI projections preserve the result.Existing pins remain saved and receive “This model doesn't support chat; pick another model.” A public Gateway probe also exposed an execution handoff bug: adding prompt-project fields cloned the prepared snapshot and lost its WeakMap-keyed admitted catalogs. Captured facts now travel on the immutable snapshot, preserving the admission generation through both chat and compaction projections. The two identity-keyed catalog maps are removed.
Compaction uses its existing structured HTTP failure classifier and skips deterministic request retries. The missing-model matcher now distinguishes an absent model from an absent service ID mentioned in the same error. No provider/model is hardcoded; no new config, cache, manifest, or database schema is added.
Picker publication also excludes a configured non-chat row reintroduced by wildcard policy, after preserving capability metadata from the selected physical route. Two regressions reproduce those bypasses before the repair.
The current public models.dev feed has four text-output TokenHub models and no IndexTTS-2. The publisher already filters for text output. Tencent documents its authenticated model list as IDs/names/status without capability metadata; the actual authenticated incident listing was not captured. Filtering only explicit audio declarations would leave that ID-only gap open.
Evidence
777c036d592; the snapshot-projection regression also fails before its repair. Both pass with the fixes.models.listretains only declared text models; one turn against the saved audio pin returns the actionablemodel_chat_unsupportederror withretryable: false, zero provider POSTs and no compaction attempts. All data and credentials were synthetic.chat.sendreplay: one visible terminal error inchat.history, unchanged saved user pin, 298 ms runtime, zero provider POSTs and no compaction. The channel-boundary regression failed before the fix; all 46 reply tests pass afterward.check:changedcompleted with only the two inherited failures below; the final four-file publication check completed. It caught an import-shadow lint error in the new fixture; that test-only alias was corrected, formatted and linted successfully, with a fresh clean Codex review. The line-cap hook caught growth in the directive module; extracting its existing model-error handling resolved it, with focused tests, core typecheck and Codex review repeated.Production delta is +108 lines. The growth supplies generic capability classification, provider setup migration, pin-preserving errors and snapshot facts; it adds no competing discovery owner.
chatandfresh-chat. The speech turn produces exactly one visible actionable terminal error in 264 ms, zero provider POSTs and zero compaction attempts; the chat turn returnsreadythrough one provider POST. Native Doctor applied existing config/database migrations; this PR adds none. Doctor reported an unavailable whole-state recovery copy on the external-volume staging ancestor, while per-database migration backups were created. This is a synthetic compatibility proof, not certification of that host backup setup.Inherited Main Regressions
The SDK surface budget and unused
acquireConfiguredGatewayPostgresOwnerexport reproduce on exact base777c036d592808418f95da97cf6b4ee6af614bbc. The wildcard was introduced by #176886, the additional public entrypoint by #195641, and the PostgreSQL export by #196237. These remain failed checks.Final-head CI run 43462915679 tests merge
dd5d27878c14, with exact main parentc19ae286a00c. The catalog-reload assertion and all four Talk cancellation assertions reproduce on that parent with unchanged test and owner inputs. #197784 (76385fd77e3f) began persisting accepted catalogs, so the reload proof's old expectation of an image-less fallback fails in its same-route-account-switch scenario. #198100 (bf0b8002c2b9) introduced the append-only history guard that rejects the Talk follow-up. The Talk diagnostic identifieshistoryRewrite; the selected case passes on that introducing commit's parent, while testing the introducing commit itself timed out. These are main regressions requiring follow-up. The previously observed Goal wording mismatch was fixed by #198336 before this CI parent.The preceding-head run twice timed out in the Home reader browser test. #196902 added that real-Gateway fixture without registering it in the real-Gateway inventory, so it ran in an ordinary parallel UI shard with no prepared Gateway runtime. This PR repairs that test-routing defect with one inventory entry and extends the existing ownership guard to catch missing real-Gateway fixtures. The guard fails before the entry and passes after; Home passes in the corrected serial lane in 67.8 seconds. Its timeout and all assertions remain unchanged. The focused changed-file check passes all relevant type/lint/format/guard checks, retaining only the attributed PostgreSQL export failure. Fresh Codex review is scoped-clean.
ClawSweeper is ready with zero open items on final head
b67caf43bdfd(review updated 2026-11-13 16:36:51Z). Final CI run 43462915679 attempt 4 is complete: all 84 jobs are terminal. Security, build, UI, wrapper and cron checks pass; only the two attributed main assertion groups above and their aggregate remain red. The UI setup, wrapper-closure and cron timing failures each received one targeted retry after focused candidate/exact-main diagnosis, and each passed. Original failures remain recorded; no timeout or assertion was weakened. Landing uses the explicitly authorized inherited-failure exception, not a claim that CI is green.