Repository navigation
fix(ui): refresh Agents model choices when the catalog changes - #139916
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 6, 2026, 4:38 AM ET / 08:38 UTC. ClawSweeper reviewWhat this changesThe Agents settings page subscribes to model-catalog updates, retains choices after read failures, and adds lifecycle coverage, a real-Gateway browser scenario, and documentation. Merge readiness✅ Ready for maintainer review This remains a useful, focused fix: current main and the latest release retain the one-shot catalog path. No blocking correctness or security finding was identified. The protected maintainer label also excludes automatic closure. Priority: P2 Review scores
Verification
How this fits togetherThe Control UI receives catalog-change notifications from the Gateway and caches model metadata for each client and agent. The Agents editor consumes that metadata to populate model choices while its existing configuration flow saves selections. flowchart TD
A[Provider catalog changes] --> B[Gateway notification]
B --> C[Shared metadata store]
C --> D{Current client and agent?}
D -->|Yes| E[Update model choices]
D -->|No| F[Ignore obsolete update]
C -->|Read failure| G[Show error and retain choices]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource -12, Tests +314, Docs +6. Total +308 across 7 files. View PR surface stats
Review metricsNone. Technical reviewBest possible solution: Keep catalog publication and request ordering in the shared metadata store, with the Agents page consuming current updates independently of saved selections and identity drafts. Do we have a high-confidence way to reproduce the issue? Yes, source establishes the path: publish a catalog change while Agents remains open; main invalidates the shared cache but the page has no subscription to request and consume the update. This review did not execute that scenario. Is this the best way to solve the issue? Yes. Reusing the existing subscription and writer-ordering owner removes the competing result path without changing configuration, persistence, or provider policy. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 8b37368a4e3f. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
History |
|
Merged in 48acc5ecb5fd.
|
…law#139916) Refresh the open Agents settings editor from accepted shared catalog publications, retaining choices and visible errors through failed reads. Remove competing page-owned promise state while preserving model, fallback, and identity-draft behavior. Validated through a matching built Gateway/browser, real synthetic-provider discovery, delayed replies, failure/recovery, independent settings readback, focused tests, and independent review. The existing identity-save refresh warning is reproduced on the untouched baseline and recorded separately in the PR; this change does not claim to fix it. Co-authored-by: Ayaan Zaidi <[email protected]>
Related: #136257.
What Problem This Solves
Settings → Agents showed old model choices after catalog refresh, and failed reads could discard previously loaded choices.
Why This Change Was Made
Agents subscribes to the shared metadata owner for results, errors, and request ordering. It releases subscriptions when the agent or connection changes, removing its separate result and loaded-state tracking.
User Impact
Choices refresh while the editor stays open. Read errors remain visible without discarding usable choices or identity drafts. Primary and fallback settings retain their behavior.
Evidence
Real Gateway discovery and browser checks reproduced missed publication, then verified refresh, failure recovery, late-response rejection, and draft retention. CLI readback confirmed primary and fallback settings. All 145 focused checks and ten sibling browser scenarios passed. A separate identity-save refresh warning also reproduced on the baseline and remains unresolved.
AI-assisted.