Skip to content

fix(models): guessed non-chat models leave the default picker instead of being refused - #200102

Merged
obviyus merged 8 commits into
mainfrom
openclaw/chat-capability-step3
Nov 16, 2026
Merged

obviyus merged 8 commits into
mainfrom
openclaw/chat-capability-step3

Conversation

@obviyus

@obviyus obviyus commented Nov 16, 2026

Copy link
Copy Markdown
Collaborator

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 fix: hide non-chat models from chat selection #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:
  • Tencent: opts into the prior. Its list has IDs and status only and includes speech models (fix: hide non-chat models from chat selection #198288).
  • Docs: model-catalogs.md and src/plugins/AGENTS.md each state the rule once, citing fix: hide non-chat models from chat selection #198288 and fix(models): read provider model kinds at one owner; unknown is not chat:false #199998. The OpenAI and Tencent provider pages are updated to match.
  • Supersedes fix: keep unfamiliar OpenAI model names selectable #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

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)

Merge danger

obviyus and others added 2 commits November 16, 2026 17:04
`inference.chat: false` now means declared non-chat only: a native kind or
output modality, or the catalog. Those rows stay hidden and refused before
any request. Weak evidence, meaning an ID that names a non-text family, an
unfamiliar value in a field the listing uses for chat, or a provider prior,
adds `inference.chatEvidence: "unlikely"` with `chat` still true. Readers
that predate the key drop it (the inference object is non-strict) and treat
the row as chat.

Unlikely rows leave the default picker, `models.list`, `/models` and setup
choices (core setup picker, oMLX, Bifrost), and stay in `all` views. Typed,
configured, retained and fallback refs still run; the pre-run guard refuses
only `chat === false`.

- The interim ID-pattern `chat: false` from #199998 becomes unlikely.
- OpenAI: live/cyber/exp/alpha IDs are demoted rather than dropped, and the
  gpt-5.6-cyber exception is gone. Search IDs and the pre-GPT-5 rule stay.
- Tencent opts into the new `unknownModelChatEvidence: "unlikely"` discovery
  option, so its ID-only listing (#198288) cannot put a speech model in the
  default picker without hiding new chat models from typed refs.
- A live row's declared chat replaces a metadata guess in snapshot rows.

Co-authored-by: obviyus <[email protected]>
… of being refused

OpenClaw-Publication: 8af8ed4a-ce4e-471b-9465-c401900ac501
@clawsweeper

clawsweeper Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Nov 16, 2026
@clawsweeper

clawsweeper Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: stale review; fresh review needed.

Summary
The latest durable ClawSweeper review was for head c1be4231bbef0321d771669407a7ef54d4ce7899, but the PR head is now 61e77f10e13ded608c2bf71f7626e2d581ac646a. Its old verdict and PR readiness labels are no longer current.

Next step
Comment @clawsweeper re-review when the current head is ready; pushes after the first review are not reviewed automatically.

Review history (1 earlier review cycle)
  • reviewed 2026-11-16T12:58:12.987Z sha c1be423 :: needs changes before merge. :: [P2] Update the OpenAI unsupported-model fixture for the new classification

obviyus and others added 2 commits November 16, 2026 18:44
With only `text-embedding-3-small` listed, the ready outcome now publishes it
as unlikely chat (`chat: true, chatEvidence: "unlikely"`): it names an
embedding family but declares nothing, so a typed ref may still try it. The
case asserts what the picker offers, which stays empty; filter on both fields.

Co-authored-by: obviyus <[email protected]>
OpenClaw-Publication: ba8cf656-6273-4f8b-bdbe-6bd6acf781a3
@openclaw-barnacle openclaw-barnacle Bot reopened this Nov 16, 2026
obviyus and others added 2 commits November 16, 2026 19:10
…ity-step3

# Conflicts:
#	docs/plugins/sdk-provider-plugins/model-catalogs.md
OpenClaw-Publication: e23f6431-3695-4241-93bc-38a2b709aa86
@clawsweeper clawsweeper Bot removed the proof: sufficient ClawSweeper judged the real behavior proof convincing. label Nov 16, 2026
@clawsweeper clawsweeper Bot removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Nov 16, 2026
obviyus added a commit that referenced this pull request Nov 16, 2026
…00126)

## Problem

#200073 made the OpenAI API-key catalog put its listing (`modelIdCatalog`) on its ready outcome. `test/openai-model-discovery-auth-order.test.ts` still expected the old outcome shape. As a result, `main` fails `checks-node-changed-compact-small-20` in "continues from failed openai OAuth to profile API-key auth without repeating refresh". Open PRs that run this shard (for example #200102) inherit the failure.

## Solution

For the OpenAI case, the test now expects `modelIdCatalog: { baseUrl, modelIds: [modelId] }`. The xAI cases are unchanged. This is a test-only change.

## Evidence

