Repository navigation
fix(plugins): remove owned load paths before uninstalling files - #140065
Conversation
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.
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: blocked before merge. Reviewed September 6, 2026, 7:37 AM ET / 11:37 UTC. ClawSweeper reviewWhat this changesThe 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 Review scores
Verification
How this fits togetherOpenClaw’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]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +18, Tests +277, Docs +2. Total +297 across 7 files. View PR surface stats
Review metrics
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge-risk optionsMaintainer options:
Technical reviewBest 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. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
|
Merged via squash.
|
* 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) ...
…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.
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 on9c0cf2b6a56f0da6c5c23928eb63f8223f980449.ciArtifactsbuild passed in 139.729 seconds; dependency, source, runtime/UI identity, full artifact hashes, modes and symlinks were verified.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:
d5973d2f809284c4ba325d3de254d52b94eb46eb5513adcb1ec501cfe384bb4d207647d7385e5c8bfb5cdd831cfc1ead50e0aeee28eb12036182e116f5f7b942The 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.