Skip to content

fix(ui): discover models when default-model pickers open - #142105

Merged
obviyus merged 6 commits into
openclaw:mainfrom
xiaoguomeiyitian:fix/models-picker-catalog-loading
Sep 8, 2026
Merged

obviyus merged 6 commits into
openclaw:mainfrom
xiaoguomeiyitian:fix/models-picker-catalog-loading

Conversation

@xiaoguomeiyitian

@xiaoguomeiyitian xiaoguomeiyitian commented Sep 8, 2026 •

Copy link
Copy Markdown
Contributor

Closes #141813.

What Problem This Solves

Fixes an issue where users opening a default-model picker on the Models page saw only the prepared choices, with no indication that more models could be discovered.

Why This Change Was Made

All three pickers use the existing shared catalog discovery owner and show accessible progress. Discovery now retires its page subscription when core data, route, agent, or connection ownership changes. Success clears the catalog error while preserving unrelated errors and saved choices; a rejected request offers Retry.

The discovery and page-shell extraction keeps the page controller within its existing size limit. The contributor's three commits are preserved, including the latest test corrections; current rendered-control tests cover the same fixes against the current picker implementation.

User Impact

Owners can discover and select additional models without blocking initial navigation or losing their primary, utility, and fallback selections. Older picker replies cannot overwrite newer page data. Provider-level unavailable results keep their existing behavior.

Evidence

  • Real Gateway, Control UI, browser, and deterministic local model provider: pinned main 451a568c2e75 showed three prepared choices and no picker discovery request. The corrected source showed expanded choices with the saved selection intact.
  • Original candidate: a delayed old response replaced six newer choices with five; successful discovery also left an earlier catalog error visible. Both corrected paths passed ordered browser checks.
  • Independent browser acceptance covered all three picker entrypoints, shared requests, accessible progress, enabled choices, actual Retry, error isolation, saved IDs, and core-refresh/agent/reconnect races.
  • 146 focused tests passed across eight page, view, profile, load, catalog-store, model-picker, and select-picker files. Targeted formatting, lint, size/assertion checks, translation verification, and UI build passed. Full typechecks and broad checks run in hosted CI.
  • The signed build at 657c878ade54 passed a final real-browser expansion and saved-selection check. The contributor reconciliation preserved that tested source tree. A subsequent type-only ownership correction removes a static import cycle without changing runtime behavior.
Before: prepared choices only After: discovered choices, saved selection retained
Models picker before discovery repair Models picker after discovery repair

Image links are verified and expire on September 15, 2026.

Thanks @xiaoguomeiyitian for the original implementation. AI-assisted repair and verification.

openclaw#141813)

The Models page picker opened with only the prepared (configured) models and
gave no signal that a fuller catalog was loading, so operators could mistake
the initial choices for the complete model list. Discovery only happened as a
side effect of a config mutation.

Trigger demand-driven discovery through the shared catalog store when any
default-model picker opens, and surface accessible progress/retry feedback
without touching the saved selection. Initial navigation keeps the fast
prepared snapshot (full discovery stays out of the initial page load).
@clawsweeper

clawsweeper Bot commented Sep 8, 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 P2 Normal backlog priority with limited blast radius. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Sep 8, 2026
@clawsweeper

clawsweeper Bot commented Sep 8, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 8, 2026, 11:38 AM ET / 15:38 UTC.

ClawSweeper review

What this changes

The Models settings page discovers additional models when any default-model picker opens, displays progress and retry feedback, and preserves saved selections while retiring outdated requests.

Merge readiness

✅ Ready for maintainer review

This remains a useful fix absent from current main. Earlier correctness findings are resolved, and the restored before/after captures satisfy the previous proof request. No blocking defect was found.