- `pnpm test test/openai-model-discovery-auth-order.test.ts`: 17/17 pass. Before this change on `origin/main`, the OpenAI case failed with exactly this diff.
- oxfmt is clean.

<!-- openclaw-publication:f58bd5b3-ae10-8019-875f-27c86918b01c -->

Co-authored-by: Ayaan Zaidi <[email protected]>
obviyus and others added 2 commits November 16, 2026 19:57
@obviyus

obviyus commented Nov 16, 2026

Copy link
Copy Markdown
Collaborator Author

Maintainer override: Ayaan approved landing this PR with one unrelated red job.

  • Failing job: checks-node-changed-compact-large-20 (run 43886704519, job 133367963163). The two openclaw/ci-gate checks are red only because they wait on this job.
  • Test: src/agents/clawrouter-xai-responses.test.ts, 2 cases ("keeps native reasoning, tool results and usage through wrapSimpleCompletionStreamFn/wrapStreamFn with replay isolation"). The replayed xAI request still contains synthetic-encrypted-reasoning.
  • The same 2 cases fail locally on origin/main fcf29c46, without this PR. This PR changes no xAI, ClawRouter or replay code.
  • The local ClawSweeper review of head df842e5b is clean ("patch is correct", 0 findings). Every other required check is green.

@obviyus
obviyus merged commit f360b83 into main Nov 16, 2026
116 of 119 checks passed
@obviyus
obviyus deleted the openclaw/chat-capability-step3 branch November 16, 2026 14:49
@obviyus

obviyus commented Nov 16, 2026

Copy link
Copy Markdown
Collaborator Author

Landed as f360b83. Guessed non-chat models (name rules, or unlabeled Tencent rows) now carry inference.chatEvidence: "unlikely". They leave the default picker but stay in all, and they run when typed. Only models the provider declares as non-chat are still refused. Proof: the replay of saved listings brings OpenAI's wrong picks to 0 shown / 3 hidden, with no change for any other provider; a real Gateway turn ran a typed openai/o3; the local review of this exact head is clean. Supersedes #199545. Landed under the maintainer override above for one unrelated xAI test that also fails on main.

vincentkoc added a commit that referenced this pull request Nov 16, 2026
…tgres-compaction-watched-prompt-20261116

* commit '9e810f7101557b006d5ff223d955f14dc43329f0': (23 commits)
  chore(ui): refresh control ui locales (#200164)
  fix(update): stop reporting unset git config keys as failing checks (#200153)
  test: consolidate redundant coverage (198793, part 2) (#198936)
  revert: skills-used full-transcript scan on every chat history page (#200159)
  refactor(sessions): follow the chat by key for stored delivery references (#200099)
  fix(update): bridge 2026.11.5-beta.4 updaters (#200152)
  fix(gateway): avoid filesystem stalls during catalog refresh (#200136)
  fix(ci): match update refusal probe to selected candidate (#200043)
  fix(agents): keep read-only steering carriers when publishing suppressed user envelopes (#200156)
  test: consolidate suites while retaining recovery owners (#198933)
  test: consolidate redundant coverage (198789, part 2) (#198932)
  refactor(cli): consolidate camera command tests (#200144)
  fix(cli): avoid initializing provider runtime during cleanup (#200139)
  fix(ui): show mobile destinations without the drawer exit delay (#198879)
  chore(ui): refresh control ui locales (#200146)
  fix(knowledge): keep historical claims distinct and reject changed retries (#200140)
  fix(ui): align dropdown arrows on mobile New Session
  improve(sessions): archive inactive transcripts by default (#199899)
  refactor(agents): own background commands and yield waits by the chat (#200097)
  fix(models): guessed non-chat models leave the default picker instead of being refused (#200102)
  ...
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 17, 2026
…enclaw#200126)

## Problem

openclaw#200073 made the OpenAI API-key catalog put its listing (`modelIdCatalog`) on its ready outcome. `test/openai-model-discovery-auth-order.test.ts` still expected the old outcome shape. As a result, `main` fails `checks-node-changed-compact-small-20` in "continues from failed openai OAuth to profile API-key auth without repeating refresh". Open PRs that run this shard (for example openclaw#200102) inherit the failure.

## Solution

For the OpenAI case, the test now expects `modelIdCatalog: { baseUrl, modelIds: [modelId] }`. The xAI cases are unchanged. This is a test-only change.

## Evidence

- `pnpm test test/openai-model-discovery-auth-order.test.ts`: 17/17 pass. Before this change on `origin/main`, the OpenAI case failed with exactly this diff.
- oxfmt is clean.

<!-- openclaw-publication:f58bd5b3-ae10-8019-875f-27c86918b01c -->

Co-authored-by: Ayaan Zaidi <[email protected]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 17, 2026
… 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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling commands Command implementations docs Improvements or additions to documentation extensions: bifrost extensions: omlx extensions: openai extensions: opencode extensions: opencode-go extensions: tencent P2 Normal backlog priority with limited blast radius. size: M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant