Skip to content

fix: keep newer model choices when a page refresh finishes - #145478

Merged
steipete merged 2 commits into
mainfrom
codex/fix-model-provider-refresh-order
Sep 12, 2026
Merged

steipete merged 2 commits into
mainfrom
codex/fix-model-provider-refresh-order

Conversation

@steipete

@steipete steipete commented Sep 12, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes an issue where users opening a model picker during a refresh in Settings → Models could lose newly discovered choices, see discovery stop, or see the Auto utility model revert when the older page refresh finished.

Why This Change Was Made

The page respects the newer picker request when it applies a refresh. Model choices, the resolved Auto utility model, progress, and catalog errors stay with that request while the refresh updates provider and configuration data. A later page refresh continues to retire older picker work.

User Impact

Model pickers remain usable during refresh. New choices and the Auto model stay consistent, pending discovery can finish, and refreshed default-model selections still appear.

Evidence

The completed and pending ordering regressions distinguish the initial, older refresh, and newer discovery results. Both fail without preserving the automatic utility value and pass with the fix. All 166 tests across seven related suites pass, including publication, inverse ordering, current Auto labels, and other default-model controls. UI types, all 17 core-test type graphs, lint, formatting, and the final canonical changed-file checks pass.

Real Chromium proof uses a synthetic Gateway and the actual Refresh button and picker on current main. The refreshed primary selection appears in both versions. The repaired version preserves the correct Auto value and newer catalog or pending progress, then adopts the pending discovery when it completes. Both runs finish without page errors or configuration writes; final source and index bytes are restored after baseline capture.

Newer discovery when the older refresh finishes Before After
Already completed Auto reverts to the stale fallback Auto keeps the newer discovered model
Still pending Auto reverts and discovery progress disappears Auto and discovery progress remain current

The two baseline states produce byte-identical screenshots, so they share one image above. Independent P2 review found no actionable findings. Browser proof uses a synthetic Gateway; no live provider or operator Gateway is exercised.

@steipete steipete self-assigned this Sep 12, 2026
@clawsweeper

clawsweeper Bot commented Sep 12, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added app: web-ui App: web-ui size: S maintainer Maintainer-authored PR labels Sep 12, 2026
@steipete
steipete marked this pull request as ready for review September 12, 2026 01:13
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. 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 12, 2026
@clawsweeper

clawsweeper Bot commented Sep 12, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 12, 2026, 12:55 AM ET / 04:55 UTC (Revision 6).

ClawSweeper review

What this changes

The Models settings page preserves newer model choices, Auto utility-model details, and discovery progress when an older page refresh finishes.

Merge readiness

✅ Ready for maintainer review

The fix remains necessary on the inspected main revision, and no actionable defects were found. The prior draft-status blocker is resolved; the supplied browser evidence supports the changed behavior.

Priority: P2
Reviewed head: 2f341b363b8198725954b477f6e6765bbaa35abe

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, maintainable repair with useful browser evidence and meaningful ordering regressions; no blocking findings remain.
Proof confidence 🦞 diamond lobster (5/6) ✨ media proof bonus Sufficient (screenshot): The captured body describes Chromium exercising the actual Models Refresh button and picker against a synthetic Gateway; inspected before/after images show the repaired Auto label and retained pending progress. The body also records eventual discovery completion and no configuration writes.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (screenshot): The captured body describes Chromium exercising the actual Models Refresh button and picker against a synthetic Gateway; inspected before/after images show the repaired Auto label and retained pending progress. The body also records eventual discovery completion and no configuration writes.
Evidence reviewed 8 items Introduced change and current-main necessity: The host-pinned introduction contains only the catalog controller, page coordination, and regression tests. Current main still resets discovery on core completion and unconditionally adopts its catalog, so the reported ordering defect remains present.
Generation ownership and lifecycle: The controller advances generation when discovery starts and retains its existing request, connection, and agent checks. The page captures that generation at refresh start, preserves only newer catalog fields on completion, and retains cancellation at subsequent refresh, route replacement, and connection or agent changes.
Focused regression coverage: The complete catalog test module was inspected. The two new cases delay config.get and finish picker discovery either before or after the older refresh; they assert refreshed primary selection, retained Auto value, model options, progress, provider outcomes, and no configuration writes. Existing cases cover inverse ordering and replacement cancellation. Tests were not executed in this read-only review.
Findings None None.
Security None None.

How this fits together

The Models settings page combines Gateway configuration and provider data with catalog discovery triggered by opening a model picker. Its refresh coordination determines which model choices, Auto label, and progress state users see.

flowchart TD
  A[Page Refresh] --> B[Load configuration and provider data]
  C[Open model picker] --> D[Discover model catalog]
  B --> E[Compare request generations]
  D --> E
  E --> F[Keep newer catalog and progress]
  E --> G[Apply refreshed configuration]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source +20, Tests +106. Total +126 across 3 files.

View PR surface stats
Area Files Added Removed Net
Source 2 25 5 +20
Tests 1 106 0 +106
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 3 131 5 +126

Review metrics

None.

Technical review

Best possible solution:

Keep catalog ownership with the latest picker request while the existing page loader independently reconciles configuration and provider data.

Do we have a high-confidence way to reproduce the issue?

Yes: delay a page refresh's configuration response, open a model picker, then let the older refresh finish while discovery is pending or already completed. Current-main source establishes the overwrite and cancellation path; this review did not execute it.

Is this the best way to solve the issue?

