Skip to content

fix(models): Gateway model picker keeps retired Qwen Token Plan models after discovery succeeds - #191609

Merged
obviyus merged 2 commits into
openclaw:mainfrom
jerome-queck:fix/models-list-retired-static-rows
Nov 3, 2026
Merged

obviyus merged 2 commits into
openclaw:mainfrom
jerome-queck:fix/models-list-retired-static-rows

Conversation

@jerome-queck

@jerome-queck jerome-queck commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #191360

What Problem This Solves

The default Gateway model picker re-adds static fallback models after account discovery has already published a ready inventory. For Qwen Token Plan, that produces ten rows when the account advertises five, while models list --all --refresh correctly returns five.

At the shared view owner, use the already-accepted discovery origins to stop merging those providers' fallback rows into the default view. Explicitly configured and retained selected rows remain listed. Providers without accepted discovery still get fallback rows, and eligible last-good inventories retain their existing origin scope.

Preserves @jerome-queck's original commit. Simplification avoids the map intermediate and allocates the provider Set only when a default view needs it. The regression shares the existing committed-row/configured/retained fixture with zero net test-line growth. No auth, discovery-acceptance, endpoint, public-type or storage implementation changes; manifest-status projection is a separate concern and unchanged.

Evidence

Built Linux Gateway/CLI captures and controls, exact candidate 54baa14a110982085d9c2a5898d610136b5999ab versus main 586f5766569997816efdf795eaaf535f552627a7:

  • Source-built Gateway and CLI, Node 24.22.1 secretless Docker, local HTTPS OpenAI-compatible Qwen fixture, task CA, verified synthetic authorization and isolated task-owned paths.
  • Ready five-model discovery: main default models.list and CLI gateway call return 10 rows, 2/2; candidate returns exactly five live rows, 2/2. Gateway all-view and offline CLI models list --all --refresh return five on both builds.
  • Manual declaration remains listed: candidate has five live models plus manual-only, 2/2. A previously selected glm-5 remains in its scoped configured view, 2/2 per build.
  • No accepted inventory yet: seven seeds on both. Same-origin last-good inventory after HTTP 503: candidate stays at five. Switching the task config to an unavailable documented CN origin does not reuse global-only inventory: seven seeds on both. All controls repeated twice per build.
  • Current Control UI helpers request configured view; that actual RPC feed stays at five on both builds. No UI rendering change or browser proof is claimed.
  • Focused suites 43/43, changed TypeScript lint clean; identical accepted-provider regression fails on main. Normalized and unrelated-provider cases remain covered.
  • Whole change: production +12/-2 (14 gross), tests net 0, docs +3.

Merge danger

Two-way door: revert restores the previous view membership; no migration or persisted-state rewrite. Blast radius is default model-catalog consumers after a provider has accepted discovery, including eligible last-good inventory. An incorrect identity check could hide useful fallback choices; explicit/manual and retained selections, unaccepted-provider fallback, and origin isolation are covered. The catalog/discovery/auth owners and request authority remain unchanged.

@clawsweeper

clawsweeper Bot commented Nov 3, 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 agents Agent runtime and tooling size: XS labels Nov 3, 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. proof: sufficient ClawSweeper judged the real behavior proof convincing. proof: 🎥 video Contributor real behavior proof includes video or recording evidence. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. 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 3, 2026
@clawsweeper

clawsweeper Bot commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

Stop default model lists from restoring static fallback rows after the provider’s account inventory has been accepted.

Example: Qwen Token Plan discovery accepts auto, deepseek-v4-pro, glm-5.3, qwen3.7-plus, and qwen3.8-max.

  • Before: Default Gateway models.list returns ten models, including five absent fallback models.
  • After: It returns the five discovered models while preserving separately configured models and scoped retained selections.

Review scores

Measure Result What it means
Overall readiness 🦞 diamond lobster (5/6) A focused contract repair with exact-candidate shipped-entry-point evidence, meaningful regression coverage, successful CI gates, and no open findings.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (live_output): Exact-head built Gateway models.list and CLI gateway call output in isolated Linux Docker show accepted five-model discovery replacing ten default rows; controls preserve manual declarations, scoped retained selections, pre-discovery fallback, eligible last-good inventory after HTTP 503, and endpoint isolation.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Default Gateway model lists offer retired models absent from successful account discovery, and selecting those models can fail.
Reason: The change restores the existing documented discovery-replacement contract and preserves the configured-selection behavior established by earlier catalog work.

