Skip to content

fix(ui): restore default-model picker discovery after the catalog store rewrite - #142346

Merged
steipete merged 1 commit into
mainfrom
steipete/fix-model-catalog-discovery-types
Sep 8, 2026
Merged

steipete merged 1 commit into
mainfrom
steipete/fix-model-catalog-discovery-types

Conversation

@steipete

@steipete steipete commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Related: #142105, #142165

What Problem This Solves

Resolves a problem where Control UI typechecks on main fail after the merge race between #142105 and #142165. The Models settings default-model pickers also stopped issuing discovery requests.

#142105 merged at 16:11 UTC on September 8; #142165 replaced the catalog store at 16:24 UTC without reconciling the new picker caller and tests. The resulting errors are:

catalog-discovery.ts(94,9): TS2353: 'refreshIfDue' does not exist in the loadModelCatalog options type.
model-providers-page.catalog.test.ts(7,10): TS2305: model-catalog-store.ts has no exported member 'invalidateModelCatalogCache'.

Why This Change Was Made

Use the supported refresh: true request to preserve demand-driven discovery for primary, utility, and fallback pickers. Ordinary catalog reads are passive; the Gateway owns acquisition and publication, while the page retains its cancellation and stale-result guards.

Remove the tests' obsolete cache invalidation setup. Core refresh and route replacement directly retire the page request. Update request counts for direct reads: overlapping opens on one page still share its pending request, reopening after completion requests again, and separate pages own independent requests. No removed cache, cooldown, or invalidation API is restored. Clarify this Models settings behavior in the protocol documentation.

User Impact

Opening a default-model picker discovers additional choices while preserving saved selections, usable controls, search, progress, retry, and protection against stale replies. Initial page loading remains passive. There are no appearance changes.

Evidence

Before the repair, pnpm tsgo:ui reproduced TS2353 and all 11 picker discovery tests failed because no refresh request was issued.

  • pnpm tsgo:ui — passed.
  • pnpm tsgo:core:test — passed.
  • node scripts/run-vitest.mjs ui/src/pages/model-providers/model-providers-page.catalog.test.ts ui/src/pages/model-providers/model-providers-page.test.ts ui/src/lib/model-catalog-store.test.ts ui/src/pages/model-providers/load.test.ts — 73 tests passed, including all 11 picker discovery cases.
  • node scripts/run-vitest.mjs ui/src/lib/chat/chat-metadata-store.test.ts — 16 tests passed.
  • node scripts/check-changed.mjs — passed; complete log inspected, including typechecks, formatting, i18n, ratchets, dead exports, and lint.
  • node scripts/check-docs-mdx.mjs docs/gateway/protocol/operator-methods.md and git diff --check — passed.
  • Independent review — no actionable P0–P2 findings.

The page tests exercise rendered controls against a mocked Gateway. No live provider or browser capture was used for this API reconciliation.

@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.

@steipete
steipete marked this pull request as ready for review September 8, 2026 16:47
@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation app: web-ui App: web-ui gateway Gateway runtime size: XS maintainer Maintainer-authored PR labels Sep 8, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. 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. 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, 12:54 PM ET / 16:54 UTC.

ClawSweeper review

What this changes

The PR restores on-demand model discovery in Models settings by using the supported refresh request, updating lifecycle tests, and clarifying the protocol documentation.

Regression provenance

Possible regression — probable (reviewed change; failure trace). No predecessor PR is attributed.

Merge readiness

✅ Ready for maintainer review

This remains a useful, focused repair: current main still passes the removed catalog option. No introduced correctness or security defect was found, and the maintainer-authored PR should remain open for normal landing.

Priority: P2
Reviewed head: edc2e8d5a2ac262568c1ea4953d9deda5a714bd6

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A narrow API reconciliation with meaningful retained regression coverage and no blocking findings.
Proof confidence 🌊 off-meta tidepool Not applicable: The external-contributor proof gate does not apply to this verified repository administrator's PR. Rendered picker tests exercise the changed request against a mocked Gateway; earlier screenshots establish feature context but do not prove this head's runtime.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The external-contributor proof gate does not apply to this verified repository administrator's PR. Rendered picker tests exercise the changed request against a mocked Gateway; earlier screenshots establish feature context but do not prove this head's runtime.
Evidence reviewed 9 items Current main still needs the repair: The fetched main revision still passes refreshIfDue, while its direct catalog reader forwards options to models.list. The protocol accepts refresh and rejects additional properties.
Existing protocol supports the replacement: ModelsListParamsSchema already defines refresh and prohibits unknown properties; the PR reconciles an internal caller without adding a protocol or plugin API.
Production ownership and lifecycle: The changed request retains agent/client ownership checks and cancellation. The page resets discovery when core data, route data, connection, or agent ownership changes; Gateway refresh uses its existing catalog acquisition boundary.
Findings None None.
Security None None.

