Skip to content

fix(plugins): plugin install survives pnpm-only overrides - #116245

Merged
steipete merged 3 commits into
mainfrom
fix/npm-override-selector-retry
Jul 30, 2026
Merged

steipete merged 3 commits into
mainfrom
fix/npm-override-selector-retry

Conversation

@steipete

@steipete steipete commented Jul 30, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes an issue where installing or updating a plugin through the managed npm root could fail when OpenClaw's pnpm workspace overrides contained pnpm-only parent-child selectors or npm alias values unsupported by the host npm version.

Why This Change Was Made

The installer now classifies the specific npm parser incompatibility and retries after removing only the unsupported override kind. Selector-key failures preserve valid npm aliases and semver ranges; alias-comparator failures preserve pnpm selector rules until npm itself rejects them. The fallback is bounded because each retry must add a previously unseen omission kind.

User Impact

Plugin installs and updates no longer fail solely because the host npm cannot parse OpenClaw's pnpm-native override syntax, while compatible dependency overrides remain enforced.

Evidence

  • Exact-head CI 30516598496 passed all 69 jobs at b8b00650b396990e17c5edf6b25444a230b3b785.
  • Blacksmith Testbox: src/plugins/install.npm-spec.test.ts — 69/69 passed.
  • Blacksmith Testbox: src/infra/npm-managed-root.test.ts — 27/27 passed.
  • node scripts/check-changed.mjs -- src/infra/npm-managed-root.ts src/plugins/install-managed-npm-state.ts src/plugins/install-managed-npm.ts src/plugins/install.npm-spec.test.ts — passed core/core-test typecheck, changed-file formatting/lint, plugin boundaries, dead-code and architecture guards.
  • Codex autoreview (--mode branch --base origin/main) — clean, no accepted/actionable findings.
  • Verified parser behavior directly against npm Arborist and npm-package-arg: versioned, unversioned, scoped parent-child selectors produce the covered EINVALIDTAGNAME, EINVALIDPACKAGENAME, and Override without name forms; pkg@>1 remains valid npm semver syntax.

Real managed-install proof

Ran the actual CLI install path on an ephemeral Linux Blacksmith Testbox with npm 11.16.0 and an isolated temporary OPENCLAW_STATE_DIR:

$ pnpm openclaw plugins install npm:@openclaw/[email protected] --force
Installing @openclaw/[email protected] into <temporary-state>/npm/projects/openclaw-voice-call-d0fedeaf18…
npm rejected managed npm overrides; retrying plugin install without npm-incompatible overrides for this npm version.
Linked peerDependency "openclaw" -> <checkout>
Installed plugin: voice-call
Restart the gateway to load plugins.

The resulting managed-root manifest was inspected before cleanup:

{
  "installedDependency": "2026.7.1",
  "selectorKeysRemaining": [],
  "preservedAliasOverrides": [
    "node-domexception=npm:@nolyfill/[email protected]",
    "request-promise=npm:@cypress/[email protected]",
    "request=npm:@cypress/[email protected]"
  ],
  "managedOverrideCount": 31
}

pnpm openclaw plugins list --json then returned "id": "voice-call". The isolated state directory and Testbox were removed after the successful run.

@openclaw-barnacle openclaw-barnacle Bot added size: S maintainer Maintainer-authored PR labels Jul 30, 2026
@steipete steipete self-assigned this Jul 30, 2026
@steipete
steipete force-pushed the fix/npm-override-selector-retry branch from 57caad1 to 481a715 Compare July 30, 2026 05:13
@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. labels Jul 30, 2026
@clawsweeper

clawsweeper Bot commented Jul 30, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed July 30, 2026, 1:30 AM ET / 05:30 UTC.

ClawSweeper review

What this changes

The PR changes managed npm-root plugin installation so host-npm parser failures from pnpm-only override selectors or npm aliases retry with only the incompatible override category removed.

Merge readiness

⛔ Blocked until real behavior proof is added - 4 items remain

Keep this PR open. The proposed retry is a focused compatibility repair, but the protected maintainer label requires human handling and the current review cycle still lacks directly inspectable after-fix managed npm-root install/update proof. The supplied focused tests and CI support the patch shape; no definite line-level regression is established from the available evidence.

Priority: P2
Reviewed head: b8b00650b396990e17c5edf6b25444a230b3b785

Review scores

