Skip to content

fix(ui): persist utility defaults without a primary model - #137633

Merged
steipete merged 1 commit into
mainfrom
codex/stable-review-f23-20260902
Sep 3, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/stable-review-f23-20260902

Conversation

@steipete

@steipete steipete commented Sep 3, 2026 •

Copy link
Copy Markdown
Contributor

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.

  • 228 UI owner/config tests and eight utility-runtime controls pass.
  • All seven bundled Models browser tests pass, including existing access, provider, primary-save and failed-save/reconnect controls.
  • All 30 release-candidate control tests and the complete five-file staged gate pass. Managed independent review is clean through P2, with no actionable findings.

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

Before: selecting GPT-5 Mini without a primary model reports Defaults saved but reverts to Auto.

After: the same selection is retained after the acknowledged save, with no primary model required.

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.

@openclaw-barnacle openclaw-barnacle Bot added app: web-ui App: web-ui size: M maintainer Maintainer-authored PR labels Sep 3, 2026
@clawsweeper

clawsweeper Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@clawsweeper clawsweeper Bot added P1 High-priority user-facing bug, regression, or broken workflow. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 3, 2026
@clawsweeper

clawsweeper Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed September 3, 2026, 7:15 PM ET / 23:15 UTC.

ClawSweeper review

What this changes

This 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
Reviewed head: 34f0828493bf644a96eee107753488f7535fa18b

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, net-neutral repair with appropriate unit and browser-boundary coverage; the remaining merge blocker is the failing exact-head E2E check rather than a source finding.
Proof confidence 🌊 off-meta tidepool Not applicable: Repository state identifies a MEMBER-authored PR, so the external-contributor proof gate does not apply. The supplied browser evidence is a deterministic mock-Gateway regression scenario and usefully covers the wire patch and reload, but is supplemental rather than live Gateway proof.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: Repository state identifies a MEMBER-authored PR, so the external-contributor proof gate does not apply. The supplied browser evidence is a deterministic mock-Gateway regression scenario and usefully covers the wire patch and reload, but is supplemental rather than live Gateway proof.
Evidence reviewed 6 items Current-main defect: Current main still nests utilityModel inside the primary-model conditional, so a blank primary omits an explicit utility selection from the emitted patch.
Introduced repair: The PR moves utilityModel outside that conditional while leaving primary-model and fallback serialization unchanged.
Owner and caller path: The Models page stages utility changes independently, then sends buildDefaultsPatch through the shared acknowledged config-mutation owner before refreshing saved state.
Findings None None.
Security None None.

How this fits together

The 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]
Loading

Before merge

  • Resolve merge risk (P1) - The exact-head checks-ui-e2e (7/7) check is failing; its log was unavailable in this read-only review, so the browser regression remains unverified until a replacement exact-head run passes.
  • Complete next step (P2) - Resolve the failing exact-head checks-ui-e2e (7/7) check and proceed only after its replacement run is green under normal maintainer handling.
Agent review details

Security

None.

PR surface

Source 0, Tests +128. Total +128 across 5 files.

View PR surface stats
Area Files Added Removed Net
Source 1 1 1 0
Tests 4 213 85 +128
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 5 214 86 +128

Review metrics

Metric Value Why it matters
Production versus test delta production +1/-1 (net 0); tests +213/-85 (net +128) The behavioral fix is a one-line relocation; added test coverage exercises the UI wire patch, reload behavior, and deterministic release-test clock.
Defaults patch contract 1 existing field changed from primary-conditional to unconditional emission This restores persistence for utility routing without adding a config key, schema, or migration.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    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.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best 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.

Labels

Label changes:

  • add P1: A user-visible defaults action reports success while silently losing an operator’s utility-model choice on reload.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: Repository state identifies a MEMBER-authored PR, so the external-contributor proof gate does not apply. The supplied browser evidence is a deterministic mock-Gateway regression scenario and usefully covers the wire patch and reload, but is supplemental rather than live Gateway proof.

Label justifications:

  • P1: A user-visible defaults action reports success while silently losing an operator’s utility-model choice on reload.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: Repository state identifies a MEMBER-authored PR, so the external-contributor proof gate does not apply. The supplied browser evidence is a deterministic mock-Gateway regression scenario and usefully covers the wire patch and reload, but is supplemental rather than live Gateway proof.

Evidence

What I checked:

Likely related people:

  • Patrick-Erichsen: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Resolve the failing checks-ui-e2e (7/7) run and obtain a green replacement on the exact PR head.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@steipete steipete self-assigned this Sep 3, 2026
@steipete
steipete merged commit 01c7675 into main Sep 3, 2026
251 of 254 checks passed
@steipete
steipete deleted the codex/stable-review-f23-20260902 branch September 3, 2026 23:28
@steipete

steipete commented Sep 3, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: web-ui App: web-ui maintainer Maintainer-authored PR P1 High-priority user-facing bug, regression, or broken workflow. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: M status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant