Skip to content

fix: allow listed models with missing chat metadata - #199544

Closed
vincentkoc wants to merge 1 commit into
mainfrom
fix/catalog-chat-default-allow
Closed

vincentkoc wants to merge 1 commit into
mainfrom
fix/catalog-chat-default-allow

Conversation

@vincentkoc

@vincentkoc vincentkoc commented Nov 15, 2026 •

Copy link
Copy Markdown
Member

What Problem This Solves

Fixes: models returned by a provider are hidden from chat selection or rejected before a request when their catalog rows omit chat-capability metadata.

User Impact

New account-listed models work without waiting for a catalog update. Explicit negative capabilities, known non-chat families, provider-specific request-shaping gates, authentication, model policy and account entitlements remain enforced.

Why This Change Was Made

Treat missing metadata as unknown rather than chat: false in the shared live-row and upstream-metadata projections. Keep the rejection guard at execution and fix the metadata it consumes. Update affected catalog and OpenCode consumer tests, including explicit-negative and embedding controls.

This is the first of two small PRs. The separate OpenAI name-filter change in #199545 builds on this one; this PR does not change that provider's name policy.

Related: #198703 adds recognition of Together's explicit type: "chat"; this change addresses missing capability metadata instead and does not replace that contributor's work.

Evidence

  • The reviewed aggregate previously reproduced 17 failing regressions, including the actual model-resolution rejection, and passed 166 focused tests after repair.
  • Independent aggregate review passed; splitting preserves the reviewed source and tests byte-for-byte.
  • Local autoreview (Claude fallback; Codex executable unavailable), P0–P2, found no actionable findings in this split. The local diff-only reviewer did not inspect unchanged helper implementations; those were inspected in the independent aggregate review.
  • Targeted lint, formatting and typechecks passed on the same changed file contents.
  • Isolated first-split proof: 136 tests in seven files passed without the OpenAI patch (shared live/upstream/gate tests, model catalog/captured execution, OpenCode and Go). Command: node scripts/run-vitest.mjs src/plugin-sdk/provider-catalog-live-normalize.gate.test.ts src/plugin-sdk/provider-catalog-live-runtime.test.ts src/plugin-sdk/provider-catalog-live-upstream.test.ts src/agents/prepared-model-runtime.capture.test.ts src/agents/model-catalog.test.ts extensions/opencode/index.test.ts extensions/opencode-go/index.test.ts --maxWorkers=1. Checks ran under the shared heavy-build lock.
  • Base f0e04c2f13af7d503ee4e304c27d8449965f564c; head 19c09b60e08a9cdfb982687d3637c9c66f11ee7c. Commit content matches the reviewed local split.
  • Size: production +6/−2; tests +91/−20; docs +13/−13.

Full build, broad CI, live-provider requests and UI/channel end-to-end execution are not qualified. Draft for human review; no deployment or merge requested.

@clawsweeper

clawsweeper Bot commented Nov 15, 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.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation agents Agent runtime and tooling extensions: opencode extensions: opencode-go size: S labels Nov 15, 2026
@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment 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. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. 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-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Nov 15, 2026
@clawsweeper

clawsweeper Bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs changes before merge.

What this changes

Allow provider-listed models with missing chat metadata while retaining explicit capability denials and provider admission gates.

Example: OpenCode Go lists deepseek-flash without public capability metadata.

  • Before: Discovery marks the model as non-chat, hiding it and rejecting execution.
  • After: Discovery allows the model on Go's existing inference route.

Review scores

Measure Result What it means
Overall readiness 🧂 unranked krab (1/6) A useful, focused repair remains unready because an explicit non-chat kind becomes selectable and the changed user flow has only test evidence.
Proof confidence 🧂 unranked krab (1/6) Real behavior proof is not required for maintainer- or bot-authored pull requests.
Patch quality 🦪 silver shellfish (2/6) 1 actionable review finding remain.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Supported models returned by a provider disappear from chat selection or are rejected before inference when capability metadata is absent.
Reason: Earlier Go evidence establishes user value, the repair uses the existing shared owner, and maintainer authorship supplies the decision to relax the previous default.