Measure Result What it means
Overall readiness 🧂 unranked krab (1/6) The patch is focused and supported by relevant tests, but missing real install/update proof remains a merge gate.
Proof confidence 🧂 unranked krab (1/6) Needs real behavior proof before merge: The PR reports focused tests, static checks, and npm-library inspection, but no directly inspectable after-fix real managed npm-root install or update transcript, log, recording, or artifact is present. Add redacted terminal proof; after updating the PR body, ClawSweeper should re-review automatically, or a maintainer can comment @clawsweeper re-review.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Needs proof Needs real behavior proof before merge: The PR reports focused tests, static checks, and npm-library inspection, but no directly inspectable after-fix real managed npm-root install or update transcript, log, recording, or artifact is present. Add redacted terminal proof; after updating the PR body, ClawSweeper should re-review automatically, or a maintainer can comment @clawsweeper re-review.
Evidence reviewed 5 items Patch scope: The supplied diff changes the managed npm-root manifest writer, plugin install retry loop, parser-error classifier, and focused tests; it does not add dependencies, workflow changes, package scripts, or secret handling.
Bounded retry behavior: The PR body and final commit state that a retry must add a previously unseen omission kind, preventing an unbounded fallback loop while preserving overrides not implicated by the parser error.
Focused validation reported: The PR body reports passing focused managed-npm-root and npm-spec tests plus changed-file checks; these are useful supplemental validation but do not demonstrate an after-fix real managed install or update.
Findings None None.
Security None None.

How this fits together

Managed npm-root installation writes a temporary package manifest for installing or updating plugins outside OpenClaw’s main dependency tree. The installer passes managed dependency overrides to npm, then retries when the host npm cannot parse syntax that pnpm accepts, affecting plugin install and update completion.

flowchart LR
  A[Plugin install or update request] --> B[Managed npm-root manifest]
  B --> C[Managed dependency overrides]
  C --> D[Host npm install]
  D --> E{Parser rejects override syntax?}
  E -->|No| F[Plugin installed or updated]
  E -->|Yes| G[Classify incompatible override kind]
  G --> H[Retry with only that kind omitted]
  H --> D
Loading

Before merge

  • Add real behavior proof - Needs real behavior proof before merge: The PR reports focused tests, static checks, and npm-library inspection, but no directly inspectable after-fix real managed npm-root install or update transcript, log, recording, or artifact is present. Add redacted terminal proof; after updating the PR body, ClawSweeper should re-review automatically, or a maintainer can comment @clawsweeper re-review.
  • Resolve merge risk (P2) - Merging changes the fallback behavior used by existing managed npm-root installs: an incorrect classifier could omit valid override rules or fail to recover an affected installation, so upgrade-safe runtime proof is still needed.
  • Resolve merge risk (P1) - The patch has not supplied directly inspectable after-fix install/update evidence; focused tests and CI do not demonstrate the real host-npm parser failure and recovery path.
  • Complete next step (P2) - The remaining merge gate is contributor-provided real behavior proof plus protected-label maintainer handling, not a narrow automated code repair.
Agent review details

Security

None.

PR surface

Source +53, Tests +56. Total +109 across 5 files.

View PR surface stats
Area Files Added Removed Net
Source 3 78 25 +53
Tests 2 63 7 +56
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 5 141 32 +109

Review metrics

None.

Merge-risk options

Maintainer options:

  1. Add a real managed-install transcript (recommended)
    Before merge, provide redacted terminal or runtime output showing the affected host-npm override error is classified, retried selectively, and finishes an install or update without losing compatible overrides.
  2. Pause for maintainer-owned validation
    Keep the PR open under the existing protected label if reproducing the host-npm behavior requires an environment or compatibility decision that the contributor cannot safely demonstrate.

Technical review

Best possible solution:

Keep the selective, bounded omission design, add a redacted real managed npm-root install or update transcript that starts with an affected override set and ends with successful installation, then obtain the required maintainer review before merge.

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

No high-confidence live reproduction is available in the reviewed evidence. The source and focused tests identify the parser-error classification path, so the failure is source-reproducible, but a current host-npm install/update transcript is still missing.

Is this the best way to solve the issue?

Unclear: selective omission is the maintainable direction because it avoids the former all-alias fallback, but the review could not independently inspect the full current-main callers and host-npm dependency contract due read-only command execution being unavailable.

AGENTS.md: unclear because the file could not be read completely.

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

Labels

Label justifications:

  • P2: The PR addresses a bounded plugin-install compatibility failure rather than a security, data-loss, or core-runtime emergency.
  • merge-risk: 🚨 compatibility: The changed retry controls which dependency overrides existing managed npm-root installs retain after a host-npm parser failure.
  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🐚 platinum hermit.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: The PR reports focused tests, static checks, and npm-library inspection, but no directly inspectable after-fix real managed npm-root install or update transcript, log, recording, or artifact is present. Add redacted terminal proof; after updating the PR body, ClawSweeper should re-review automatically, or a maintainer can comment @clawsweeper re-review.

Evidence

