Repository navigation
fix(plugins): prevent ambiguous uninstall targets - #117406
Conversation
|
Codex review: needs maintainer review before merge. Reviewed August 1, 2026, 10:17 AM ET / 14:17 UTC. ClawSweeper reviewWhat this changesThe PR changes plugin uninstall so exact canonical IDs take precedence over aliases and ambiguous aliases return an actionable error before any plugin mutation occurs. Merge readinessThis is a correct, narrowly scoped repair for a real uninstall-selection defect. The PR includes strong head-pinned built-CLI proof and regression coverage; it stays open for an explicit maintainer decision because ambiguous aliases will intentionally change from unsafe first-match selection to a fail-closed exact-ID requirement. Priority: P2 Review scores
Verification
How this fits togetherOpenClaw’s plugin CLI converts an operator’s uninstall argument into a canonical plugin ID, then passes that ID to the uninstall planner and mutation flow. The changed selector runs before planning, confirmation, configuration writes, installed-index updates, registry refresh, and file removal. flowchart LR
A[Uninstall argument] --> B[Plugin CLI]
B --> C[Canonical target selection]
C --> D{Exact or unique match?}
D -->|Yes| E[Uninstall planner]
D -->|No| F[Actionable no-mutation error]
E --> G[Config index registry and files]
Decision needed
Why: The patch and hosted CLI proof support the repair, but existing automation using an ambiguous alias will intentionally stop rather than silently select one plugin. Before merge
Agent review detailsSecurityNone. PR surfaceSource +30, Tests +208. Total +238 across 4 files. View PR surface stats
Review metricsNone. Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Accept the explicit fail-closed compatibility behavior and land the canonical selector, retaining unique aliases while requiring exact IDs for collisions. Do we have a high-confidence way to reproduce the issue? Yes, by source and supplied real proof: current main’s first matching display name can override a later exact ID, and the PR body records a built-CLI reproduction and after-fix run on the immutable head. This read-only review did not execute the path locally. Is this the best way to solve the issue? Yes, subject to the explicit compatibility decision: resolving canonical IDs before aliases and rejecting multiple alias owners repairs the selector before the sole planner and mutation caller. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against a172857acc75. 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)
|
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Maintainer decision: accept fail-closed handling of ambiguous uninstall aliases. Exact plugin IDs remain authoritative, and requiring an exact ID for ambiguous aliases intentionally prevents destructive first-match removal; the head-pinned built-CLI proof verifies zero config, SQLite-index, or file mutations on ambiguity. |
|
Merged via squash.
|
…up-ownership-20260801 * origin/main: fix(gateway): trim audit.list exact-match filter ids (openclaw#110847) fix: harden plugin import-boundary guards and remove dead scanner (openclaw#117386) fix(ci): keep PTY tests observable and wait for completed turns (openclaw#117405) fix(plugins): resolve marketplace aliases without recursive cycles (openclaw#117440) fix: break command recovery import cycle (openclaw#116947) fix: clear offscreen command recovery fix: fence command recovery ownership fix: scope failed command recovery fix(plugins): fail closed on ambiguous uninstall targets (openclaw#117406)
…7406) Co-authored-by: Peter Steinberger <[email protected]>
…up-ownership-20260801 * origin/main: fix(gateway): trim audit.list exact-match filter ids (openclaw#110847) fix: harden plugin import-boundary guards and remove dead scanner (openclaw#117386) fix(ci): keep PTY tests observable and wait for completed turns (openclaw#117405) fix(plugins): resolve marketplace aliases without recursive cycles (openclaw#117440) fix: break command recovery import cycle (openclaw#116947) fix: clear offscreen command recovery fix: fence command recovery ownership fix: scope failed command recovery fix(plugins): fail closed on ambiguous uninstall targets (openclaw#117406)
What Problem This Solves
Fixes an issue where users uninstalling a plugin by its exact ID could silently remove a different plugin when an earlier plugin used that ID as its display name. Duplicate display names or package, marketplace, and ClawHub aliases could likewise select and remove the first matching plugin without warning.
Why This Change Was Made
The canonical uninstall selector now prioritizes authoritative plugin IDs from the registry, installed-plugin index, stale configuration entries, allow/deny lists, and memory/context-engine slots before considering aliases. It deduplicates all aliases by owner and returns an actionable failure for ambiguous matches; the sole uninstall caller stops before planning or mutation. Existing unique aliases, force/confirmation lease ordering, stale-reference cleanup, hooks, and ClawHub compatibility remain intact.
User Impact
An exact plugin ID always targets that plugin, regardless of colliding display names. Ambiguous uninstall requests explain which IDs matched and make no configuration, installed-index, channel, or filesystem changes.
Evidence
plugins uninstall calendar --force --keep-filesplannedunrelated-plugininstead ofcalendar; a duplicate display-name request incorrectly succeeded.node scripts/run-vitest.mjs src/cli/plugins-cli.uninstall.test.ts— 14/14 passed; collision and ambiguity regressions prove correct targeting and zero plan/prompt/config/index/files/refresh side effects.node scripts/run-vitest.mjs src/cli/plugins-uninstall-selection.test.ts— 13/13 passed, covering exact IDs, installed records, stale entries, allow/deny lists, slots, display/npm/ClawHub ambiguity, same-owner alias deduplication, and existing ClawHub aliases.--type-aware --config .oxlintrc.json --tsconfig config/tsconfig/oxlint.core.json --report-unused-disable-directives-severity erroron all four files exited 0 with no findings. The repository wrapper separately encounters an unrelated, unchanged-main boundary-DTS preflightpackages/terminal-core/src/ansi.ts:194 TS2554caused by stale hoisted string-width declarations; it is not reported as green.gpt-5.6-sol/ high / P3 autoreview, TruffleHog 3.96 clean, zero findings, confidence 0.97. Immutable head:e0fcb85f51cbcf6b519d9a14a32d45907073e270.Authentic configured CLI proof — frozen head
e0fcb85f51cbcf6b519d9a14a32d45907073e270Executed on hosted Blacksmith Testbox
tbx_01kyys40m1dtrpvkj25sdsxkyaafter a successful full productionpnpm build; all commands used the actual built CLI and isolated real plugin manifests, config, linked files, and discovered shared SQLite state.pnpm openclaw plugins install --link ... --forceinstalledunrelated-pluginwith display namecalendar, followed by the actual plugin IDcalendar. Realpnpm openclaw plugins uninstall calendar --forceremoved only plugincalendarand its config/install record; subsequent actualpnpm openclaw plugins list --jsonretainedunrelated-plugin. Linked plugin file-tree hash remained26ab4c610a54f7150ff86e3d4b26cf85f85b9c7cbb539c2789578c3e8c7ad27f.calendar-oneandcalendar-two, both with display namecalendar. Realpnpm openclaw plugins uninstall calendarfailed with exit1:Plugin uninstall target "calendar" is ambiguous; matches: calendar-one, calendar-two. Use an exact plugin id.Both actual plugin IDs remained. Before and after hashes were byte-identical:94338a428d77ba6e7ebfbfd9a7121f4cc4c82455346ec8d45433dd47cc885c71installed_plugin_index:2852636a4a5c9fc4627f9682622a450a15d31c3d6568260a5ac5d4dc78daa4935d203c2bb4e0e27e89a27b953822eec51042f02c82c5c0e7fec79c3cafff964fFinal authenticated hosted result:
RESULT AUTHENTIC CONFIGURED CLI PROOF PASS,CLI_PROOF_EXIT 0; Blacksmith timingcommandMs=17967,totalMs=18003,exitCode=0. Proof script SHA-256602ff195c54e2ec36cbe1bf25028a589f9c39869e1e273888a042002274d1861; proof log SHA-256e9cbb9a23b113a3425c9e710b270d62dc6015b950b13b8fdc330c0941552acb4.