Skip to content

fix(ui): avoid repeated model discovery when reopening Settings pickers - #142384

Merged
steipete merged 2 commits into
mainfrom
codex/fix-model-picker-catalog-request-20260908
Sep 8, 2026
Merged

steipete merged 2 commits into
mainfrom
codex/fix-model-picker-catalog-request-20260908

Conversation

@steipete

@steipete steipete commented Sep 8, 2026 •

Copy link
Copy Markdown
Contributor

Related: #142346, #142343

What Problem This Solves

Fixes an issue where users reopening primary, utility, or fallback pickers in Models Settings would repeatedly wait for full provider discovery even after the current page data had already requested it. A nonfatal provider refresh failure also retained usable choices without showing the picker Retry control.

Why This Change Was Made

The page records whether the current core-data snapshot has requested discovery. First open and explicit Retry request acquisition; completed reopens read the Gateway’s current publication. Existing core/page/agent/Gateway replacement resets remain intact, because configuration changes can introduce providers that have not been discovered yet. Nonfatal refresh results keep usable choices and expose the existing Settings-local Retry feedback.

User Impact

Users can reopen pickers without another provider acquisition while keeping saved selections and newly published choices current. Core settings reloads, including reloads after saves, intentionally allow a new acquisition on the next open. This replaces the former five-minute refresh policy; elapsed time alone does not trigger a refresh.

Evidence

The same real Chromium → Gateway WebSocket/schema → bundled Ollama acquisition scenario fails on the merged predecessor controller at the completed reopen: it sends refresh: true and performs an extra /api/tags request. The candidate passes using an isolated Gateway and a synthetic loopback HTTP provider, with no mocked RPC responses or provider-acquisition function.

Action Additional provider acquisitions
Initial prepared-only Settings load 0
First picker open 1
Completed reopen after another request publishes newer choices 0
First open after core settings replacement 1
Failed acquisition returning HTTP 503 1, with retained choices and Retry
Explicit Retry 1
Completed reopen after Retry 0

The setup acquisition and separate publisher/core Refresh acquisitions are recorded independently. Every browser catalog request is joined to its actual response, and served JavaScript asset hashes are retained. All three real-Gateway scenarios pass, including the existing Automations and Command Palette siblings. Ninety focused tests passed; the updated twelve-case picker suite was replayed after clarifying the core-reset contract. Full pnpm build, final check:changed, documentation sanity, and managed independent review through P2 passed. The final Gateway and UI were rebuilt and the complete real-Gateway scenario replayed after the Settings-specific guidance correction. The earlier before-proof and acquisition-owner comparison are retained.

The captures show the same synthetic Settings surface before and after; the request/acquisition assertions establish the performance difference. No production latency claim is made.

Before: completed reopen triggered another acquisition

After: completed reopen reads current publication without acquisition

After: retained model choices and Settings-local Retry after a real provider failure

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

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation app: web-ui App: web-ui gateway Gateway runtime size: M maintainer Maintainer-authored PR labels Sep 8, 2026
@steipete
steipete marked this pull request as ready for review September 8, 2026 17:48
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. 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, 2:10 PM ET / 18:10 UTC (Revision 2).

ClawSweeper review

What this changes

Models Settings discovers providers once per settings snapshot, reads published choices on later picker opens, and exposes Retry after nonfatal discovery failures.

Merge readiness

✅ Ready for maintainer review

This PR remains useful: current main still reacquires providers on completed picker reopens. The focused implementation and supplied production-path proof support the repair; no blocking correctness findings remain.

Priority: P2
Reviewed head: 8e93d12c3dd72637a158907c393b2f720b38f259

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused repair with meaningful lifecycle coverage and production-path before/after evidence; no actionable correctness or security defect was found.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (live_output): The supplied real Chromium/Gateway/Ollama scenario reports measured acquisition counts and HTTP 503 recovery through the changed Settings controller; inspected captures corroborate preserved choices and local Retry. The evidence supports the changed behavior without relying on screenshots alone for the network claim.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (live_output): The supplied real Chromium/Gateway/Ollama scenario reports measured acquisition counts and HTTP 503 recovery through the changed Settings controller; inspected captures corroborate preserved choices and local Retry. The evidence supports the changed behavior without relying on screenshots alone for the network claim.
Evidence reviewed 9 items Current main still needs the repair: The fetched main controller calls discovery on every completed open and always supplies refresh: true; it does not surface a successful response carrying refreshFailed through its discovery error state.
Focused request-lifetime repair: First open and Retry request acquisition; completed reopens omit refresh. Reset clears request history, and existing client, agent, epoch, and pending-request guards continue to reject retired results.
Existing Gateway contract and reset integration: The page resets discovery on core refresh, route replacement, agent changes, and connection invalidation. The Gateway acquires providers only for explicit refresh and otherwise reads its published snapshot, including retained refresh-failure status. No new protocol, plugin API, or persisted setting is introduced.
Findings None None.
Security None None.

