Skip to content

fix(ui): open Models settings from prepared catalogs - #146396

Merged
obviyus merged 4 commits into
mainfrom
fix/settings-picker-scope
Sep 13, 2026
Merged

obviyus merged 4 commits into
mainfrom
fix/settings-picker-scope

Conversation

@obviyus

@obviyus obviyus commented Sep 12, 2026 •

Copy link
Copy Markdown
Collaborator

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

  • Models settings reads current shared rows, Auto defaults and provider status.
  • Chat, New Session, Agents, scheduled-task suggestions and command search keep retrying partial reads.
  • Configured catalogs include the existing automatic utility preview by default.
  • Config selectors reject previous-connection snapshots; the latest read clears loading.

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.

@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 gateway Gateway runtime size: XL maintainer Maintainer-authored PR labels Sep 12, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. 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, 7:45 PM ET / 23:45 UTC (Revision 7).

ClawSweeper review

What this changes

Models 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
Reviewed head: 277e54f89f60e08ccde80106c609d38ab583ab90

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A coherent owner-level repair with focused regression coverage and no identified blocking correctness defect.
Proof confidence 🌊 off-meta tidepool Not applicable: The trusted-author exemption applies. The captured body reports Models route and real-Gateway validation, and inspected tests exercise prepared choices, partial inventories, saves, and reconnects; those runs were not independently executed here.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The trusted-author exemption applies. The captured body reports Models route and real-Gateway validation, and inspected tests exercise prepared choices, partial inventories, saves, and reconnects; those runs were not independently executed here.
Evidence reviewed 9 items Current main still needs the repair: The fetched main implementation waits for catalog, authentication, and a separate config read before returning page-owned model choices. The branch replaces that dependency with shared-store display reads.
Partial results and concurrent reads: Partial responses publish returned inventory but invalidate successful-result reuse; only successful discovery settles sibling requests. Publication remains fenced by connection-cache identity, scope, cancellation, and read ordering.
Prior configuration finding addressed: The current request clears foreground loading even when it is a background successor. Connection invalidation makes old config snapshots unreadable until a current snapshot or acknowledged write restores them.
Findings None None.
Security None None.

How this fits together

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

Before merge

None.

Agent review details

Security

None.

PR surface

Source +25, Tests +971, Other 0. Total +996 across 35 files.

View PR surface stats
Area Files Added Removed Net
Source 15 247 222 +25
Tests 19 1334 363 +971
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 1 1 1 0
Total 35 1582 586 +996

Review metrics

Metric Value Why it matters
Production versus regression coverage Production net +25 lines; tests and test support net +971 lines The stated production growth funds shared completion and connection ownership while removing page-owned copies; most growth covers concurrency and recovery regressions.

Technical review

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

Labels

Label justifications:

  • P2: Repairs bounded Models settings loading and partial-discovery behavior without evidence of an urgent core outage.
  • 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: The trusted-author exemption applies. The captured body reports Models route and real-Gateway validation, and inspected tests exercise prepared choices, partial inventories, saves, and reconnects; those runs were not independently executed here.

Evidence

What I checked:

  • Current main still needs the repair: The fetched main implementation waits for catalog, authentication, and a separate config read before returning page-owned model choices. The branch replaces that dependency with shared-store display reads. (ui/src/pages/model-providers/load.ts, 51caa9442e47)
  • Partial results and concurrent reads: Partial responses publish returned inventory but invalidate successful-result reuse; only successful discovery settles sibling requests. Publication remains fenced by connection-cache identity, scope, cancellation, and read ordering. (ui/src/lib/model-catalog-cache.ts:125, 277e54f89f60)
  • Prior configuration finding addressed: The current request clears foreground loading even when it is a background successor. Connection invalidation makes old config snapshots unreadable until a current snapshot or acknowledged write restores them. (ui/src/lib/config/config-gateway-operations.ts:357, 277e54f89f60)
  • Registered-route regression coverage: Inspected browser scenarios cover fresh, populated, and empty partial inventories; saving before authentication details arrive; replacement-connection config failure; overlapping Refresh; and prepared snapshot publication. These are source-reviewed tests, not reviewer-executed proof. (ui/src/e2e/model-providers-progressive.e2e.test.ts:51, 277e54f89f60)
  • Existing Gateway contract: Ordinary catalog reads consume published inventory without discovery; explicit refresh performs acquisition. The patch adds the existing automatic utility preview by default to unscoped configured views while retaining explicit opt-out, without changing provider execution or authentication contracts. (src/gateway/server-methods/models-list-result.ts:462, 277e54f89f60)
  • Feature-history routing: Current-main history connects obviyus to initial catalog publication and steipete to shared model selection and config refresh coordination. GitHub commit metadata corroborates those handles; these are routing signals, not causal attribution. (ui/src/app/gateway-observers.ts:103, 7753ffb4753f)

