Skip to content

fix(ui): preserve plugin selection and restart progress - #143671

Merged
steipete merged 2 commits into
mainfrom
codex/fix-plugin-ui-request-ownership
Sep 10, 2026
Merged

steipete merged 2 commits into
mainfrom
codex/fix-plugin-ui-request-ownership

Conversation

@steipete

@steipete steipete commented Sep 10, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes plugin-page requests that can overwrite a newer choice: delayed ClawHub metadata could restore an old inspection after autosave, and a slow first Install request could replace the second plugin's review or active installation dialog. Also fixes the install dialog reporting failure when the Gateway restarts before acknowledging a committed plugin change.

Why This Change Was Made

Keep the same request identity through local inspection and optional catalog enrichment. Reserve the existing wizard attempt before loading installation details, so later selection, close, route changes, and connection retirement invalidate stale work while a busy installation keeps its owner. Reuse one catalog refresh method and remove redundant checks.

During a committed restart, transport loss leaves the wizard waiting for its existing boot and inventory confirmation. Explicit server rejections still show an error, and the existing deadline still offers a retry if the restart stalls. No mutation is retried automatically and no shared client or restart policy changes. The complete change adds 21 production lines.

User Impact

Current settings and the latest selected plugin remain visible. An active installation retains its dialog and can finish after the expected Gateway reconnect, even when that restart interrupts its acknowledgement.

Evidence

  • 77 focused cases across 8 files pass on the final source: 20 browser cases and 57 mounted-page/model/policy cases.
  • The original three request-ordering scenarios fail before their repair and pass afterward. The final browser run includes all three on the final committed test source.
  • The permanent restart table first failed only the lost-acknowledgement case on original production; acknowledged and explicit-rejection controls passed. All three pass after the repair, alongside existing stalled-restart, same-boot, cancellation, consent, setup, and retry controls.
  • All 20 canonical changed-file checks pass, including types, formatting, i18n, dependency and export checks, and lint.
  • Fresh independent Codex review of the complete staged change found no actionable findings through P2.

An earlier CI run also exposed an unrelated catalog request-order assertion, fixed separately in #143710. Its existing restart test timed out without a diagnostic artifact; the controlled browser reproduction establishes a valid lost-acknowledgement failure, not the unknown interleaving in that CI run.

The screenshots show the selection and metadata repairs using synthetic data. Restart recovery is covered by browser assertions. No real package installation, live Gateway, or provider was used.

Scenario Before After
Old metadata after autosave Before: old metadata restores Original skill After: Current skill remains visible
Late first Install response Before: Alpha replaces the selected Beta review After: Beta remains selected
Late response during installation Before: active Beta installation is replaced by Alpha review After: Beta retains its installation progress

Keep the newest plugin inspection and installation choice when older catalog requests finish. Bind preparation to the existing wizard lifecycle and share the catalog refresh path.
@clawsweeper

clawsweeper Bot commented Sep 10, 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: L maintainer Maintainer-authored PR labels Sep 10, 2026
@steipete steipete self-assigned this Sep 10, 2026
@steipete
steipete marked this pull request as ready for review September 10, 2026 04:10
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. 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 10, 2026
@clawsweeper

clawsweeper Bot commented Sep 10, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 10, 2026, 1:43 AM ET / 05:43 UTC (Revision 2).

ClawSweeper review

What this changes

Preserves the latest plugin selection and inspection results, keeps installation progress through an interrupted restart acknowledgement, and adds regression coverage and documentation.

Merge readiness

✅ Ready for maintainer review

This remains a useful, focused repair: current main retains the affected paths, and no actionable introduced defect was found. The linked merged test fix does not supersede this work.

Priority: P2
Reviewed head: 86ba12f10351169253c45d4ead3b7f8c3442ceee

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused lifecycle repair with useful before/after screenshots, targeted regression controls, and no actionable findings.
Proof confidence 🐚 platinum hermit (4/6) Not applicable: The external-contributor proof gate does not apply to this verified maintainer PR. Inspected screenshots support the visible selection and inspection repairs; restart recovery is supported by supplied mocked-Gateway browser assertions, not live installation evidence.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The external-contributor proof gate does not apply to this verified maintainer PR. Inspected screenshots support the visible selection and inspection repairs; restart recovery is supported by supplied mocked-Gateway browser assertions, not live installation evidence.
Evidence reviewed 10 items Introduced production changes: The pinned merge-base comparison shows request identity retained through optional inspection enrichment, installation attempts reserved before catalog loading, and disconnected transport errors left to existing reconnect confirmation.
Restart completion remains bounded: Disconnect invalidation arms the existing 30-second deadline; resume requires the current owner, a connected Gateway, a different boot ID, and matching inventory. Explicit GatewayRequestError rejections still enter the error state.
Transport ordering supports the repair: The protocol client rejects pending requests and synchronously invokes its close callback; the Gateway store publishes the disconnected phase before promise rejection handlers run. This supports the wizard's disconnected-state check without changing shared transport policy.
Findings None None.
Security None None.

How this fits together

The Control UI plugin page combines Gateway inventory with optional ClawHub metadata and guides installation, configuration, and enablement. Its wizard tracks the selected plugin through restart and checks the returning Gateway inventory before displaying completion.

flowchart TD
  A[Plugin selection] --> C[Current request check]
  B[Inventory and catalog responses] --> C
  C --> D[Review and installation]
  D --> E[Gateway restart]
  E --> F[New boot and inventory confirmation]
  F --> G[Ready or visible retry]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source +21, Tests +538, Docs +2. Total +561 across 6 files.

View PR surface stats
Area Files Added Removed Net
Source 2 70 49 +21
Tests 3 627 89 +538
Docs 1 2 0 +2
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 6 699 138 +561

Review metrics

Metric Value Why it matters
Production versus regression coverage production +21 lines; tests +538 lines Production growth extends existing lifecycle ownership, while the larger test delta exercises observable request-order and restart outcomes.

Technical review

Best possible solution:

Keep selection and restart progress owned by the existing wizard lifecycle, with completion gated on refreshed inventory and a new Gateway boot.

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

Yes, from source: delayed catalog responses can overwrite newer inspection or selection state, and a restart socket close reaches the unconditional error path on current main. The supplied regressions target those interleavings; this review did not execute them.

Is this the best way to solve the issue?

Yes. Reusing existing request identity, wizard ownership, boot confirmation, and timeout handling repairs the owning boundaries without adding configuration, automatic mutation retries, or a parallel installation path.

AGENTS.md: found and applied where relevant.

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

Labels

Label justifications:

  • P2: Repairs bounded plugin-management races and misleading restart failures without evidence of a widespread runtime outage.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit 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 external-contributor proof gate does not apply to this verified maintainer PR. Inspected screenshots support the visible selection and inspection repairs; restart recovery is supported by supplied mocked-Gateway browser assertions, not live installation evidence.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence. The external-contributor proof gate does not apply to this verified maintainer PR. Inspected screenshots support the visible selection and inspection repairs; restart recovery is supported by supplied mocked-Gateway browser assertions, not live installation evidence.

Evidence

What I checked:

  • Introduced production changes: The pinned merge-base comparison shows request identity retained through optional inspection enrichment, installation attempts reserved before catalog loading, and disconnected transport errors left to existing reconnect confirmation. (ui/src/pages/plugins/plugins-page.ts:489, 86ba12f10351)
  • Restart completion remains bounded: Disconnect invalidation arms the existing 30-second deadline; resume requires the current owner, a connected Gateway, a different boot ID, and matching inventory. Explicit GatewayRequestError rejections still enter the error state. (ui/src/pages/plugins/install-wizard-controller.ts:468, 86ba12f10351)
  • Transport ordering supports the repair: The protocol client rejects pending requests and synchronously invokes its close callback; the Gateway store publishes the disconnected phase before promise rejection handlers run. This supports the wizard's disconnected-state check without changing shared transport policy. (packages/gateway-client/src/protocol-client.ts:447, 86ba12f10351)
  • Current-main necessity and release check: Both production files on fetched main still match the pre-repair behavior. The latest release tag does not contain the wizard-controller path, so this review establishes no shipped fix. (ui/src/pages/plugins/install-wizard-controller.ts, e17752535e22)
  • Latest-release path inspection: The tree lookup returned no entry for this controller in v2026.9.3; no release-level reproduction or fix claim is inferred from that absence. (ui/src/pages/plugins/install-wizard-controller.ts, 1391f7cd2d40)
  • Inspected visual evidence and validation limits: Inspected all four prepared images: the metadata pair shows Original skill becoming Current skill, and the selection pair shows Alpha replaced by the intended Beta review. These use synthetic browser fixtures. The supplied body reports 77 focused passing cases and explicitly states that restart recovery used browser assertions without a live Gateway or package installation. Tests were not executed during this read-only review. (ui/src/e2e/plugins-request-ownership.e2e.test.ts:130, 86ba12f10351)

Likely related people:

  • 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 (1 earlier review cycle)
  • reviewed 2026-09-10T04:16:13.276Z sha f738441 :: needs maintainer review before merge. :: none

Keep the committed installation waiting for its existing reconnect and boot confirmation when the restart closes its socket before acknowledgement. Preserve explicit Gateway rejections and the existing timeout. Extend the setup flow regression and explain reconnect behavior in the plugin guide.
@openclaw-barnacle openclaw-barnacle Bot added the docs Improvements or additions to documentation label Sep 10, 2026
@steipete steipete changed the title fix(ui): preserve plugin request ownership fix(ui): preserve plugin selection and restart progress Sep 10, 2026
@steipete
steipete merged commit 31e2ce7 into main Sep 10, 2026
132 checks passed
@steipete
steipete deleted the codex/fix-plugin-ui-request-ownership branch September 10, 2026 06:07
@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 11, 2026
)

* fix(ui): preserve plugin request ownership

Keep the newest plugin inspection and installation choice when older catalog requests finish. Bind preparation to the existing wizard lifecycle and share the catalog refresh path.

* fix(ui): retain plugin installation progress through restart

Keep the committed installation waiting for its existing reconnect and boot confirmation when the restart closes its socket before acknowledgement. Preserve explicit Gateway rejections and the existing timeout. Extend the setup flow regression and explain reconnect behavior in the plugin guide.
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. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. 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