Yes: the repair extends the existing discovery owner with a generation counter and preserves only catalog fields, without changing saved settings, provider routing, or public APIs.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against fe056539fd16.

Labels

Label justifications:

  • P2: This repairs a bounded Models settings race that can replace newer choices and hide discovery progress.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (screenshot): The captured body describes Chromium exercising the actual Models Refresh button and picker against a synthetic Gateway; inspected before/after images show the repaired Auto label and retained pending progress. The body also records eventual discovery completion and no configuration writes.
  • proof: sufficient: Contributor real behavior proof is sufficient. The captured body describes Chromium exercising the actual Models Refresh button and picker against a synthetic Gateway; inspected before/after images show the repaired Auto label and retained pending progress. The body also records eventual discovery completion and no configuration writes.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence. The captured body describes Chromium exercising the actual Models Refresh button and picker against a synthetic Gateway; inspected before/after images show the repaired Auto label and retained pending progress. The body also records eventual discovery completion and no configuration writes.

Evidence

What I checked:

  • Introduced change and current-main necessity: The host-pinned introduction contains only the catalog controller, page coordination, and regression tests. Current main still resets discovery on core completion and unconditionally adopts its catalog, so the reported ordering defect remains present. (ui/src/pages/model-providers/model-providers-page.ts:98, fe056539fd16)
  • Generation ownership and lifecycle: The controller advances generation when discovery starts and retains its existing request, connection, and agent checks. The page captures that generation at refresh start, preserves only newer catalog fields on completion, and retains cancellation at subsequent refresh, route replacement, and connection or agent changes. (ui/src/pages/model-providers/catalog-discovery.ts:100, 2f341b363b81)
  • Focused regression coverage: The complete catalog test module was inspected. The two new cases delay config.get and finish picker discovery either before or after the older refresh; they assert refreshed primary selection, retained Auto value, model options, progress, provider outcomes, and no configuration writes. Existing cases cover inverse ordering and replacement cancellation. Tests were not executed in this read-only review. (ui/src/pages/model-providers/model-providers-page.catalog.test.ts:707, 2f341b363b81)
  • Inspected browser evidence: All three prepared images from the captured PR body were inspected. The baseline shows Auto · Prepared fallback; the completed after-state shows Auto · Newer discovered model and four models; the pending after-state shows Auto · Prepared utility and Discovering more models. The body describes actual Chromium Refresh/picker interactions against a synthetic Gateway and subsequent pending completion. These images support visible state behavior, not live-provider or network-security claims.
  • Review continuity: The previous completed review covered the same head, had no findings or published rank-up moves, and requested readiness from draft. The supplied timeline records ready_for_review at 2026-09-12T04:49:44Z, and pullRequest.draft is false. (2f341b363b81)
  • Existing product contract and implementation boundary: Models documentation describes discovery on first picker opening and later reads of the published catalog. The inspected catalog adapter calls OpenClaw's models.list contract; this patch changes UI request coordination and introduces no dependency on the Codex harness. Public docs: docs/concepts/models.md. (docs/concepts/models.md:91, 2f341b363b81)

Likely related people:

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

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.

History

Review history (5 earlier review cycles)
  • reviewed 2026-09-12T01:19:36.041Z sha 1a723e3350a9039cadfe78f8c466c6f7a7afc563 :: needs maintainer review before merge. :: none
  • reviewed 2026-09-12T02:58:54.005Z sha 0dbc1cba01f4004270338699f3cd2f3543638b18 :: needs maintainer review before merge. :: none
  • reviewed 2026-09-12T03:18:10.595Z sha 889f06f :: needs maintainer review before merge. :: none
  • reviewed 2026-09-12T03:57:07.206Z sha 889f06f :: needs changes before merge. :: none
  • reviewed 2026-09-12T04:48:08.621Z sha 2f341b3 :: needs changes before merge. :: none

@steipete
steipete force-pushed the codex/fix-model-provider-refresh-order branch 2 times, most recently from 0dbc1cb to 889f06f Compare September 12, 2026 03:09
@clawsweeper clawsweeper Bot removed proof: sufficient ClawSweeper judged the real behavior proof convincing. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. labels Sep 12, 2026
@steipete
steipete marked this pull request as draft September 12, 2026 03:50
Preserve newer completed or pending picker discovery while an older Models
page refresh adopts configuration and other provider data. Core refreshes
still retire picker work that started earlier.

Validated with two causal mounted regressions, 117 selected tests, synthetic
Chromium before/after proof, canonical checks, UI build and clean P2 review.
@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. labels Sep 12, 2026
@steipete
steipete force-pushed the codex/fix-model-provider-refresh-order branch from 889f06f to 2f341b3 Compare September 12, 2026 04:41
@steipete
steipete marked this pull request as ready for review September 12, 2026 04:49
@steipete
steipete merged commit 7275b4b into main Sep 12, 2026
175 of 176 checks passed
@steipete
steipete deleted the codex/fix-model-provider-refresh-order branch September 12, 2026 05:24
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 13, 2026
…145478)

* fix: keep newer model choices when a page refresh finishes

Preserve newer completed or pending picker discovery while an older Models
page refresh adopts configuration and other provider data. Core refreshes
still retire picker work that started earlier.

Validated with two causal mounted regressions, 117 selected tests, synthetic
Chromium before/after proof, canonical checks, UI build and clean P2 review.

* fix: retain automatic model during page refresh
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 P2 Normal backlog priority with limited blast radius. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: S 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