How this fits together

The Models settings page requests model choices from the Gateway when primary, utility, or fallback pickers open. The Gateway owns catalog discovery, while the page controls request cancellation and preserves saved selections.

flowchart LR
  A[Open model picker] --> B[Page discovery controller]
  B --> C{Request pending?}
  C -->|Yes| D[Reuse pending page request]
  C -->|No| E[Gateway catalog refresh]
  E --> F[Published model choices]
  F --> G[Update current page and retain selections]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source 0, Tests -3, Docs +4. Total +1 across 3 files.

View PR surface stats
Area Files Added Removed Net
Source 1 4 4 0
Tests 1 6 9 -3
Docs 1 6 2 +4
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 3 16 15 +1

Review metrics

None.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #142343
Summary: This PR addresses the obsolete catalog caller and test import tracked by the open migration-gap issue.

Members:

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

Technical review

Best possible solution:

Keep discovery in the Gateway and use its existing refresh contract while preserving page-owned cancellation and saved model choices.

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

Yes, from source: opening a settings picker on the inspected main sends refreshIfDue through a reader whose protocol rejects that field. The reported failing checks support this path; execution was not repeated in this read-only review.

Is this the best way to solve the issue?

Yes. Using the existing refresh option repairs the obsolete caller without restoring the removed cache, cooldown, or invalidation API.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add P2: Repairs a bounded Models settings discovery regression; priority is based on picker behavior rather than CI failures.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The external-contributor proof gate does not apply to this verified repository administrator's PR. Rendered picker tests exercise the changed request against a mocked Gateway; earlier screenshots establish feature context but do not prove this head's runtime.

Label justifications:

  • P2: Repairs a bounded Models settings discovery regression; priority is based on picker behavior rather than CI failures.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The external-contributor proof gate does not apply to this verified repository administrator's PR. Rendered picker tests exercise the changed request against a mocked Gateway; earlier screenshots establish feature context but do not prove this head's runtime.

Evidence

What I checked:

Likely related people:

  • obviyus: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • xiaoguomeiyitian: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • steipete: 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.

@steipete

steipete commented Sep 8, 2026

Copy link
Copy Markdown
Contributor Author

Native landing review completed for edc2e8d. Current-main baseline 6de2bdc reproduced TS2353 at catalog-discovery.ts:94; the candidate passes pnpm tsgo:ui and uses the existing Gateway-owned refresh: true contract without restoring the retired UI cache.

Validation:

  • node scripts/run-vitest.mjs ui/src/pages/model-providers/model-providers-page.catalog.test.ts ui/src/pages/model-providers/model-providers-page.test.ts ui/src/lib/model-catalog-store.test.ts ui/src/pages/model-providers/load.test.ts ui/src/lib/chat/chat-metadata-store.test.ts — 89 tests passed, including all 11 picker discovery cases.
  • node scripts/check-changed.mjs -- ui/src/pages/model-providers/catalog-discovery.ts ui/src/pages/model-providers/model-providers-page.catalog.test.ts docs/gateway/protocol/operator-methods.md — passed, including core-test/UI typechecks, formatting, i18n, ratchets, and dead-export checks.
  • pnpm docs:list, node scripts/check-docs-mdx.mjs docs/gateway/protocol/operator-methods.md, and git diff --check origin/main...HEAD — passed.
  • Fresh independent Codex autoreview through P2 — scoped-clean, no actionable findings.
  • Exact-head CI run 34253166559 — GREEN. Native review artifacts validated and OPENCLAW_TESTBOX=1 scripts/pr prepare-run 142346 passed, retaining the same head without rebase or push.

The latest ClawSweeper review has no findings, no Before merge actions, and no Rank-up moves to address. Production +4/-4 (net zero); tests +6/-9; docs +6/-2.

Proof limits: rendered controls were tested in jsdom against mocked Gateway requests; no live provider or browser capture was used. The initial worktree typecheck refused ancestor dependency lookup before dependencies were installed; a complete native-worktree pnpm install resolved that refusal, and the baseline/candidate checks then ran successfully to their expected failing/passing outcomes.

@steipete
steipete merged commit f74837e into main Sep 8, 2026
185 checks passed
@steipete
steipete deleted the steipete/fix-model-catalog-discovery-types branch September 8, 2026 17:03
@steipete

steipete commented Sep 8, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

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 docs Improvements or additions to documentation gateway Gateway runtime maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XS 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.

1 participant