Repository navigation
fix(ui): avoid repeated model discovery when reopening Settings pickers - #142384
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. Reviewed September 8, 2026, 2:10 PM ET / 18:10 UTC (Revision 2). ClawSweeper reviewWhat this changesModels 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 Review scores
Verification
How this fits togetherModels 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
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +5, Tests +242, Docs +7. Total +254 across 4 files. View PR surface stats
Review metrics
Technical reviewBest 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. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
|
Merged via squash.
|
## 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]>
…rs (openclaw#142384) * fix(ui): avoid repeated model discovery on picker reopen * fix(ui): keep model discovery retry guidance in Settings
## 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]>
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: trueand performs an extra/api/tagsrequest. The candidate passes using an isolated Gateway and a synthetic loopback HTTP provider, with no mocked RPC responses or provider-acquisition function.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, finalcheck: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.