Merge readiness

✅ Ready for maintainer review

This PR fixes a documented catalog-membership bug still present on current main; no actionable correctness or security findings remain.

Priority: P2
Reviewed head: 54baa14a110982085d9c2a5898d610136b5999ab

Before merge

None.

Findings

None.

Agent review details

How this fits together

The shared catalog view combines published discovery facts with configured and static rows before Gateway consumers apply visibility, availability, and account projections.

flowchart TD
  A[Provider discovery] --> B[Published catalog snapshot]
  C[Configuration and static rows] --> D[Shared catalog view]
  B --> D
  D --> E[Gateway visibility and account projection]
  E --> F[Model list consumers]
Loading

Technical review

Best possible solution:

Land the focused shared-view fix so accepted discovery controls automatic membership while explicit configuration and retained selections remain intact.

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

Current-main source shows the unconditional fallback reintroduction, and supplied built Gateway output demonstrates the same failure against a controlled HTTPS discovery endpoint; no target code was executed during this read-only review.

Is this the best way to solve the issue?

This is the smallest complete repair: consume accepted discovery membership at the existing view owner, preserve explicit rows, and leave discovery acceptance and request authority with their current owners.

AGENTS.md: found and applied where relevant.

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

Provenance checked

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

Likely related people:

  • Ayaan Zaidi: Raw commit 271554f adds src/agents/model-catalog-view.ts:156 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 271554fbb31a; files: src/agents/model-catalog-view.ts)
  • Vincent Koc: Raw commit b22785d adds src/agents/model-catalog-view.ts:124 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: medium; commits: b22785d9ac32; files: src/agents/model-catalog-view.ts)
  • Peter Steinberger: Raw commit f893093 adds src/agents/model-catalog-view.ts:256 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: medium; commits: f893093e2b49; files: src/agents/model-catalog-view.ts)

PR surface

Source +10, Tests 0, Docs +3. Total +13 across 3 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 1 12 2 +10
Tests 1 23 23 0
Docs 1 3 0 +3
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 3 38 25 +13

Review metrics

Metric Value Why it matters
Production versus test LOC Production +12/-2; tests +23/-23. The small membership change reuses existing discovery facts and extends the existing regression fixture without net test growth.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #191360
Summary: This PR owns the reported default-view fallback reintroduction; configured-model lifecycle presentation is separate work.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Labels

Label changes:

  • remove proof: 🎥 video: Current real behavior proof evidence kind is live_output.

Label justifications:

  • P2: Retired fallback choices produce incorrect model lists and failed selections, with working discovered models still available.
  • rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • proof: sufficient: Contributor real behavior proof is sufficient.

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.

History

Review history (1 earlier review cycle)
  • reviewed 2026-11-03T02:34:41.473Z sha cca10c3 :: needs maintainer review before merge. :: none

Reviewed November 2, 2026, 10:28 PM ET / November 3, 2026, 03:28 UTC (Revision 2).

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation size: S and removed size: XS labels Nov 3, 2026
@obviyus

obviyus commented Nov 3, 2026

Copy link
Copy Markdown
Collaborator

Built Gateway and CLI before/after proof

Exact candidate 54baa14, pinned main 586f576. Both were source-built and executed in secretless Node 24.22.1 Linux Docker, with independent task-owned config, state and workspace directories. Each exact binary printed its resolved config and SQLite database paths.

A local HTTPS OpenAI-compatible fixture stood in for the documented Qwen Token Plan global/CN endpoints. A task CA and supported managed CONNECT proxy kept TLS verification enabled and routed only those two hostnames to the fixture. Recorded /compatible-mode/v1/models requests verified synthetic authorization. No real provider key, account, inference request or operator state was used.

The primary accepted inventory was exactly:

auto
deepseek-v4-pro
glm-5.3
qwen3.7-plus
qwen3.8-max

The ordinary Gateway models.list call returned status ready on both builds, but main re-added five absent fallback IDs: glm-5, kimi-k2.5, MiniMax-M2.5, qwen3.6-plus, qwen3.8-flash. Candidate returned exactly the five live IDs.

Every row below was observed in two independent runs per build:

Surface/control                                      main #1 #2   candidate #1 #2
Gateway default models.list, accepted ready inventory    10 10          5 5
Built CLI gateway call models.list                      10 10          5 5
Gateway all view / CLI models list --all --refresh         5  5          5 5
No accepted inventory yet: manifest fallback              7  7          7 7
Eligible same-origin last-good inventory after HTTP 503  10 10          5 5
Configured catalog feed                                  5  5          5 5
Scoped retained selection                                6  6          6 6
Manual declaration: default view                        11 11          6 6
Manual declaration: CLI all view                         6  6          6 6
Changed endpoint, unavailable discovery: fallback         7  7          7 7

Controls and normal entry points

  • The CLI used real gateway call models.list --params '{"provider":"qwen-token-plan"}' --json, then, after stopping the owned Gateway, real models list --all --refresh --provider qwen-token-plan --json.
  • Manual model: an authored manual-only provider-model declaration remained listed although absent from discovery. Both builds reported it in unlistedConfiguredModelIds; candidate kept that row plus the five live rows.
  • Retained selection: the fixture briefly served glm-5 so a normal sessions.create/sessions.patch could select it. After discovery removed it, a scoped configured-view request still listed that selected model plus the five live rows. No database fixture insertion was used.
  • Last-good and origin scope: after accepting the five-model result, a same-origin HTTP 503 retained the eligible inventory. An ordinary CLI config change to the documented CN origin, whose discovery remained unavailable, did not reuse global live-only IDs: both builds returned only the seven manifest seeds. Production endpoint/auth/acceptance policy was not changed.
  • The current Control UI catalog helper defaults to configured view. Its configured RPC feed and retained-selection scope are included above. No UI rendering change or browser proof is claimed.

Focused checks and simplification

43/43 tests passed across the shared catalog view, runtime config-stamp and Gateway configured-static suites; changed TypeScript lint reported 0 warnings/errors. The identical accepted-provider CUSTOM case on main fails specifically because it returns live, retired, pinned instead of live. The consolidated matrix also covers no accepted provider, normalized provider identity, unrelated-provider discovery, explicit choices and committed metadata.

@jerome-queck's original commit is preserved. The provider Set no longer needs a map intermediate and is allocated only when default-view accepted origins require it. Whole PR: production +12/-2 (14 gross), tests +23/-23 (net 0), docs +3/-0. No auth, discovery-acceptance, endpoint, public-type or storage implementation changed.

@obviyus

obviyus commented Nov 3, 2026

Copy link
Copy Markdown
Collaborator

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@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. and removed proof: 🎥 video Contributor real behavior proof includes video or recording evidence. clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Nov 3, 2026
@obviyus
obviyus merged commit b57d02c into openclaw:main Nov 3, 2026
132 of 135 checks passed
@obviyus

obviyus commented Nov 3, 2026

Copy link
Copy Markdown
Collaborator

Landed in b57d02c. Thanks @jerome-queck. The model picker no longer shows retired fallback models after discovery.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 3, 2026
…s after discovery succeeds (openclaw#191609)

fix(models): don't add retired fallback models back after discovery succeeds

Fixes openclaw#191360.

After a provider's model discovery succeeded, the default Gateway model picker still added the retired static fallback models back, so the list showed models the account no longer offered. As documented, an accepted discovery result now replaces the seeds. Manually declared models and a selected retained model are kept, and the fallback list is still used while discovery is pending. Auth, discovery acceptance, endpoints, public types and storage are unchanged.

Evidence: built Gateway and CLI in secretless Node 24.22.1 Linux Docker with authenticated local HTTPS discovery returning five models. Main returned 10 default rows twice; with this change it returned exactly five twice, and the CLI all-view stayed at five. Manual-declaration, retained-selection, pending-discovery, same-origin last-good and cross-origin controls passed. Details: openclaw#191609 (comment).

Thanks @jerome-queck.

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 docs Improvements or additions to documentation P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. size: S status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Gateway pickers keep listing retired qwen-token-plan models after successful account discovery

2 participants