How this fits together

Models Settings loads available model choices through the Gateway’s catalog API. The page decides when to request provider discovery, while the Gateway owns acquisition and publication of the resulting catalog.

flowchart TD
  A[Settings load or replacement] --> B[Reset page request history]
  B --> C[Model picker opens]
  C --> D{Discovery already requested?}
  D -->|No| E[Acquire provider models]
  D -->|Yes| F[Read published catalog]
  E --> F
  F --> G[Update choices and failure feedback]
  G -->|Explicit Retry| E
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source +5, Tests +242, Docs +7. Total +254 across 4 files.

View PR surface stats
Area Files Added Removed Net
Source 1 14 9 +5
Tests 2 288 46 +242
Docs 1 11 4 +7
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 4 313 59 +254

Review metrics

Metric Value Why it matters
Production versus regression coverage production net +5 lines; tests net +242 lines Production growth is limited to request history and failure feedback; most growth exercises the real acquisition boundary and lifecycle regressions.

Technical review

Best possible solution:

Keep acquisition owned by the Gateway and use page-lifetime request history to avoid redundant discovery while preserving explicit refresh, Retry, and configuration-change resets.

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

Yes: current main unconditionally sends refresh on each completed picker reopen, and the supplied before/after scenario measures the resulting provider requests. This read-only review did not execute it.

Is this the best way to solve the issue?

Yes: the repair uses the existing passive-read and explicit-refresh contract, preserves lifecycle guards and saved selections, and adds no competing catalog cache.

AGENTS.md: found and applied where relevant.

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

Labels

Label justifications:

  • P2: Repeated Settings discovery and missing Retry feedback are bounded usability and performance defects with usable model choices preserved.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The supplied real Chromium/Gateway/Ollama scenario reports measured acquisition counts and HTTP 503 recovery through the changed Settings controller; inspected captures corroborate preserved choices and local Retry. The evidence supports the changed behavior without relying on screenshots alone for the network claim.
  • proof: sufficient: Contributor real behavior proof is sufficient. The supplied real Chromium/Gateway/Ollama scenario reports measured acquisition counts and HTTP 503 recovery through the changed Settings controller; inspected captures corroborate preserved choices and local Retry. The evidence supports the changed behavior without relying on screenshots alone for the network claim.

Evidence

What I checked:

  • Current main still needs the repair: The fetched main controller calls discovery on every completed open and always supplies refresh: true; it does not surface a successful response carrying refreshFailed through its discovery error state. (ui/src/pages/model-providers/catalog-discovery.ts:54, 4e01e2fd5e78)
  • Focused request-lifetime repair: First open and Retry request acquisition; completed reopens omit refresh. Reset clears request history, and existing client, agent, epoch, and pending-request guards continue to reject retired results. (ui/src/pages/model-providers/catalog-discovery.ts:57, 8e93d12c3dd7)
  • Existing Gateway contract and reset integration: The page resets discovery on core refresh, route replacement, agent changes, and connection invalidation. The Gateway acquires providers only for explicit refresh and otherwise reads its published snapshot, including retained refresh-failure status. No new protocol, plugin API, or persisted setting is introduced. (ui/src/pages/model-providers/model-providers-page.ts:103, 8e93d12c3dd7)
  • Production-path proof and inspected captures: The captured PR body reports Chromium → real Gateway WebSocket → bundled Ollama HTTP acquisition results: zero acquisitions on initial load and completed reopens, one on first open and Retry, retained choices after HTTP 503, and recovery afterward. The inspected scenario records matching RPC replies, provider traffic, and served asset hashes. Downloaded before/after images show preserved selection and published choices; the failure image visibly shows Settings-local Retry. Screenshots support the visible behavior, while the reported acquisition observations support the network claim. This review did not rerun the scenario. (ui/src/e2e/command-palette-catalog.real-gateway.e2e.test.ts:110, 8e93d12c3dd7)
  • Regression coverage: The complete picker suite covers all three pickers, overlapping opens, published updates, unchanged saved selections, rejected and nonfatal failures, Retry, replacement data, retired responses, and independent page lifetimes. The existing Automations and Command Palette scenarios remain present. (ui/src/pages/model-providers/model-providers-page.catalog.test.ts:95, 8e93d12c3dd7)
  • Related merged repair is distinct: GitHub confirms fix(ui): restore default-model picker discovery after the catalog store rewrite #142346 merged at 2026-09-08T17:03:52Z. Its supplied body addresses removed catalog APIs and explicitly retains repeated acquisition after completed opens, so it does not supersede this follow-up. (f74837eec914)