What I checked:

  • Patch scope: The supplied diff changes the managed npm-root manifest writer, plugin install retry loop, parser-error classifier, and focused tests; it does not add dependencies, workflow changes, package scripts, or secret handling. (src/plugins/install-managed-npm.ts:242, b8b00650b396)
  • Bounded retry behavior: The PR body and final commit state that a retry must add a previously unseen omission kind, preventing an unbounded fallback loop while preserving overrides not implicated by the parser error. (src/plugins/install-managed-npm.ts:261, b8b00650b396)
  • Focused validation reported: The PR body reports passing focused managed-npm-root and npm-spec tests plus changed-file checks; these are useful supplemental validation but do not demonstrate an after-fix real managed install or update. (src/plugins/install.npm-spec.test.ts:733, b8b00650b396)
  • Prior review continuity: The prior completed ClawSweeper cycle had no code findings and requested a redacted after-fix managed npm-root install/update transcript. The current context contains no inspectable runtime artifact showing that result. (481a71512877)
  • Protected handling: This PR carries the repository’s protected maintainer label, so automated cleanup must keep it open for explicit maintainer handling.

Likely related people:

  • steipete: Authored all three commits on this narrowly scoped managed npm-root compatibility repair; local feature-history commands were unavailable in the read-only execution environment, so broader ownership cannot be established here. (role: recent area contributor; confidence: low; commits: 3a144113f2e0, 481a71512877, b8b00650b396; files: src/infra/npm-managed-root.ts, src/plugins/install-managed-npm.ts, src/plugins/install-managed-npm-state.ts)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Add redacted terminal output from an affected managed npm-root plugin install or update that succeeds after selective retry.
  • Have a maintainer complete the protected-label review after the runtime proof is attached.

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-07-30T05:17:44.985Z sha 481a715 :: needs real behavior proof before merge. :: none

@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. labels Jul 30, 2026
@steipete

Copy link
Copy Markdown
Contributor Author

Rank-up moves addressed on exact head b8b00650b396990e17c5edf6b25444a230b3b785:

  • Added a redacted real managed-install transcript to the PR body. The actual CLI path on npm 11.16.0 reproduced the selector incompatibility, emitted the selective-retry warning, completed the install, preserved all three npm alias overrides, removed pnpm selector keys, and listed voice-call as installed.
  • Maintainer review is complete: focused Testbox proof, exact-head CI 30516598496, and final full-branch Codex autoreview are green with no remaining code findings.

The protected-label proof request is therefore satisfied; no rank-up move is being skipped.

@steipete
steipete merged commit ea42a46 into main Jul 30, 2026
130 of 132 checks passed
@steipete
steipete deleted the fix/npm-override-selector-retry branch July 30, 2026 05:43
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

steipete added a commit that referenced this pull request Jul 30, 2026
* fix(plugins): preserve compatible npm overrides on retry

* fix(plugins): keep npm compatibility type internal

* fix(plugins): bound managed override retries
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 30, 2026
…16245)

* fix(plugins): preserve compatible npm overrides on retry

* fix(plugins): keep npm compatibility type internal

* fix(plugins): bound managed override retries
vincentkoc added a commit to Hackerismydream/openclaw that referenced this pull request Jul 30, 2026
* origin/main: (24 commits)
  fix(e2e): apply default service identity per flow (openclaw#116265)
  chore(android): record 2026.7.4 Play metadata
  fix(ci): accept one verified Telegram SUT launch (openclaw#116267)
  chore(android): prepare 2026.7.4 Play release
  fix(e2e): align service account state (openclaw#116254)
  refactor(qa): remove live-channel scenario registries and wrappers (openclaw#115752)
  fix(ci): let trusted Telegram QA stage runtime (openclaw#116252)
  fix(plugins): plugin install survives pnpm-only overrides (openclaw#116245)
  test(qa): recognize internal image completions (openclaw#116234)
  fix(test): review Codex runtime scan chunks (openclaw#116212)
  fix(systemd): clear start-limit latch before gateway start (openclaw#116178)
  fix(security): expose every executable call in plugin scans (openclaw#116222)
  chore(sdk): repin the API baseline after the resolver signature change
  test(e2e): delay the draft-proof final answer past the start gate
  fix(channels): resolve tool progress against the caller's stream mode
  fix(ci): satisfy docs formatting, lint, and the SDK API baseline
  test(e2e): add a progress-draft scenario to the mock provider
  docs(telegram): call out the changed default preview on upgrade
  refactor(channels): render the progress label as a block, not a line
  fix(channels): show tool lines under the progress status headline
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer Maintainer-authored PR merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P2 Normal backlog priority with limited blast radius. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. size: S status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant