Repository navigation
fix(plugins): remove stale load paths during uninstall - #118930
Conversation
|
Codex review: needs maintainer review before merge. Reviewed August 3, 2026, 5:14 PM ET / 21:14 UTC. ClawSweeper reviewWhat this changesThis PR makes plugin uninstall remove Merge readinessKeep this draft open for maintainer review. The current uninstall owner removes a linked path install’s recorded Priority: P2 Review scores
Verification
How this fits togetherThe plugin installer records where managed plugins live, and plugin discovery later consumes configured load paths. During uninstall, the plugin subsystem removes configuration, index metadata, policy entries, and managed files; this change also removes the exact stale discovery path that points at the deleted managed install. flowchart LR
A[Plugin install record] --> B[Uninstall planning]
C[Plugin configuration] --> B
B --> D[Exact resolved-path comparison]
D --> E[Cleaned load-path configuration]
B --> F[Plugin index and policy cleanup]
B --> G[Managed directory removal]
E --> H[Plugin discovery avoids deleted path]
Decision needed
Why: The patch is narrowly implemented at the uninstall owner, but it changes persisted configuration for existing managed marketplace and npm installs; the protected Before merge
Agent review detailsSecurityNone. PR surfaceSource +6, Tests +319, Docs +1, Other +277. Total +603 across 8 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Land one canonical uninstall policy: remove only exact resolved paths owned by the saved install record, preserve all non-exact operator paths, and retain focused unit plus current-head marketplace lifecycle proof for install, dry-run, update, and uninstall. Do we have a high-confidence way to reproduce the issue? Yes, from source: current main removes load paths only for linked path installs, while marketplace and npm install records still carry an Is this the best way to solve the issue? Yes, subject to the maintainer compatibility decision. Repairing AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 5b1b1e063225. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
* origin/main: (90 commits) fix(googlechat): recover durable lanes after oversized attachments (#118986) test(qa): cover runtime telemetry evidence (#118950) fix(gateway): resolve SQLite usage details (#118918) test(cron): cover durable scheduler state (#118981) test(gateway): cover node exec approval relay (#118825) test(qa): add Active Memory recall coverage (#118963) test(qa): promote package-backed Docker artifact proof (#118826) test(qa): cover diagnostic event boundary (#118844) test(gateway): cover WebSocket runtime contracts (#118797) fix(signal): drain accepted websocket messages before shutdown (#118975) fix(plugins): remove stale load paths during uninstall (#118930) test(qa): cover bundled runtime discovery (#118922) chore(clawhub): cover plugin release policy contracts (#118971) test(qa): cover support export and stability (#118956) fix(feishu): enforce exact signed webhook request boundaries (#118758) feat(sms): add Twilio MMS support (#118664) test(gateway): prove TLS certificate pinning (#118812) test(qa): cover tool policy and sandbox gates (#118925) fix(cli): keep update dry-run state immutable (#118856) fix(scripts): honor last repeated CLI flag value (#118710) ... # Conflicts: # pnpm-workspace.yaml
…r-admin-20260803 * origin/main: (89 commits) fix(googlechat): align doctor policy ownership with canonical account configuration (#118972) test(tui): prove editor input through PTY (#118982) fix(memory): persist trusted owner provenance at canonical transcript boundary (#118987) test(qa): cover health monitor and cache boundaries (#118961) fix(macos): restore dashboard frame double-click zoom (#118976) fix(googlechat): recover durable lanes after oversized attachments (#118986) test(qa): cover runtime telemetry evidence (#118950) fix(gateway): resolve SQLite usage details (#118918) test(cron): cover durable scheduler state (#118981) test(gateway): cover node exec approval relay (#118825) test(qa): add Active Memory recall coverage (#118963) test(qa): promote package-backed Docker artifact proof (#118826) test(qa): cover diagnostic event boundary (#118844) test(gateway): cover WebSocket runtime contracts (#118797) fix(signal): drain accepted websocket messages before shutdown (#118975) fix(plugins): remove stale load paths during uninstall (#118930) test(qa): cover bundled runtime discovery (#118922) chore(clawhub): cover plugin release policy contracts (#118971) test(qa): cover support export and stability (#118956) fix(feishu): enforce exact signed webhook request boundaries (#118758) ...
* test(qa): prove marketplace plugin updates * fix(plugins): clean exact install load paths on uninstall * fix(ci): register marketplace lifecycle assertions
What Problem This Solves
Fixes an issue where uninstalling a marketplace, npm, or other managed plugin could delete its managed directory but leave an exact matching
plugins.load.pathsentry behind. The stale config could keep pointing plugin discovery at a path that no longer exists.Why This Change Was Made
Uninstall already owns the canonical install record, so load-path cleanup now matches that record's
installPathfor every install source and retains the existing linked-pathsourcePathcleanup. Matching is exact or realpath-equivalent only; parent directories, child paths, prefixes, and unrelated operator paths are preserved.The package-installed marketplace scenario now proves the full lifecycle: v1 install state, non-mutating plugin-ID dry run, persisted v2 update, then uninstall cleanup across config, SQLite index/install records, allow/deny policy, the exact load path, managed files, and CLI registration while unrelated sentinels remain.
User Impact
Operators no longer retain a stale exact load path after uninstalling a managed plugin. Explicit non-exact paths remain untouched.
Maintainer Decision
Accepted: uninstall owns cleanup of an exact or realpath-equivalent load path recorded as the managed plugin's
installPath. This is intentional persisted-config behavior; non-exact operator paths remain preserved.Evidence
node scripts/run-vitest.mjs src/plugins/uninstall.test.ts test/scripts/release-plugin-marketplace-lifecycle.test.ts(65 uninstall tests and 4 lifecycle-helper tests passed)node scripts/run-node.mjs qa coverage --match clawhub.update-by-plugin-id(one primary scenario match)node scripts/run-node.mjs qa coverage --match clawhub.uninstall-config-index-policy-file-cleanup(one primary scenario match)bash -n scripts/e2e/lib/release-plugin-marketplace/scenario.sh./node_modules/.bin/oxfmt --checkon all touched formatted filesgit diff --check5d30ff9e5a7(leasetbx_01kz4mqbxszrpndpm4dym0askf, run https://github.com/openclaw/openclaw/actions/runs/30849990176)4af47fffb8527738288d5931556c7ca0f6f326ff(leasetbx_01kz4n7g0s48q81pjx74fsspnc)4af47fffb8527738288d5931556c7ca0f6f326ffforclawhub-marketplace-list; schema-v2 evidence recorded one passing entry at.artifacts/qa-e2e/clawhub-marketplace-lifecycle-4af47ff-1785790175/qa-evidence.jsonpnpm check:changedpassed on runtime head4af47fffb8527738288d5931556c7ca0f6f326ff, including typecheck, lint, and runtime import-cycle checks2d46f7cb77dadds only the Knip executable-root declaration and owner-test routing required by the initial ready-for-review CI runpnpm deadcode:dependenciesandpnpm deadcode:unused-filespassed with zero entriesProduction delta:
src/plugins/uninstall.tsis +14/-8, net +6 lines.