Priority: P2
Reviewed head: b501585a4f346132a6bde063b2e0fc42e721a311

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused repair with inspectable visual proof, meaningful lifecycle coverage, and no remaining actionable finding.
Proof confidence 🐚 platinum hermit (4/6) ✨ media proof bonus Sufficient (screenshot): The reported real Gateway/browser run exercises Models-page discovery, and inspected before/after captures show three choices expanding to five with the saved selection retained. Source comparisons preserve that tested runtime behavior through the reviewed head, resolving the earlier inaccessible-proof blocker.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (screenshot): The reported real Gateway/browser run exercises Models-page discovery, and inspected before/after captures show three choices expanding to five with the saved selection retained. Source comparisons preserve that tested runtime behavior through the reviewed head, resolving the earlier inaccessible-proof blocker.
Evidence reviewed 8 items Current main still lacks picker-triggered discovery: The fetched main revision still supplies no onOpen callback to the three default-model pickers; its initial page loader requests preparedOnly. The existing shared discovery capability therefore does not already solve this page’s interaction.
Latest release also lacks the callback: The supplied latest release, v2026.9.3, contains the three picker render calls without onOpen wiring.
Earlier correctness findings resolved: Discovery checks request identity, Gateway epoch, agent identity, and agent epoch before publishing. Core refresh, route adoption, and connection/agent resets retire its subscription. Successful discovery clears catalogError while retaining configuration and unrelated errors. Rendered-control tests cover replacement ordering, retry, preserved choices, and shared subscribers.
Findings None None.
Security None None.

How this fits together

The Control UI’s Models page combines saved configuration with the Gateway’s model catalog. Picker-triggered discovery uses the shared catalog store to expand available choices without changing saved defaults.

flowchart TD
  A[Saved configuration] --> B[Models settings page]
  C[Prepared catalog] --> B
  B --> D[Default picker opens]
  D --> E[Shared catalog discovery]
  E --> F{Request still current?}
  F -->|Yes| G[Updated choices or retry feedback]
  F -->|No| H[Discard retired result]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source +217, Tests +415. Total +632 across 11 files.

View PR surface stats
Area Files Added Removed Net
Source 7 268 51 +217
Tests 4 419 4 +415
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 11 687 55 +632

Review metrics

Metric Value Why it matters
Production and regression coverage Production net +217 lines; tests and support net +415 lines Production growth implements demand-driven discovery and extracts the page shell; coverage exercises rendered controls and ordered stale responses.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #141813
Summary: This PR implements the linked issue’s picker-discovery repair; the issue should remain open until its fix lands.

Members:

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

Technical review

Best possible solution:

Retain fast initial catalog loading and use the existing shared discovery flow on picker open, with visible recovery and saved selections preserved.

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

Yes, from source: open a Models-page picker after a prepared-only load on current main; no discovery callback runs. Supplied before/after browser evidence corroborates the symptom, but this review executed no runtime tests.

Is this the best way to solve the issue?

Yes. Wiring the existing picker-open callback to the shared catalog owner preserves the intentional fast-load contract and avoids a second discovery mechanism.

AGENTS.md: found and applied where relevant.

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

Labels

Label justifications:

  • P2: Incomplete model choices cause bounded settings-page confusion while existing selections and manual refresh remain usable.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (screenshot): The reported real Gateway/browser run exercises Models-page discovery, and inspected before/after captures show three choices expanding to five with the saved selection retained. Source comparisons preserve that tested runtime behavior through the reviewed head, resolving the earlier inaccessible-proof blocker.
  • proof: sufficient: Contributor real behavior proof is sufficient. The reported real Gateway/browser run exercises Models-page discovery, and inspected before/after captures show three choices expanding to five with the saved selection retained. Source comparisons preserve that tested runtime behavior through the reviewed head, resolving the earlier inaccessible-proof blocker.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence. The reported real Gateway/browser run exercises Models-page discovery, and inspected before/after captures show three choices expanding to five with the saved selection retained. Source comparisons preserve that tested runtime behavior through the reviewed head, resolving the earlier inaccessible-proof blocker.

Evidence