Likely related people:

  • unknown: The claimed source-line change could not be verified from bounded local history. (role: source history unknown; confidence: low)
  • steipete: 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 (6 earlier review cycles)
  • reviewed 2026-09-12T20:23:38.187Z sha b95fcef :: needs changes before merge. :: [P2] Preserve foreground loading cleanup when refreshing configuration
  • reviewed 2026-09-12T21:14:09.515Z sha 7ee95b6 :: needs changes before merge. :: [P2] Preserve usable rows from partially failed catalog responses
  • reviewed 2026-09-12T22:16:02.566Z sha 7ee95b6 :: blocked before merge. :: [P2] Preserve usable rows from partially failed catalog responses
  • reviewed 2026-09-12T22:31:18.760Z sha fe6cb2d :: blocked before merge. :: [P2] Preserve usable rows from partially failed catalog responses
  • reviewed 2026-09-12T23:00:17.601Z sha ec5d00dd764e25c75b1568fd6e045ea0e204ccf9 :: blocked before merge. :: none
  • reviewed 2026-09-12T23:20:47.800Z sha 9a458d7 :: needs maintainer review before merge. :: none

@obviyus

obviyus commented Sep 12, 2026

Copy link
Copy Markdown
Collaborator Author

landpr-approve-admin-merge
pr: 146396
head: 7ee95b6
scope: owner-review

@obviyus
obviyus marked this pull request as ready for review September 12, 2026 21:05
@obviyus
obviyus marked this pull request as draft September 12, 2026 22:09
@clawsweeper clawsweeper Bot added merge-risk: 🚨 auth-provider 🚨 May break OAuth, tokens, provider routing, model choice, or credentials. 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. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. merge-risk: 🚨 auth-provider 🚨 May break OAuth, tokens, provider routing, model choice, or credentials. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Sep 12, 2026
@obviyus
obviyus force-pushed the fix/settings-picker-scope branch from ec5d00d to 9a458d7 Compare September 12, 2026 23:10
@obviyus
obviyus marked this pull request as ready for review September 12, 2026 23:12
@obviyus

obviyus commented Sep 12, 2026

Copy link
Copy Markdown
Collaborator Author

landpr-approve-admin-merge
pr: 146396
head: 9a458d7
scope: owner-review

@obviyus
obviyus marked this pull request as draft September 12, 2026 23:26
@obviyus
obviyus force-pushed the fix/settings-picker-scope branch from 9a458d7 to 277e54f Compare September 12, 2026 23:31
@obviyus

obviyus commented Sep 12, 2026

Copy link
Copy Markdown
Collaborator Author

landpr-approve-admin-merge
pr: 146396
head: 277e54f
scope: owner-review

@obviyus
obviyus marked this pull request as ready for review September 12, 2026 23:39
@obviyus
obviyus merged commit c9c856c into main Sep 13, 2026
258 checks passed
@obviyus
obviyus deleted the fix/settings-picker-scope branch September 13, 2026 00:09
@obviyus

obviyus commented Sep 13, 2026

Copy link
Copy Markdown
Collaborator Author

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.

  • Bug: Models settings waited for catalog replies and could discard healthy choices after a partial discovery failure.
  • Fix: Settings consumes the shared prepared catalog. The shared store adopts current inventory while preserving provider warnings and retry behavior.
Before After
Prepared choices waited for a catalog reply. Prepared choices are available while the reply is pending.
Partial failures could hide healthy choices or retain obsolete rows. Current healthy choices stay selectable; empty inventory clears obsolete rows.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 13, 2026
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]>
steipete added a commit that referenced this pull request Sep 13, 2026
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.
steipete added a commit that referenced this pull request Sep 13, 2026
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.
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 gateway Gateway runtime maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XL 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