Repository navigation
fix(ui): restore default-model picker discovery after the catalog store rewrite - #142346
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, 12:54 PM ET / 16:54 UTC. ClawSweeper reviewWhat this changesThe PR restores on-demand model discovery in Models settings by using the supported refresh request, updating lifecycle tests, and clarifying the protocol documentation. Regression provenancePossible 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 Review scores
Verification
How this fits togetherThe 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]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource 0, Tests -3, Docs +4. Total +1 across 3 files. View PR surface stats
Review metricsNone. Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Technical reviewBest 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. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Native landing review completed for edc2e8d. Current-main baseline 6de2bdc reproduced TS2353 at Validation:
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 |
|
Merged via squash.
|
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:
Why This Change Was Made
Use the supported
refresh: truerequest 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:uireproduced 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.mdandgit diff --check— passed.The page tests exercise rendered controls against a mocked Gateway. No live provider or browser capture was used for this API reconciliation.