What I checked:

  • Current main still lacks picker-triggered discovery: The fetched main revision still supplies no onOpen callback to the three default-model pickers; its initial page loader requests preparedOnly. The existing shared discovery capability therefore does not already solve this page’s interaction. (ui/src/pages/model-providers/default-models-view.ts:147, 37dbd0aac655)
  • Latest release also lacks the callback: The supplied latest release, v2026.9.3, contains the three picker render calls without onOpen wiring. (ui/src/pages/model-providers/default-models-view.ts:146, 1391f7cd2d40)
  • Earlier correctness findings resolved: Discovery checks request identity, Gateway epoch, agent identity, and agent epoch before publishing. Core refresh, route adoption, and connection/agent resets retire its subscription. Successful discovery clears catalogError while retaining configuration and unrelated errors. Rendered-control tests cover replacement ordering, retry, preserved choices, and shared subscribers. (ui/src/pages/model-providers/catalog-discovery.ts:82, b501585a4f34)
  • Restored visual proof inspected: Inspected both prepared local images from the media manifest. The before capture shows three prepared choices; the after capture shows two additional discovered choices while prepared-primary remains selected. The captured PR body identifies a real Gateway, browser, Control UI, and deterministic local provider, and separately reports ordered retry and lifecycle checks. The images directly establish expansion and selection preservation, not every reported race scenario.
  • Proof continuity through the reviewed head: GitHub’s comparison from the reported tested commit 657c878 to c6d4bfb returns no changed files. The subsequent comparison to the reviewed head contains only relocation of an unchanged type and its type-only imports. The captured body is retained as evidence under sourceRevision e4742e9b7e4c0701d79e1a436212236b08711bce74742526f3f1847a660cb026. (ui/src/pages/model-providers/config-mutation.ts:5, b501585a4f34)
  • Existing catalog and selection contracts preserved: The shared store already owns refresh cooldown, concurrent subscribers, and cancellation. Initial-load coverage explicitly keeps discovery out of navigation. This patch reuses those mechanisms without adding settings, changing stored defaults, introducing a plugin API, or depending on the Codex runtime contract. (ui/src/lib/model-catalog-store.ts:40, b501585a4f34)

Likely related people:

  • Peter Steinberger: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Patrick Erichsen: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • obviyus: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (4 earlier review cycles)
  • reviewed 2026-09-08T10:18:08.129Z sha d99de30 :: needs real behavior proof before merge. :: [P2] Fence picker results against newer core refreshes | [P2] Clear the existing catalog error after successful discovery
  • reviewed 2026-09-08T13:24:13.049Z sha 2db17fe :: needs real behavior proof before merge. :: [P2] Fence picker results against newer core refreshes | [P2] Clear the existing catalog error after successful discovery | [P2] Update the test element type for the extracted controller
  • reviewed 2026-09-08T14:51:36.752Z sha de862f1 :: needs real behavior proof before merge. :: [P2] Fence picker results against newer core refreshes | [P2] Clear the existing catalog error after successful discovery
  • reviewed 2026-09-08T15:05:26.226Z sha c6d4bfb :: needs real behavior proof before merge. :: none

…e page controller

The max-lines budget (700) was already at the limit on main; inline discovery
logic and the page-shell template pushed model-providers-page.ts over it and
broke check-lint-core-4. Move picker catalog discovery into a dedicated
catalog-discovery.ts controller (same options-object pattern as the
supplemental loader) and the page header/agent-scope/workspace shell into
view.ts's renderModelProvidersPageShell. Behavior is unchanged; tests drive the
controller API instead of private page methods.
@obviyus obviyus self-assigned this Sep 8, 2026
xiaoguomeiyitian and others added 3 commits September 8, 2026 22:45
CI caught three issues on the previous head that local runs could not
reproduce: the model-providers page test-support type still declared the
removed catalogDiscovering/catalogDiscoveryError/discoverPickerCatalog
members, the view test's text() helper rejected undefined, and the two
new picker tests queried wa-select by tag name, which is unreliable in
the non-isolated CI shard once other suites register the custom element.

- ModelProvidersPageTestElement now exposes the catalogDiscovery
  controller.
- text() accepts Element | null | undefined.
- Picker tests match the stable .picker-select class (the class on
  wa-select) and wrap the count assertion in vi.waitFor.
- catalog-discovery options collapse getAgentId/getAgentEpoch into one
  getScope callback, keeping the page under the max-lines budget
  (oxlint's effective-line count).
Retire picker subscriptions when core data, agent, or connection ownership changes. Clear only the recovered catalog error and preserve saved selections and unrelated provider errors.

Keep the contributor's demand-driven discovery and page extraction. Cover ordered stale replies, recovery, shared subscribers, and all three picker entrypoints through rendered controls.
Preserve the contributor's latest commit alongside the verified discovery repair. The current rendered-control tests replace its obsolete picker tests and private controller test surface, and the equivalent line-budget changes are already covered by the focused checks.
@obviyus obviyus changed the title fix(ui/models): discover catalog on picker open with progress feedback (#141813) fix(ui): discover models when default-model pickers open Sep 8, 2026
@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. labels Sep 8, 2026
Move the unchanged message type out of the rendering view and update its type-only consumers. This removes the static import cycle introduced by profile toast extraction without changing emitted runtime behavior.
@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Sep 8, 2026
@obviyus
obviyus merged commit 6e1aba4 into openclaw:main Sep 8, 2026
174 of 176 checks passed
@obviyus

obviyus commented Sep 8, 2026

Copy link
Copy Markdown
Collaborator

Thanks @xiaoguomeiyitian!

Proof: Real Models-page browser and Gateway checks verified discovery, accessible progress, actual Retry recovery, preserved defaults, and stale-response handling. Independent review passed, and exact-head CI completed successfully.

  • Bug: Opening a default-model picker showed only prepared choices. Older discovery replies could also overwrite newer data or leave a recovered catalog error visible.
  • Fix: All three pickers use shared discovery with page-owned cancellation and isolated error recovery. Saved selections remain intact.
Before After
Three prepared choices, with no discovery request on open Additional discovered choices appear while the saved selection stays selected
Older replies could replace newer choices Retired replies cannot publish into the newer page state

Merged as 6e1aba41cc2b55275bd2f0998f6c660acd70be4b. Contributor credit is preserved. AI-assisted repair and verification.

vincentkoc added a commit that referenced this pull request Sep 8, 2026
* commit '04869ae4899ad0524c3287759798362b0d62fef8': (677 commits)
  fix(release): pin Kova census refresh (#142104)
  fix: doctor read-only database inspections time out on large agent databases (#142179)
  docs: align v2026.9.3 framing with release announcement (#142307)
  fix(ui): discover models when default-model pickers open (#142105)
  fix(ci): keep Docker upgrade seed baseline older than target (#142273)
  refactor(tests): reuse named OAuth credential fixtures (#142272)
  fix(ci): keep mobile release helpers out of source checks (#142115)
  chore(ui): refresh control ui locales (#142147)
  fix(active-memory): explain why recall was skipped (#138658)
  fix(media): preserve converted images with HEIC filenames (#142263)
  docs: add v2026.9.3 release notes (#142277)
  fix(ui): retire picker focus listeners together (#142258)
  fix(ui): keep menu hover colors consistent across themes (#142243)
  fix(release): keep changelog credits within verified history (#142261)
  fix: keep tool-finalizer placeholders private in message-only groups (#138645)
  perf(tui): carry prepared URL membership through rendering (#142262)
  test(ui): await activity cache imports before teardown (#142282)
  fix(qa): align auth and Workshop proofs with runtime contracts (#142280)
  feat(xai): use one curated catalog and concrete setup default (#142136)
  refactor(outbound): reuse prepared sendability facts (#142252)
  ...
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 9, 2026
…2105)

Restore demand-driven discovery in the Models page's primary, utility, and fallback pickers. Preserve prepared choices and saved defaults, retire stale page subscriptions, and clear recovered catalog errors without hiding unrelated provider errors.

Keep the shared mutation-message type with its producer to avoid a static import cycle. Verified with real browser/Gateway proof, independent acceptance and review, and focused UI checks.

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

app: web-ui App: web-ui P2 Normal backlog priority with limited blast radius. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: L 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]: Models page picker opens with only the configured models; the discovered catalog fills in only after an interaction, with no loading state

2 participants