Likely related people:

  • steipete: 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)

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 (1 earlier review cycle)
  • reviewed 2026-09-08T17:55:08.239Z sha 42ee6ca :: needs maintainer review before merge. :: none

@steipete
steipete merged commit 8128b41 into main Sep 8, 2026
131 checks passed
@steipete
steipete deleted the codex/fix-model-picker-catalog-request-20260908 branch September 8, 2026 18:20
@steipete

steipete commented Sep 8, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

obviyus added a commit that referenced this pull request Sep 8, 2026
## What Problem This Solves

Fixes an issue where users browsing Automations, model search, or Models pickers received no warning when a catalog refresh failed internally without an individual provider error.

## Why This Change Was Made

These consumers now use the shared published-catalog reader and its failure result. This removes prepared-read hints, the command palette's mandatory-method advertisement gate, and duplicate per-provider error decisions. Models settings retain first-open and Retry discovery, with passive completed reopens, from #142384. Settings use their local Retry guidance instead of a second "Open Models" warning. Initial page reads stay passive; explicit Refresh waits for credential-state publication before provider discovery. Current request ownership, cancellation, saved selections, drafts, and unrelated errors remain intact.

## User Impact

A failed refresh shows a warning with the returned choices. An empty returned catalog stays empty, and successful recovery clears the warning. Search retains its other categories and existing connection-scoped cache. No account, credential, persistence, or inference behavior changes.

## Evidence