Regression provenance

Possible regression — suspected (reviewed change). No predecessor PR is attributed.

Merge readiness

⛔ Needs changes before merge - 1 item remains

Keep this maintainer-authored PR open: it restores useful discovery behavior, but the permissive fallback also admits explicitly typed base-completion models as chat choices.

Priority: P2
Reviewed head: 19c09b60e08a9cdfb982687d3637c9c66f11ee7c

Before merge

  • Preserve explicit base-completion kinds before defaulting to chat (P2) - For Together's documented row {id:"meta-llama/Meta-Llama-3-8B", type:"language"}, readLiveModelChatCapability returns undefined: language matches neither the negative-kind pattern nor an affirmative declaration. The ID also misses NON_TEXT_MODEL_ID_PATTERN, so this new fallback changes the row from inference.chat=false to an allowed chat choice. Together uses shared discovery without another projection, so its explicitly typed base model is now published as chat, reversing the non-chat control documented in fix(providers): Together chat models are hidden from model lists and refused as not chat #198703. Classify that declared kind before applying the permissive default and add the concrete row as a regression control.

Findings

  • [P2] Preserve explicit base-completion kinds before defaulting to chat — src/plugin-sdk/provider-catalog-live-normalize.internal.ts:263-265

Tests

  • Low-value test src/plugin-sdk/provider-catalog-live-normalize.gate.test.ts: Remove the redundant name variants in the added table; they repeat the same unknown-ID branch already covered by unclassified, with explicit denials covered in the runtime suite.
  • Low-value test src/agents/prepared-model-runtime.capture.test.ts: Retain one admitted-resolution regression instead of five names that exercise identical discovery and resolution behavior.
  • Low-value test src/plugin-sdk/provider-catalog-live-upstream.test.ts: Consolidate the five helper-only name variants into one upstream missing-metadata case; none exercises a distinct branch.
  • Missing end-to-end proof: Show a metadata-free listed model becoming selectable and completing a real-model turn through an isolated Gateway, with explicit non-chat controls and a latest-stable upgrade preserving saved selections.
Agent review details

How this fits together

The shared provider-catalog normalizer turns account listings and upstream metadata into model rows consumed by pickers and agent execution.

flowchart LR
  A[Account model listing] --> C[Shared catalog normalizer]
  B[Upstream metadata] --> C
  C --> D[Prepared model catalog]
  D --> E[Model picker]
  D --> F[Agent model resolver]
  F --> G[Provider transport]
Loading

Technical review

Best possible solution:

Keep permissive discovery in the existing normalizer while preserving explicit base-completion exclusions before applying the unknown-metadata fallback.

Do we have a high-confidence way to reproduce the issue?

Current-main source assigns inference.chat=false to unfamiliar ID-only rows, and the committed resolver regression exercises the resulting rejection; this read-only review ran no target code.

Is this the best way to solve the issue?

Changing the two existing projections is appropriately small and preserves provider gates, but the parser must distinguish explicitly declared base-completion kinds from genuinely missing metadata.

Full review comments:

  • [P2] Preserve explicit base-completion kinds before defaulting to chat — src/plugin-sdk/provider-catalog-live-normalize.internal.ts:263-265
    For Together's documented row {id:"meta-llama/Meta-Llama-3-8B", type:"language"}, readLiveModelChatCapability returns undefined: language matches neither the negative-kind pattern nor an affirmative declaration. The ID also misses NON_TEXT_MODEL_ID_PATTERN, so this new fallback changes the row from inference.chat=false to an allowed chat choice. Together uses shared discovery without another projection, so its explicitly typed base model is now published as chat, reversing the non-chat control documented in fix(providers): Together chat models are hidden from model lists and refused as not chat #198703. Classify that declared kind before applying the permissive default and add the concrete row as a regression control.
    Confidence: 0.97

Overall correctness: patch is incorrect
Overall confidence: 0.94

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 932b13220bfd.

