Repository navigation
fix(ui): persist utility defaults without a primary model - #137633
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: blocked before merge. Reviewed September 3, 2026, 7:15 PM ET / 23:15 UTC. ClawSweeper reviewWhat this changesThis PR makes utility-model defaults persist without a primary model, adds UI regressions for explicit, Disabled, and Auto selections, and fixes deterministic time in release-candidate CLI tests. Merge readiness⛔ Blocked before merge - 2 items remain Keep open. The patch is the direct, net-neutral repair for a current Settings → Models persistence bug, but the exact-head UI E2E check is failing and this protected member-authored PR requires maintainer handling before merge. Priority: P1 Review scores
Verification
How this fits togetherThe Control UI’s Models settings card turns operator selections into a Gateway config patch. The Gateway persists that patch, and the page reloads the saved defaults for subsequent settings sessions. flowchart LR
A[Models settings card] --> B[Utility model selection]
B --> C[Defaults patch builder]
C --> D[Gateway config patch]
D --> E[Saved agent defaults]
E --> F[Reloaded Control UI]
Before merge
Agent review detailsSecurityNone. PR surfaceSource 0, Tests +128. Total +128 across 5 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep the unconditional utilityModel field in the one canonical defaults patch, then merge after the failing exact-head UI E2E run is resolved and its replacement is green. Do we have a high-confidence way to reproduce the issue? Yes—source inspection reproduces the mechanism: with an empty primary model, current main omits utilityModel from buildDefaultsPatch. The added focused and browser-boundary tests encode the explicit, Disabled, and Auto cases, but were not executed in this read-only review. Is this the best way to solve the issue? Yes. Moving the existing field outside the primary-only branch preserves one canonical config-patch path and matches the independent UI control; adding special cases in the page or Gateway would duplicate that policy. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against ef9be3d8cfa5. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Merged via squash.
|
Related: #134813
What Problem This Solves
Fixes an issue where users choosing a utility model in Settings → Models would see “Defaults saved” but lose their selection when no primary model was explicitly configured. Disabling utility routing or restoring Auto could likewise be discarded.
Why This Change Was Made
Utility-model selection is independent of the primary model. Keep it in the defaults patch even when the primary field is omitted, matching the existing Appearance setting and runtime semantics. The fix moves one property: production +1/-1, net zero.
Primary-model omission, fallback replacement safeguards, behavior defaults, access gates and acknowledged-write/refresh handling remain unchanged. No new config, schema, protocol, dependency or persistence behavior.
Also fixes a pre-existing CI clock dependency: release-discovery CLI tests now use the same fixed time as their synthetic artifact fixtures. Their expiry/trust assertions and process timeouts remain unchanged; production release behavior is untouched.
User Impact
Operators can select an explicit utility model, choose Disabled, or restore Auto without first choosing a primary model. Each choice survives a full page reload.
Evidence
The original code fails three unit regressions and a bundled Chromium flow. The browser captures the omitted utility field, truthful no-op acknowledgment, “Defaults saved,” and reversion to Auto. The repaired flow persists explicit → Disabled → Auto through full reloads.
Before/after PNGs show the same synthetic scenario. Browser proof uses the real built Control UI and a deterministic mock Gateway applying the actual wire patch through the canonical merge owner—not a production Gateway or provider call.
Before and after
CI and review closeout
Exact-head CI, attempt 2 is green, including audit and all UI E2E shards, on
34f0828493bf644a96eee107753488f7535fa18b. This addresses the latest ClawSweeper before-merge items and Rank-up move. No checks, assertions, or timeouts were relaxed.Named follow-up: attempt 1 hit an existing-session browser-extension MCP handshake timeout in
extensions/browser/chrome-extension/bootstrap.chromium.test.ts:493, separate from the Models regression, and an npm audit timeout. Both passed unchanged on the replacement run; this PR does not claim to fix that intermittent handshake failure.