Repository navigation
fix(ui): open Models settings from prepared catalogs - #146396
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 12, 2026, 7:45 PM ET / 23:45 UTC (Revision 7). ClawSweeper reviewWhat this changesModels settings reads prepared model choices and editable defaults from shared stores, preserving usable choices during provider loading, partial discovery failures, and reconnects. Merge readiness✅ Ready for maintainer review This PR remains useful: current main still couples Models choices to page loading. The prior loading-cleanup and partial-catalog findings are addressed, and this review found no new blocking defect. Priority: P2 Review scores
Verification
How this fits togetherThe Control UI receives model catalogs and configuration from the Gateway. Models settings turns those snapshots into selectable defaults and provider diagnostics, while configuration writes remain coordinated by the shared config owner. flowchart TD
A[Gateway connection] --> B[Prepared model catalog]
B --> C[Shared catalog store]
D[Gateway configuration] --> E[Shared config owner]
C --> F[Models settings]
E --> F
F --> G[Select defaults or retry discovery]
G --> A
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +25, Tests +971, Other 0. Total +996 across 35 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Keep Models settings as a projection of shared catalog and configuration owners, with independent provider diagnostics and explicit discovery. Do we have a high-confidence way to reproduce the issue? Yes, from source: hold the Models page's catalog or authentication reply while prepared choices exist; current main withholds page-owned choices until loading completes. This review did not execute that scenario. Is this the best way to solve the issue? Yes. Reusing the existing catalog and configuration owners removes competing snapshots while preserving explicit discovery, scoped invalidation, and saved defaults. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 51caa9442e47. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (6 earlier review cycles)
|
|
landpr-approve-admin-merge |
ec5d00d to
9a458d7
Compare
|
landpr-approve-admin-merge |
9a458d7 to
277e54f
Compare
|
landpr-approve-admin-merge |
|
Thanks @obviyus! Proof: Models settings choices remain usable while catalog replies are held for three seconds. Browser tests also cover partial failures, empty results, Retry, reconnect, and saving a selection.
|
Use the shared prepared catalog for Models settings. Preserve current returned choices and provider status after partial discovery failures, keep request ordering and retry behavior, and leave reconnect configuration reads with their existing owner. Validated through browser regressions, real Gateway cases, catalog and config tests, and startup bundle checks. Co-authored-by: Ayaan Zaidi <[email protected]>
Reconcile the shared catalog when a publication retires a route preload before the Models page subscribes. Keep catalog errors visible and use the existing loader to consume current models without changing badge semantics. The route-to-page gap was introduced by c9c856c (#146396). It matches the automatic quota-recovery badge failures in checks-ui-e2e-real-gateway on #146246 (run 34733358595) and #146664 (run 34733471778). Prove the same Signed in/Ready failure before the fix and recovery after it. All 134 focused tests, both real-Gateway quota scenarios, the UI build, and changed-file checks pass. Keep usage-preload fixtures complete and retain quota badge transitions and catalog events for diagnosis.
Reconcile the shared catalog when a publication retires a route preload before the Models page subscribes. Keep catalog errors visible and use the existing loader to consume current models without changing badge semantics. The route-to-page gap was introduced by c9c856c (#146396). It matches the automatic quota-recovery badge failures in checks-ui-e2e-real-gateway on #146246 (run 34733358595) and #146664 (run 34733471778). Prove the same Signed in/Ready failure before the fix and recovery after it. All 134 focused tests, both real-Gateway quota scenarios, the UI build, and changed-file checks pass. Keep usage-preload fixtures complete and retain quota badge transitions and catalog events for diagnosis.
What Problem This Solves
Models settings waits for catalog replies even when prepared choices exist. Partial discovery failures can also hide healthy returned choices.
Why This Change Was Made
Use one shared catalog for choices and one config owner for editable defaults. Adopt current returned rows and provider status separately from successful-discovery reuse. Remove page-owned catalog copies, duplicate loading controls and config reads. Production: +247/−222 lines; the net 25 lines add shared completion and connection ownership while removing duplicate state.
User Impact
Choices open while provider details load. Healthy choices remain selectable when another provider fails; its warning and Retry remain visible. Empty returned inventories clear obsolete choices. Late replies cannot restore old rows, and reconnect or overlapping Refresh cannot leave controls stuck.
Evidence
Three-second response holds reproduce the original wait. Fresh, populated and empty partial-response cases fail before this fix and pass afterward. Twelve Models browser cases, three real-Gateway cases, concurrent-read tests and bundle checks pass. Sixteen valid config shapes start; invalid input is rejected.
Compatibility
No stored-state, schema or protocol-version change. Uses main's 355,143 B startup baseline without an increase. The assertion-safety count shrinks 5→3.
Consumers
Invalidation
Config/metadata events, expiry and scoped session changes retire reuse. Client, hello, identity or disconnect clears display. Partial results preserve current rows and pending reads; successful discovery completes sibling reads. Older replies remain fenced.
Contention
Publication updates memory without awaiting work or holding a lock. Config write serialization is unchanged.
Tests
Registered Models route: held replies, selection/save, partial and empty responses, Retry, reconnect and Refresh overlap. Gateway models.list and shared-store consumers retain coverage.