Skip to content

fix(ui): refresh automation model suggestions on catalog changes - #139876

Merged
obviyus merged 2 commits into
mainfrom
codex/ui-consumer-catalog
Sep 6, 2026
Merged

obviyus merged 2 commits into
mainfrom
codex/ui-consumer-catalog

Conversation

@obviyus

@obviyus obviyus commented Sep 6, 2026 •

Copy link
Copy Markdown
Collaborator

Related: #136257, #135702.

What Problem This Solves

Automations kept old model suggestions after catalog publication. Failed reads silently removed suggestions.

Why This Change Was Made

The page owns its typed catalog read and follows existing publication events. Only the latest request for the current page and agent may update results or errors. Shared form normalization and sorting remain unchanged.

User Impact

Suggestions update without reloading. Failed reads show an error and retain same-agent choices; successful empty results clear them. Draft fields remain intact, and automatic reads do not trigger discovery.

Evidence

Built-browser checks reproduced stale suggestions and verified publication, recovery, empty results, and draft preservation. All 253 focused tests passed. Real Gateway/browser tests used CLI configuration changes to publish new choices and controlled read failures to verify recovery. All five real-Gateway automation scenarios passed. A separate sandbox fixture failure reproduced on the baseline.

Consumers: Automations suggestions now follow catalog publication and current-request ownership.

@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: M 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, 3:05 AM ET / 07:05 UTC.

ClawSweeper review

What this changes

The Automations page refreshes model suggestions after catalog or configuration changes, preserves suggestions on failed reads, and rejects stale responses without replacing the draft.

Merge readiness

✅ Ready for maintainer review

This PR remains useful: current main and v2026.9.2 still lack publication-driven automation model refreshes. No actionable introduced defect was found, and the related staging PR does not supersede this focused repair.

Priority: P2
Reviewed head: 2cef7076019232cc2b7c4c84989e0beb412b7236

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused owner-level repair with meaningful regression coverage and no actionable findings; execution results remain contributor-reported.
Proof confidence 🌊 off-meta tidepool Not applicable: Repository State identifies a MEMBER-authored PR, so the external-contributor gate does not apply. The captured body reports built-browser refresh, failure recovery, and draft preservation through the changed Automations page with synthetic Gateway responses; linked images were unavailable for inspection.
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 gate does not apply. The captured body reports built-browser refresh, failure recovery, and draft preservation through the changed Automations page with synthetic Gateway responses; linked images were unavailable for inspection.
Evidence reviewed 8 items Current main still needs the repair: The fetched main page subscribes only to cron events and loads model suggestions once per page state. Its helper clears suggestions when a read fails.
Latest release retains the old behavior: The v2026.9.2 page also listens only for cron events and gates suggestions on modelSuggestionsState; this release does not contain the proposed refresh behavior.
Request lifetime and failure handling: The introduced loader retains preparedOnly and configured view, accepts only the latest request for the current state and agent, preserves suggestions on failure, and clears the error on success. Existing GatewayPageController invalidation replaces page state on reconnect, source replacement, and detach.
Findings None None.
Security None None.

How this fits together

The Control UI’s Automations editor reads model suggestions from the Gateway’s prepared catalog. Those suggestions feed the model picker alongside configured models and models used by existing tasks.

flowchart TD
  A[Gateway publication event] --> B[Automations page]
  C[Selected agent and connection] --> B
  B --> D[Read prepared catalog]
  D --> E{Latest request?}
  E -->|Yes| F[Update suggestions or show error]
  E -->|No| G[Discard stale result]
  F --> H[Model picker and preserved draft]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source -17, Tests +101, Docs +1. Total +85 across 6 files.

View PR surface stats
Area Files Added Removed Net
Source 2 48 65 -17
Tests 3 127 26 +101
Docs 1 1 0 +1
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 6 176 91 +85

Review metrics

Metric Value Why it matters
Production versus regression coverage Production −17 lines; tests +101 lines Removing the duplicate mutable helper reduces production code while adding browser recovery and stale-response coverage.

Technical review

Best possible solution:

Keep catalog refresh and request retirement in the page lifecycle while retaining the existing shared suggestion normalization and prepared-only Gateway reads.

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

Yes, from source: leave Automations open and publish a changed catalog; current main has no notification handler that reloads its suggestions. The contributor reports a failing built-browser baseline, but this review did not execute it.

