Skip to content

fix: prevent false errors during successful plugin uninstall - #157728

Merged
Patrick-Erichsen merged 2 commits into
mainfrom
codex/plugin-uninstall-recovery
Sep 25, 2026
Merged

Patrick-Erichsen merged 2 commits into
mainfrom
codex/plugin-uninstall-recovery

Conversation

@Patrick-Erichsen

@Patrick-Erichsen Patrick-Erichsen commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes a brief “Plugin not found” error while an uninstall is still running, even when removal succeeds.

User Impact

The selected plugin stays stable while removal finishes, then becomes installable again when available in the catalog. A removed local-only plugin returns to Plugins. Genuine removal failures and warnings remain visible, including failures reported after the files have already been removed.

Why This Change Was Made

Uninstall publishes plugin changes before its response completes. Those changes previously triggered inspection of the disappearing plugin. The page now retires earlier reads, defers inspection and inventory replacement for the selected removal, and reconciles after the operation settles. Installed and catalog detail request ownership share the existing detail loader; duplicate page loading paths were removed.

This is independent of the installation recovery PR. No configuration, storage, or protocol changes.

Evidence

Matching Calendar Plus fixture, light theme, 1440 × 1000 viewport; screenshots crop the same content area. Real Control UI against an isolated mock Gateway. Screenshot baseline: 23f89eecc93; candidate: 9b8f12275cf. The before video was captured at f8e2fb2f52c, whose uninstall code is identical to the screenshot baseline; the after video uses this PR’s candidate.

Before: false error while removal is pending After: stable details while removal is pending
Before: Plugin calendar-plus not found during uninstall After: pending uninstall without the false error

Before — click Uninstall, confirm, observe the false error, then successful removal:

before.mp4

After — the same sequence completes without the error:

after.mp4
  • The regression reproduced before the fix and recorded the transient error with a DOM observer. Afterward no false error appears, and Install returns after successful removal.
  • Independent branch validation: 12 lifecycle unit tests and all 7 lifecycle browser scenarios passed. Coverage includes inspection begun before/during removal, actual failure recovery, warnings, local-only removal, reinstall, and an old completion after Gateway replacement.
  • Changed-file checks, UI build, and independent review completed. A suspected stale-completion finding was ruled out by the existing Gateway/mutation guard and a regression proving that the replacement Gateway's selection and controls remain intact.
  • Production delta: +82 lines, covering removal ownership and reconciliation after success or partial failure; tests: +285 lines. Existing detail loading moved to its owner rather than adding a second path.

The work Gateway has not been deployed or restarted by this change.

One-worker test costs (macOS arm64, Node 24.19.0, head 9b8f12275cf): plugins-page.lifecycle.test.ts 4.32s wall / 3.18s Vitest (12 passed); plugins-lifecycle.e2e.test.ts 16.66s wall / 15.66s Vitest (7 passed, including a 7.95s production build). Each ran separately with --maxWorkers=1. The initial CI run deferred all UI lanes for release priority, so it produced no UI test duration; a full rerun was requested after that priority cleared.

CI regression repair

The full catalog browser suite caught an available local plugin being mistaken for a removed installation. The detail loader now requires the Gateway-recorded prior installed fact before redirecting a missing local selection. This is one production condition; the existing disabled-install scenario is the regression test. The identical full-file order failed before (14 passed, 1 failed; 51.22s wall) and passed after. All 34 catalog, uninstall-browser and lifecycle-unit cases passed together in 24.91s wall, including actual removal, failed removal, available official plugins, navigation and Gateway replacement. A fresh P0–P2 AutoReview was scoped-clean.

Also incorporated the existing main fixture repair 229ab8a1fe9 for the unrelated guest-question timeout, along with main through 63d299c31b0. The two plugin commits are patch-identical across that rebase. Current CI is bound to e13b351738e288d8a79bef83e7eae0c6c170ad5e. The previous hosted lifecycle unit suite passed all 12 cases in 0.388s test time (0.774s including module start/finish).

@clawsweeper

clawsweeper Bot commented Sep 24, 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.

@Patrick-Erichsen
Patrick-Erichsen marked this pull request as ready for review September 24, 2026 23:47
@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 24, 2026
@clawsweeper

clawsweeper Bot commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

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

ClawSweeper review

What this changes

The Control UI Plugins page keeps selected plugin details stable during uninstall, then reconciles inventory and feedback after removal settles, with lifecycle regression tests.

Merge readiness

✅ Ready for maintainer review

Current main still permits the transient uninstall error. The branch addresses the race through the existing Control UI detail path, with convincing visual proof and focused regression coverage; I found no introduced blocker.

Priority: P2
Reviewed head: e13b351738e288d8a79bef83e7eae0c6c170ad5e

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) Direct visual proof and focused lifecycle coverage support a sound, bounded UI repair.
Proof confidence 🦞 diamond lobster (5/6) ✨ media proof bonus Sufficient (screenshot): The changed Control UI detail path was exercised in a real browser against an isolated mock Gateway: inspected before/after screenshots show the pending-removal false banner disappearing, while the reported browser scenario checks completion and Install returning. No stored-data contract changes.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (screenshot): The changed Control UI detail path was exercised in a real browser against an isolated mock Gateway: inspected before/after screenshots show the pending-removal false banner disappearing, while the reported browser scenario checks completion and Install returning. No stored-data contract changes.
Evidence reviewed 6 items Current main retains the race: The inventory completion path replaces the result and reloads selected details without a pending-uninstall guard. These production files are unchanged from the PR merge base on fetched main.
Introduced uninstall guard: The patch holds the selected inventory during removal, retires earlier detail reads, and refreshes after the operation settles.
Current request ownership: Inspection results publish only while both the Gateway scope and the selected detail request remain current. The catalog loader also checks the previously installed local identity before redirecting a missing selection.
Findings None None.
Security None None.

How this fits together

The Control UI Plugins page receives inventory and change events from the Gateway and loads details for the selected plugin. It sends uninstall requests and renders the resulting details, install actions, and feedback.

flowchart LR
A[Plugin route] --> C[Plugins page]
B[Gateway inventory and events] --> C
C --> D[Detail loading]
C --> E[Uninstall request]
E --> F[Gateway result]
F --> C
D --> G[Visible details and feedback]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source +83, Tests +285. Total +368 across 4 files.

View PR surface stats
Area Files Added Removed Net
Source 2 188 105 +83
Tests 2 286 1 +285
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 4 474 106 +368

Review metrics

Metric Value Why it matters
Code growth by role production +82, tests +285 net lines The stated production growth serves uninstall ownership and reconciliation; the added tests cover the visible race and recovery paths.
Changed test cost 4.32s unit and 16.66s browser wall time The PR body supplies one-worker measurements for both changed lifecycle test files.

Technical review

Best possible solution:

Keep the Gateway as the inventory authority while ensuring an in-progress removal cannot publish a stale missing-plugin error and genuine failures remain visible.

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

Yes. Current-main source shows that a Gateway change event can reload details while the selected plugin is disappearing, and the supplied baseline screenshot shows the false banner; this read-only review did not execute the path.

Is this the best way to solve the issue?

Yes. The patch fences transient reads at the existing page and detail-loader owners, then reconciles against Gateway inventory without changing plugin APIs or stored state.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against bfa7e8dff071.

Labels

Label changes:

No label changes.

Label justifications:

  • P2: The PR addresses a misleading plugin-removal error in the Control UI with limited blast radius.
  • 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 changed Control UI detail path was exercised in a real browser against an isolated mock Gateway: inspected before/after screenshots show the pending-removal false banner disappearing, while the reported browser scenario checks completion and Install returning. No stored-data contract changes.
  • proof: sufficient: Contributor real behavior proof is sufficient. The changed Control UI detail path was exercised in a real browser against an isolated mock Gateway: inspected before/after screenshots show the pending-removal false banner disappearing, while the reported browser scenario checks completion and Install returning. No stored-data contract changes.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence. The changed Control UI detail path was exercised in a real browser against an isolated mock Gateway: inspected before/after screenshots show the pending-removal false banner disappearing, while the reported browser scenario checks completion and Install returning. No stored-data contract changes.

Evidence

What I checked:

  • Current main retains the race: The inventory completion path replaces the result and reloads selected details without a pending-uninstall guard. These production files are unchanged from the PR merge base on fetched main. (ui/src/pages/plugins/plugins-page.ts:144, bfa7e8dff071)
  • Introduced uninstall guard: The patch holds the selected inventory during removal, retires earlier detail reads, and refreshes after the operation settles. (ui/src/pages/plugins/plugins-page.ts:357, e13b351738e2)
  • Current request ownership: Inspection results publish only while both the Gateway scope and the selected detail request remain current. The catalog loader also checks the previously installed local identity before redirecting a missing selection. (ui/src/pages/plugins/plugins-detail-loader.ts:52, e13b351738e2)
  • Browser regression coverage: The browser scenario observes error banners throughout pending removal, injects a missing-plugin inspection response, and asserts that no false banner appeared before Install returns. (ui/src/pages/plugins/plugins-lifecycle.e2e.test.ts:183, e13b351738e2)
  • Inspected visual proof: The downloaded before screenshot shows the missing-plugin banner during removal; the matching after screenshot shows the selected details without it. The supplied videos were not inspected because local preparation reported “ffprobe failed: spawnSync ffprobe ENOENT”; the screenshots directly show the central visual result.
  • Relevant merged feature history: Current-main history connects Patrick Erichsen to the combined installed/catalog overview and plugin lifecycle feedback, and Peter Steinberger to plugin management and reload work. This supports routing without asserting who introduced the specific race. (ui/src/pages/plugins/plugins-page.ts, a6f758c48555)

Likely related people:

  • Patrick-Erichsen: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Peter Steinberger: 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-24T23:54:55.527Z sha 9b8f122 :: blocked before merge. :: none
  • reviewed 2026-09-25T04:12:30.015Z sha 9b8f122 :: needs maintainer review before merge. :: none

@Patrick-Erichsen Patrick-Erichsen self-assigned this Sep 25, 2026
@Patrick-Erichsen
Patrick-Erichsen force-pushed the codex/plugin-uninstall-recovery branch from 9b8f122 to e13b351 Compare September 25, 2026 04:27
@Patrick-Erichsen
Patrick-Erichsen enabled auto-merge (squash) September 25, 2026 04:31
@Patrick-Erichsen
Patrick-Erichsen merged commit e4ab2d3 into main Sep 25, 2026
127 of 129 checks passed
@Patrick-Erichsen
Patrick-Erichsen deleted the codex/plugin-uninstall-recovery branch September 25, 2026 04:38
@Patrick-Erichsen

Copy link
Copy Markdown
Contributor Author

Merged via squash auto-merge.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 26, 2026
…w#157728)

* fix: prevent false errors during successful plugin uninstall

* fix: retain available local plugin details during 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 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: 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