Skip to content

fix(ui): refresh Agents model choices when the catalog changes - #139916

Merged
obviyus merged 4 commits into
mainfrom
codex/agents-catalog-refresh
Sep 6, 2026
Merged

obviyus merged 4 commits into
mainfrom
codex/agents-catalog-refresh

Conversation

@obviyus

@obviyus obviyus commented Sep 6, 2026 •

Copy link
Copy Markdown
Collaborator

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.

@obviyus obviyus self-assigned this Sep 6, 2026
@clawsweeper

clawsweeper Bot commented Sep 6, 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 docs Improvements or additions to documentation app: web-ui App: web-ui size: L maintainer Maintainer-authored PR labels Sep 6, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. 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 6, 2026
@clawsweeper

clawsweeper Bot commented Sep 6, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 6, 2026, 4:38 AM ET / 08:38 UTC.

ClawSweeper review

What this changes

The 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
Reviewed head: 514d5fd30c7499aacfe6153bdea4e6bd84d03f09

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused owner-level repair with meaningful lifecycle and browser coverage and no identified blocking defect.
Proof confidence 🌊 off-meta tidepool Not applicable: Repository State identifies a MEMBER author, so the external-contributor proof gate does not apply. The supplied body reports matching real Gateway/browser refresh, failure recovery, stale-reply isolation, and settings readback; the corresponding scenario was inspected as source, not executed.
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 author, so the external-contributor proof gate does not apply. The supplied body reports matching real Gateway/browser refresh, failure recovery, stale-reply isolation, and settings readback; the corresponding scenario was inspected as source, not executed.
Evidence reviewed 8 items Introduced production change: The complete pinned diff replaces page-owned promise results with an agent-scoped subscription. Errors preserve loaded choices; publication callbacks check subscription identity, Gateway source, client, request generation, and selected agent.
Existing publication owner: The shared store retires superseded writers before notifying subscribers, preserves consumer-held results after read failures, and keys entries by agent, session, and account. The application already invalidates this store on config.changed and chat.metadata.changed; Chat and New Session already consume subscriptions.
Lifecycle cleanup: GatewayPageController produces a stopped transition on page disconnect and invokes the page's invalidation callback, which now releases the metadata subscription. Agent and client changes also reset it.
Findings None None.
Security None None.

How this fits together

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

Before merge

None.

Agent review details

Security

None.

PR surface

Source -12, Tests +314, Docs +6. Total +308 across 7 files.

View PR surface stats
Area Files Added Removed Net
Source 1 43 55 -12
Tests 5 374 60 +314
Docs 1 6 0 +6
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 7 423 115 +308

Review metrics

None.

Technical review

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

Labels

Label justifications:

  • P2: Repairs stale model choices in an already-open Agents editor with a bounded UI impact.
  • 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 author, so the external-contributor proof gate does not apply. The supplied body reports matching real Gateway/browser refresh, failure recovery, stale-reply isolation, and settings readback; the corresponding scenario was inspected as source, not executed.

Evidence

What I checked:

  • Introduced production change: The complete pinned diff replaces page-owned promise results with an agent-scoped subscription. Errors preserve loaded choices; publication callbacks check subscription identity, Gateway source, client, request generation, and selected agent. (ui/src/pages/agents/agents-page.ts:578, 514d5fd30c74)
  • Existing publication owner: The shared store retires superseded writers before notifying subscribers, preserves consumer-held results after read failures, and keys entries by agent, session, and account. The application already invalidates this store on config.changed and chat.metadata.changed; Chat and New Session already consume subscriptions. (ui/src/lib/chat/chat-metadata-store.ts:133, 514d5fd30c74)
  • Lifecycle cleanup: GatewayPageController produces a stopped transition on page disconnect and invokes the page's invalidation callback, which now releases the metadata subscription. Agent and client changes also reset it. (ui/src/lit/gateway-page-controller.ts:135, 514d5fd30c74)
  • Current-main and release necessity: Fetched main still uses chatModelCatalogRequest and direct promise-result assignment without subscribing. The v2026.9.2 source also retains that implementation, so neither inspected revision establishes this fix as implemented. (ui/src/pages/agents/agents-page.ts:587, 3928bad9badf)
  • Browser scenario and reported results: The supplied PR body reports a failing baseline and successful built Gateway/browser verification. The inspected scenario uses real Gateway responses and provider HTTP discovery, injects delayed or failed metadata replies, checks recovery and retained drafts, and independently reads back primary/fallback settings through the CLI. No execution or artifact inspection was performed during this review. (ui/src/e2e/agent-file-lifecycle.real-gateway.e2e.test.ts:130, 514d5fd30c74)
  • Re-review continuity: The previous completed review records no findings or published rank-up moves. A targeted comparison confirms the production page is unchanged since that reviewed head; the latest ownership assertions correctly classify each prebuilt fixture using its private-server registration. (ui/src/pages/agents/agents-page.ts, 514d5fd30c74)

Likely related people:

  • Peter Steinberger: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Patrick Erichsen: 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 (2 earlier review cycles)
  • reviewed 2026-09-06T08:02:47.737Z sha 44db948 :: needs maintainer review before merge. :: none
  • reviewed 2026-09-06T08:16:50.495Z sha 9bd882d :: needs maintainer review before merge. :: none

@obviyus
obviyus merged commit 48acc5e into main Sep 6, 2026
131 checks passed
@obviyus
obviyus deleted the codex/agents-catalog-refresh branch September 6, 2026 08:42
@obviyus

obviyus commented Sep 6, 2026

Copy link
Copy Markdown
Collaborator Author

Merged in 48acc5ecb5fd.

  • Open Agents editors now follow catalog publication and retain choices through read failures without changing settings persistence.
  • Real Gateway/browser proof covers publication, delayed replies, error recovery, preserved drafts, and independent model/fallback readback. Production code shrinks by 12 lines.
  • Exact-head CI is green; independent ClawSweeper review is platinum (B), with no findings or rank-up moves.
  • The separate identity-save refresh warning is reproduced on the unchanged baseline and remains recorded in the PR as a follow-up.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 7, 2026
…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]>
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 docs Improvements or additions to documentation 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: L 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