Is this the best way to solve the issue?

Yes. The patch repairs the existing page-owned read lifecycle, reuses established Gateway notifications, and preserves the shared normalization path without adding configuration or persistent state.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add P2: Stale automation model suggestions and silent read failures are bounded editor defects without evidence of broken task execution.
  • 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 gate does not apply. The captured body reports built-browser refresh, failure recovery, and draft preservation through the changed Automations page with synthetic Gateway responses; linked images were unavailable for inspection.

Label justifications:

  • P2: Stale automation model suggestions and silent read failures are bounded editor defects without evidence of broken task execution.
  • 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 gate does not apply. The captured body reports built-browser refresh, failure recovery, and draft preservation through the changed Automations page with synthetic Gateway responses; linked images were unavailable for inspection.

Evidence

What I checked:

  • Current main still needs the repair: The fetched main page subscribes only to cron events and loads model suggestions once per page state. Its helper clears suggestions when a read fails. (ui/src/pages/cron/cron-page.ts:118, 3e234f1cf19b)
  • Latest release retains the old behavior: The v2026.9.2 page also listens only for cron events and gates suggestions on modelSuggestionsState; this release does not contain the proposed refresh behavior. (ui/src/pages/cron/cron-page.ts:118, 3928bad9badf)
  • Request lifetime and failure handling: The introduced loader retains preparedOnly and configured view, accepts only the latest request for the current state and agent, preserves suggestions on failure, and clears the error on success. Existing GatewayPageController invalidation replaces page state on reconnect, source replacement, and detach. (ui/src/pages/cron/cron-page.ts:263, 2cef70760192)
  • Existing normalization and protocol boundary: The form-suggestion builder still trims, sorts, and deduplicates catalog, configured, and saved-task model IDs. ModelCatalogResult defines the Gateway response as a models array; the patch consumes this existing OpenClaw contract without changing provider or Codex behavior. (ui/src/pages/cron/form-suggestions.ts:37, 2cef70760192)
  • Focused regression coverage: Inspected browser coverage exercises both publication events, replacement options, retained options after failure, empty recovery, draft preservation, and absence of mutation requests. Lifecycle coverage delays successes and errors across five retirement scenarios. Tests were not executed during this read-only review; the introduced diff passes git diff --check. (ui/src/e2e/cron-agent-ownership.e2e.test.ts:34, 2cef70760192)
  • Captured contributor evidence: The supplied body at sourceRevision 50f0342474e3f1f8dbc5633045b8a1ebcd207d1a3dc3bed05cff251436ab53b1 reports baseline failure and candidate success through the built Control UI with synthetic Gateway responses, plus independent browser acceptance. Both linked before/after image fetches failed in this reviewer environment; their pixels were not inspected. No live provider acquisition is claimed. (2cef70760192)

Likely related people:

  • Peter Steinberger: 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.

@obviyus
obviyus merged commit 8c03d61 into main Sep 6, 2026
129 of 131 checks passed
@obviyus
obviyus deleted the codex/ui-consumer-catalog branch September 6, 2026 07:36
@obviyus

obviyus commented Sep 6, 2026

Copy link
Copy Markdown
Collaborator Author

Landed through the guarded merge at 8c03d61c62caefd42fe028a9a2d146b6f45f9a48.

  • Bug: Automations kept old model suggestions after catalog publication and silently cleared them on read failure.
  • Fix: The page owns prepared catalog refreshes and accepts only its latest current request, preserving draft fields and prior suggestions during failures.
  • Proof: Real Gateway baseline fails; candidate refresh and recovery pass. All five real-Gateway automation cases, 253 focused tests, two bundled-browser scenarios, and independent C1–C5 browser acceptance pass.
  • Gates: Exact-head local review passes at tier B with no findings; CI run 34019083337 is green. No CI exception or merge recovery was used.
  • Scope: Production −17 lines. The broader source draft remains separate; auth, schema, protocol and operator state are unchanged.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 7, 2026
…nclaw#139876)

Related: openclaw#136257

## What Problem This Solves

Fixes an issue where users leaving Automations open see old model suggestions after the Gateway publishes a changed catalog. Failed catalog reads also silently remove suggestions instead of showing the failure.

## Why This Change Was Made

The Automations page now owns its typed catalog read and refreshes it on the existing configuration and chat-metadata notifications. Only the latest request for the current page and agent may publish results or errors. This removes the separate mutable suggestion helper and its duplicate parsing; the existing form-suggestion builder still owns normalization and sorting.

Automatic reads retain `preparedOnly: true`. The change uses existing Gateway methods and does not alter provider discovery, authentication, configuration, session/default selection, or automation execution.

## User Impact

New suggestions appear without reloading the page. Failed reads show an error while preserving the previous suggestions for the same agent and connection. Successful reads, including empty catalogs, replace them and clear the error. Draft fields remain unchanged.

## Evidence

- Built-browser baseline at `b9a935ddeddc5e6545135912a69bee6f7051e90a`: initial model is visible; after `chat.metadata.changed`, the replacement option remains absent. The existing all-agents ownership scenario passes.
- Built-browser candidate: both scenarios pass, covering both publication events, removal of old options, visible failure, retained options, empty recovery and draft preservation. This uses the real built Control UI with synthetic Gateway responses; it does not claim live provider acquisition.
- Focused unit tests: 253 pass across the cron page, lifecycle, form-suggestion and cron library suites. Delayed successes and errors cannot publish after a newer request, agent switch, reconnect, Gateway replacement or page removal. Existing automation coalescing and mutation coverage remains intact.
- Source-blind browser acceptance: all five contract clauses pass, including ten delayed-response orderings. All 33 catalog reads use prepared configured parameters; 244 captured requests contain no configuration, authentication, session-default or automation writes. The validator exercised the built UI independently and kept the same synthetic-provider limitation.
- Real Gateway proof: coupled baseline and candidate UI/runtime builds run the normal Gateway. A supported CLI config change emits real `config.changed` and `chat.metadata.changed` notifications. The baseline keeps the old list; the candidate reads the published list and removes the retired option. A controlled transport fault replaces real catalog replies with `UNAVAILABLE` after recording them; the error appears, prior options remain, and another real publication restores reads without losing the draft. Catalog contents and notifications are never injected in this test. All five tests in the existing real-Gateway automation suite pass, including the new case.
- Independent code review: no actionable findings through P2. Formatting, syntax-only lint, line/assertion ratchets and UI copy verification pass. Typechecking is left to CI.
- Production: **−17 lines**. Tests/support: **+272 lines**. Docs: **+1 line**. Validation metadata: **0 net lines**, with the assertion allowance reduced from 13 to 11. The test growth adds built-browser refresh/recovery, real Gateway publication and five request-ownership cases; one obsolete helper test is removed.

Focused commands:

```sh
node scripts/run-vitest.mjs ui/src/pages/cron/cron-page.test.ts ui/src/pages/cron/cron-page.lifecycle.test.ts ui/src/pages/cron/form-suggestions.test.ts ui/src/lib/cron/index.test.ts
node scripts/run-vitest.mjs run --config test/vitest/vitest.ui-e2e.config.ts --configLoader runner ui/src/e2e/cron-agent-ownership.e2e.test.ts --maxWorkers=1
node scripts/run-vitest.mjs run --config test/vitest/vitest.ui-e2e.config.ts --configLoader runner ui/src/e2e/cron-duration-save.real-gateway.e2e.test.ts --maxWorkers=1
```

Known unrelated baseline test: `src/agents/sandbox/browser.create.test.ts:606` assumes no protected skill mounts beneath its fixed temporary workspace. Independent controls on unmodified main `b9a935ddeddc5e6545135912a69bee6f7051e90a` pass with no skills directory and reproduce the same hash-label failure when only that directory exists. The production mount behavior from openclaw#135702 is intentional; the test fixture needs isolation. This PR changes no sandbox owner, dependency, runner or hash input. The exact completed CI result still determines whether the guarded unrelated-failure route is needed.

Before: initial catalog choice; the baseline keeps this list after publication.

![Automations model suggestions before refresh](https://github.com/user-attachments/assets/d77cd191-3edc-448b-bae1-13469e2fbf2d)

After: the published replacement appears and the draft remains.

![Automations model suggestions after refresh](https://github.com/user-attachments/assets/ad16503d-1073-44b3-8259-13183c38fab5)

Real Gateway flow: the controlled read failure is visible while the unsaved draft remains.

![Real Gateway catalog read failure preserves the draft](https://github.com/user-attachments/assets/30ac4e46-9f01-416c-9a27-0496c121d5ba)

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: 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