- Four rendered caller cases fail on pinned main and pass with this correction: empty/nonempty internal failure and successful empty recovery in Automations and model search.
- 69 distinct selected consumer controls are covered across the retained runs. The current 14 Models integration controls preserve first-open/reopen/Retry discovery, saved choices, cancellation and late-response ownership. An integration case reproduced the duplicate Settings warning before correction; 22 Settings/load controls and six default-message controls now pass. Two added Agents controls preserve the existing failed-result/recovery contract. Eight affected search controls pass after simplifying the request fixture. Repeated runs are not counted as additional cases.
- Two real-browser/mock-Gateway cases passed in [CI job 102174612039](https://github.com/openclaw/openclaw/actions/runs/34259727043/job/102174612039). [The verified artifact](https://github.com/openclaw/openclaw/actions/runs/34259727043/artifacts/10069793308) contains eight inspected before/failure/recovery images and complete product observations. Both Automations and search show the warning, returned rows replace obsolete rows, successful empty recovery clears it, and the automation draft stays intact. The captured catalog requests remain passive and agent-scoped.
- Browser proof used checkout `3c340575bb60c4c0187102a36af23103537b8da4`, the CI merge of `865993acc9efb27070aee2d4398120c94a68ab84`. Later changes correct test typing, add retained Agents assertions, integrate Settings-local guidance, and retire the temporary artifact-upload step. Six current controls confirm unchanged default messages for Agents, Automations and search; the captured browser evidence retains its original source/fixture identity. This is UI boundary proof with a mock Gateway, not a new real backend internal-failure run.
- Earlier CI caught six unbound-method references in the test fixture and one mock-call tuple assertion; this revision corrects both. The exact-head run now passes the catalog, real-Gateway, lint and type lanes. Its remaining chat-image continuity failure is independent of these catalog execution paths; the full causal disposition and historical failure remain retained. Independent acceptance passed the original six browser clauses. The earlier local review requested the connected internal-failure proof below; a fresh review judges that changed evidence.

- Additional matched real-Gateway/browser proof now completes the internal-failure path: a registered synthetic provider reads malformed catalog data, the real explicit refresh returns a task error, and subsequent browser reads return `refreshFailed: true` without a provider error. The baseline UI omits the warning; the candidate shows it in Automations and global model search. Both retain the returned anchor and draft, and recovery clears the candidate warnings. Eight lifecycle images and complete CLI, wire and UI observations are retained for local review. No response, flag or publication event was injected.
- This matched pair uses the same retained Gateway build `07493b36def6c891c0d54697b2da16b1ef0fc22b` for both UIs. Baseline UI uses that build; candidate UI comes from CI build `92dac1774651d326c606855b3a1609e18a568e49` for the reviewed head. It is a UI consumer proof against the real retained Gateway, not a claim that the entire current backend was executed locally. Both Gateways exited normally and all consumers stopped. Background metadata/read bursts remain in the complete evidence; no quiet-cadence or throughput claim is made.

Co-authored-by: Ayaan Zaidi <[email protected]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 9, 2026
…rs (openclaw#142384)

* fix(ui): avoid repeated model discovery on picker reopen

* fix(ui): keep model discovery retry guidance in Settings
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 9, 2026
## What Problem This Solves

Fixes an issue where users browsing Automations, model search, or Models pickers received no warning when a catalog refresh failed internally without an individual provider error.

## Why This Change Was Made

These consumers now use the shared published-catalog reader and its failure result. This removes prepared-read hints, the command palette's mandatory-method advertisement gate, and duplicate per-provider error decisions. Models settings retain first-open and Retry discovery, with passive completed reopens, from openclaw#142384. Settings use their local Retry guidance instead of a second "Open Models" warning. Initial page reads stay passive; explicit Refresh waits for credential-state publication before provider discovery. Current request ownership, cancellation, saved selections, drafts, and unrelated errors remain intact.

## User Impact

A failed refresh shows a warning with the returned choices. An empty returned catalog stays empty, and successful recovery clears the warning. Search retains its other categories and existing connection-scoped cache. No account, credential, persistence, or inference behavior changes.

## Evidence

- Four rendered caller cases fail on pinned main and pass with this correction: empty/nonempty internal failure and successful empty recovery in Automations and model search.
- 69 distinct selected consumer controls are covered across the retained runs. The current 14 Models integration controls preserve first-open/reopen/Retry discovery, saved choices, cancellation and late-response ownership. An integration case reproduced the duplicate Settings warning before correction; 22 Settings/load controls and six default-message controls now pass. Two added Agents controls preserve the existing failed-result/recovery contract. Eight affected search controls pass after simplifying the request fixture. Repeated runs are not counted as additional cases.
- Two real-browser/mock-Gateway cases passed in [CI job 102174612039](https://github.com/openclaw/openclaw/actions/runs/34259727043/job/102174612039). [The verified artifact](https://github.com/openclaw/openclaw/actions/runs/34259727043/artifacts/10069793308) contains eight inspected before/failure/recovery images and complete product observations. Both Automations and search show the warning, returned rows replace obsolete rows, successful empty recovery clears it, and the automation draft stays intact. The captured catalog requests remain passive and agent-scoped.
- Browser proof used checkout `3c340575bb60c4c0187102a36af23103537b8da4`, the CI merge of `865993acc9efb27070aee2d4398120c94a68ab84`. Later changes correct test typing, add retained Agents assertions, integrate Settings-local guidance, and retire the temporary artifact-upload step. Six current controls confirm unchanged default messages for Agents, Automations and search; the captured browser evidence retains its original source/fixture identity. This is UI boundary proof with a mock Gateway, not a new real backend internal-failure run.
- Earlier CI caught six unbound-method references in the test fixture and one mock-call tuple assertion; this revision corrects both. The exact-head run now passes the catalog, real-Gateway, lint and type lanes. Its remaining chat-image continuity failure is independent of these catalog execution paths; the full causal disposition and historical failure remain retained. Independent acceptance passed the original six browser clauses. The earlier local review requested the connected internal-failure proof below; a fresh review judges that changed evidence.

- Additional matched real-Gateway/browser proof now completes the internal-failure path: a registered synthetic provider reads malformed catalog data, the real explicit refresh returns a task error, and subsequent browser reads return `refreshFailed: true` without a provider error. The baseline UI omits the warning; the candidate shows it in Automations and global model search. Both retain the returned anchor and draft, and recovery clears the candidate warnings. Eight lifecycle images and complete CLI, wire and UI observations are retained for local review. No response, flag or publication event was injected.
- This matched pair uses the same retained Gateway build `07493b36def6c891c0d54697b2da16b1ef0fc22b` for both UIs. Baseline UI uses that build; candidate UI comes from CI build `92dac1774651d326c606855b3a1609e18a568e49` for the reviewed head. It is a UI consumer proof against the real retained Gateway, not a claim that the entire current backend was executed locally. Both Gateways exited normally and all consumers stopped. Background metadata/read bursts remain in the complete evidence; no quiet-cadence or throughput claim is made.

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