Provenance checked

  • Shared live-row classification, upstream projection and corresponding documentation changes intended behavior with a stated reason (2110db5: Require affirmative chat/text declarations to prevent non-chat selections while retaining actionable errors for saved pins.)
  • OpenCode listed-only model expectations keeps the original intent (fix(opencode-go): show every listed Go model and identify model-list requests #168286: Expose account-listed models before upstream metadata arrives, using the existing provider route; subsequent affirmative classification restricted those rows.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit 2110db5 adds src/plugin-sdk/provider-catalog-live-normalize.internal.ts:129 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 2110db5a1d1c; files: src/plugin-sdk/provider-catalog-live-normalize.internal.ts)
  • Ayaan Zaidi: Raw commit 6b3a4ec adds src/plugin-sdk/provider-catalog-live-normalize.internal.ts:135 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 6b3a4ec511e6; files: src/plugin-sdk/provider-catalog-live-normalize.internal.ts)
  • Jason (Json): Raw commit 55cf952 adds src/plugin-sdk/provider-catalog-live-normalize.internal.ts:99 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: medium; commits: 55cf9523e015; files: src/plugin-sdk/provider-catalog-live-normalize.internal.ts)

PR surface

Source +4, Tests +71, Docs 0. Total +75 across 9 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 1 6 2 +4
Tests 7 91 20 +71
Docs 1 13 13 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 9 110 35 +75

Preflight source

Source unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified.

Labels

Label changes:

No label changes.

Label justifications:

  • P2: The PR repairs model discovery and execution eligibility, with a concrete non-chat classification regression requiring a focused correction.
  • merge-risk: 🚨 compatibility: The documented public SDK discovery default changes for unfamiliar models; the maintainer-authored PR accepts that direction, while the explicit-kind defect is tracked separately.
  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🦪 silver shellfish.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

Rating scale

6/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.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

Reviewed November 15, 2026, 4:44 AM ET / 09:44 UTC.

@obviyus

obviyus commented Nov 16, 2026

Copy link
Copy Markdown
Collaborator

Thanks for digging into this. #199998 (merged as 84a378c) takes on the same problem from a different angle, so this PR now overlaps and likely conflicts.

What #199998 does

  • Unknown capability no longer stores as inference.chat: false, so bare account-listed models are shown and runnable. That covers this PR's goal.
  • Instead of falling back to the ID pattern, one translator in provider-catalog-live-normalize.internal.ts reads the capability fields providers already publish: type/task/model_type/pipeline_tag, LiteLLM mode, DeepInfra metadata.tags, Ollama capabilities, and output modalities.
  • Declared non-chat kinds (embedding, rerank, completion, audio, image) are refused even when output is text.

Why not the ID-pattern default: we replayed real public listings through both rules. Counts are models wrongly shown / wrongly hidden, counting only models whose capability we proved:

Provider Allow-unless-ID-matches (this PR) #199998
DeepInfra 57 / 0 0 / 0
Venice 34 / 0 0 / 0
Vercel 30 / 0 0 / 0

The ID pattern lets embeddings, rerankers and audio models through whenever their names don't match it. The providers already say what the models are, so reading those fields fixes both directions.

I'd suggest closing this in favor of #199998. If any provider you saw this on still hides a working model on current main, a sample of its listing would show what's missing.

@obviyus

obviyus commented Nov 16, 2026

Copy link
Copy Markdown
Collaborator

Thanks for this, Vincent. #199998 (merged as 84a378c) fixes the same problem in the shared reader. A provider-listed model with no capability metadata is now treated as unknown, not chat: false, so it shows in pickers and runs. #200073 (30e9d3e) adds a clear error for the cases where such a model then fails: "The provider lists this model but rejected a chat request". #200102 (f360b83) finishes the work. Closing this PR as superseded.

@obviyus obviyus closed this Nov 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling docs Improvements or additions to documentation extensions: opencode extensions: opencode-go merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P2 Normal backlog priority with limited blast radius. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. size: S status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants