Skip to content

fix(plugins): remove owned load paths before uninstalling files - #140065

Merged
steipete merged 1 commit into
mainfrom
codex/qa-uninstall-symlink-20260906
Sep 6, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/qa-uninstall-symlink-20260906

Conversation

@steipete

@steipete steipete commented Sep 6, 2026 •

Copy link
Copy Markdown
Contributor

Closes #140063.

What Problem This Solves

Fixes an issue where uninstalling a copied plugin reports success but leaves invalid configuration when a load path is a symlink to the removed package. The first plan identifies the alias correctly; deleting its target before the final plan destroys the filesystem identity needed to recognize it.

Why This Change Was Made

The CLI and managed-plugin lifecycle now apply the already-planned load-path cleanup in their existing guarded disable write, before deleting files. The shared helper retains settings and install ownership for a safe retry if removal fails. The final config reread and replan still preserve concurrent edits, and the success summary retains the fact that the load path was removed earlier.

Production is net +18 lines across three owners; tests are +277, and docs +2. The growth preserves valid interim config, retry state, and truthful summaries without another write, path cache, fallback, or deletion policy. Removing the final replan would lose concurrent edits; applying all cleanup before file removal would discard retry state prematurely.

User Impact

Uninstall removes matching load-path references while their target still exists and finishes with valid config. Original plugin source files and unrelated paths are preserved. Dry-run and keep-files behavior remain intact; failed file removal leaves the plugin disabled and tracked for retry. No configuration option, schema, migration, public SDK, or protocol change is added.

Evidence

Candidate 85a5762c631d21b288e0eacf5119190a6315352d, based on 9c0cf2b6a56f0da6c5c23928eb63f8223f980449.

  • Real planner/filesystem reproduction failed before the production edit: the initial plan removed the alias, deleting the package made it dangling, and the final plan retained it. Two unchanged package/entry-alias regression cases also failed before the repair.
  • 142 tests passed across CLI and plugin owners, including real symlinks, directory deletion, concurrent config edits, failed deletion/retry, source preservation, keep-files and ownership controls. Full changed checks and targeted docs checks passed.
  • Fresh complete-source managed Codex review returned two clean P0–P2 passes with no actionable findings. The local ciArtifacts build passed in 139.729 seconds; dependency, source, runtime/UI identity, full artifact hashes, modes and symlinks were verified.
  • Real packaged CLI proof passed on Blacksmith Testbox 34028648873. One invocation independently built, packed, checked and globally installed both revisions, then ran copied-plugin install → symlink config → validation → dry-run → uninstall → fresh validation/registry inspection. The baseline uninstall exited 0 but left the alias and fresh validation exited 1. The candidate removed the alias, validated successfully, removed the install record, retained the disabled marker, and truthfully reported load-path removal. Both revisions preserved source/unrelated files and dry-run state.
  • The first Testbox attempt stopped before any package scenario because npm 11.17 was below the documented tooling floor. A temporary task-local npm 11.19 bootstrap enabled the unchanged proof payload; the successful native wrapper command exited 0 in 9m12s. The canonical package checker separately used its bundled npm 11.17 for inventory comparison and passed. No model provider or channel was contacted by the proof.
  • Current-main source composition was checked at c2ffbec6fc9af0da51921acfb5bbb19b66aecd78: all seven patch paths have unchanged base/main state. The install-only config recovery rewrite does not apply to uninstall, and existing config/include and ownership guards remain in force.

Package SHA-256 values:

Revision Tarball SHA-256
Before d5973d2f809284c4ba325d3de254d52b94eb46eb5513adcb1ec501cfe384bb4d
After 207647d7385e5c8bfb5cdd831cfc1ead50e0aeee28eb12036182e116f5f7b942

The managed API caller has real-filesystem regression coverage; the installed product flow exercises the public CLI. This does not add an invalid-config bypass or change include ownership. The introducing commit and first affected release are unknown. CI 34029533192 passed on the exact published head. The 11:24 UTC ClawSweeper review found no actionable findings or before-merge items.

The proof command and evidence collection exited 0. All 37 command output hashes were independently checked from 78 downloaded evidence files, and the Testbox lease is confirmed completed after normal cleanup.

Persist the planned load-path cleanup with the guarded disable write,
while realpath identity still exists. Keep removal failures retryable,
preserve later config edits, and report the completed alias cleanup.
@steipete steipete 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 cli CLI command changes size: M maintainer Maintainer-authored PR labels Sep 6, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. 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: blocked before merge. Reviewed September 6, 2026, 7:37 AM ET / 11:37 UTC.

ClawSweeper review

What this changes

The PR removes owned plugin load-path aliases before deleting package files, preserves retry state and concurrent configuration edits, and updates regression coverage and uninstall documentation.

Merge readiness

⛔ Blocked before merge - 1 item remains

This remains a useful, focused fix for an unresolved uninstall defect on fetched main. No actionable introduced bugs were found, and the supplied packaged CLI evidence supports the repair.

Priority: P2
Reviewed head: 85a5762c631d21b288e0eacf5119190a6315352d

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused lifecycle repair with relevant packaged before/after evidence and regression coverage; no blocking correctness concern was found.
Proof confidence 🦞 diamond lobster (5/6) ✨ media proof bonus Sufficient (linked_artifact): The captured Testbox account exercises the changed CLI lifecycle using separately installed baseline and candidate packages in isolated Linux state, observing alias removal and successful fresh config validation after the fix; managed-service coverage is supplemental. Artifact retrieval was unavailable during this review, which does not invalidate the supplied proof.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (linked_artifact): The captured Testbox account exercises the changed CLI lifecycle using separately installed baseline and candidate packages in isolated Linux state, observing alias removal and successful fresh config validation after the fix; managed-service coverage is supplemental. Artifact retrieval was unavailable during this review, which does not invalidate the supplied proof.
Evidence reviewed 8 items Introduced change and preserved lifecycle: Both lifecycle callers pass the initial cleanup plan into the existing guarded disable write. The helper copies only planned load configuration while retaining plugin settings and install ownership; deletion failure still stops final cleanup, and successful deletion still triggers a config reread.
Shared repair boundary: The optional planned configuration changes the existing internal helper, not a public plugin SDK contract. Its original two-argument planner use remains intact.
Current-main necessity: The comparison returned no differences for the two lifecycle callers, shared helper, uninstall planner, or path-cleanup implementation between the PR merge base and fetched main. Main therefore retains the pre-fix ordering.
Findings None None.
Security None None.

How this fits together

OpenClaw’s plugin lifecycle accepts uninstall requests from the CLI and managed-plugin service. It resolves package ownership, updates configuration, deletes managed files, and refreshes the installed plugin index.

flowchart TD
 A[Uninstall request] --> B[Resolve package ownership]
 B --> C[Plan matching path cleanup]
 C --> D[Disable plugin and remove owned references]
 D --> E{File removal succeeds?}
 E -->|No| F[Retain tracked retry state]
 E -->|Yes| G[Reread config and commit final cleanup]
 G --> H[Refresh index and report outcome]
Loading

Before merge

  • Resolve merge risk (P1) - Raw Testbox artifacts could not be independently reopened in this environment; the proof assessment relies on the complete captured before/after account and its pinned candidate identity.
Agent review details

Security

None.

PR surface

Source +18, Tests +277, Docs +2. Total +297 across 7 files.

View PR surface stats
Area Files Added Removed Net
Source 3 24 6 +18
Tests 3 279 2 +277
Docs 1 2 0 +2
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 7 305 8 +297

Review metrics

Metric Value Why it matters
Production versus regression coverage production +18 net lines; tests +277 net lines The production growth reuses the existing write phase; added coverage protects alias identity, retry state, and concurrent edits.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #140063
Summary: This PR is the explicit candidate fix for the linked open symlink-uninstall report.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Keep alias cleanup in the existing guarded disable phase, retaining ownership until deletion succeeds and preserving the final config reread.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Keep alias cleanup in the existing guarded disable phase, retaining ownership until deletion succeeds and preserving the final config reread.

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

Yes: source establishes that deleting the symlink target before replanning loses canonical path identity, and the supplied packaged baseline run reports the resulting validation failure. This review did not execute the reproduction.

Is this the best way to solve the issue?

Yes: reusing the existing guarded write fixes the ordering at both lifecycle owners without changing path matching, adding storage, or discarding the final concurrency-preserving reread.

AGENTS.md: found and applied where relevant.

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

Labels

Label justifications:

  • P2: This repairs a concrete plugin-uninstall configuration defect with a limited trigger: owned symlink load paths.
  • 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 (linked_artifact): The captured Testbox account exercises the changed CLI lifecycle using separately installed baseline and candidate packages in isolated Linux state, observing alias removal and successful fresh config validation after the fix; managed-service coverage is supplemental. Artifact retrieval was unavailable during this review, which does not invalidate the supplied proof.
  • proof: sufficient: Contributor real behavior proof is sufficient. The captured Testbox account exercises the changed CLI lifecycle using separately installed baseline and candidate packages in isolated Linux state, observing alias removal and successful fresh config validation after the fix; managed-service coverage is supplemental. Artifact retrieval was unavailable during this review, which does not invalidate the supplied proof.

Evidence

What I checked:

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • xjayling: 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-06T11:24:07.431Z sha 85a5762 :: needs maintainer review before merge. :: none

@steipete
steipete merged commit 3fe375a into main Sep 6, 2026
192 checks passed
@steipete
steipete deleted the codex/qa-uninstall-symlink-20260906 branch September 6, 2026 11:38
@steipete

steipete commented Sep 6, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

vincentkoc pushed a commit to gaoanze888/openclaw that referenced this pull request Sep 6, 2026
* commit '3ed964c8ca6206d26ecc0b6567ccd1389d9948fc': (36 commits)
  refactor(plugins): unify install config snapshot preparation (openclaw#140081)
  fix: cloud provisioning stays failed after temporary storage recovers (openclaw#140021)
  fix(ci): preflight job outputs exceed 1 MiB on full-plan pull requests (openclaw#140018)
  refactor: consolidate command and provider helpers (openclaw#140072)
  fix(doctor): replace unavailable TUI cleanup advice (openclaw#140074)
  fix(plugins): avoid scoped pack failures and missing runtime entries (openclaw#140016)
  fix: clarify background command timeouts (openclaw#140022)
  fix(workboard): refresh board navigation while retaining drafts (openclaw#139952)
  fix: preserve newer chat drafts when rewind completes (openclaw#140066)
  feat(transcripts): browse and export saved meeting archives (openclaw#139875)
  fix(cron): complete timeout test observation phase (openclaw#140076)
  fix(macos): show the full automation count (openclaw#139692)
  fix: native worker turns fail to load WebSocket transport (openclaw#140071)
  fix(cli): complete quoted Bash option values (openclaw#140034)
  fix(chat): show command instructions while pending (openclaw#140041)
  refactor(cli): use canonical resume result schema (openclaw#140056)
  fix: restore package acceptance across install runtimes (openclaw#140062)
  refactor(auto-reply): keep model-selection fixtures in tests (openclaw#140069)
  fix(plugins): remove owned aliases before uninstalling files (openclaw#140065)
  fix: completed replies hang when context-engine cleanup stalls (openclaw#140023)
  ...
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 7, 2026
…w#140065)

Persist the planned load-path cleanup with the guarded disable write,
while realpath identity still exists. Keep removal failures retryable,
preserve later config edits, and report the completed alias cleanup.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cli CLI command changes docs Improvements or additions to documentation maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. 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.

Plugin uninstall leaves dangling symlink load paths in configuration

1 participant