Repository navigation
fix(plugins): restore on-demand installs in standalone builds - #174133
Conversation
Declare npm and its bundled runtime closure as standalone resources, record its size and file count, and run it through the compiled executable in Bun mode. Preserve npm configuration, lockfile integrity checks, and script-free installation semantics for on-demand plugins.
|
🦞👀 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 SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex review: needs maintainer review before merge. What this changesRetains npm and its runtime dependencies in standalone artifacts and runs npm through the compiled executable’s Bun mode. Example: Install npm:@openclaw/[email protected] from a standalone artifact without host Node, Bun, or npm.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Regression provenanceRegression provenance — verified: source commit Merge readiness✅ Ready for maintainer review Keep this PR open: it addresses a confirmed standalone installation failure still present on main, follows maintainer-approved direction, and introduces no definite correctness defect found in this review. Priority: P2 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherThe standalone builder turns a completed OpenClaw build into an executable, resource sidecar, and manifest; shared npm command and environment owners then serve plugin metadata, installation, peer planning, and removal. flowchart TD
A[Completed OpenClaw build] --> B[Standalone resource planner]
C[Bundled npm runtime] --> B
B --> D[Executable and sidecar]
E[Plugin install request] --> F[Shared npm command and environment]
D --> F
F --> G[npm registry and managed plugin root]
Technical reviewBest possible solution: Retain npm’s declared sidecar closure and existing installation owners, then complete the recorded compiled-artifact qualification. Do we have a high-confidence way to reproduce the issue? Current-main pruning and npm resolution explain the missing-CLI failure, and the linked desktop qualification records that exact failure through a real plugin installation command; no target code was executed during this review. Is this the best way to solve the issue? The repair fits the existing resource planner and CLI invocation owner while preserving npm-specific metadata, peer-planning, integrity, and lifecycle-script contracts. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against b4ce369de7e8. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +6, Tests +110, Docs +7, Other +88. Total +211 across 12 files. Added test files: 1. View PR surface stats
LabelsLabel changes:
Label justifications:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed October 16, 2026, 7:28 AM ET / 11:28 UTC. |
|
Merged via squash.
|
…ge harness Main hourly 38902471699 failed check-dependencies on two exports that lost their last consumers: the SessionWorkspaceRail re-export (callers import the Solid module directly since #174068) and SynologyChatAccountRaw (only used inside types.ts since #173734). The package-openclaw-for-docker trusted-harness test copies a fixed file closure; #174133 made src/infra/npm-command.ts import ../../cli-invocation.mjs, so the harness failed with MODULE_NOT_FOUND. cli-invocation.mjs only imports node builtins. Negative control on current main fails on macOS too; with the file added the case passes.
…aw#174133) * fix(plugins): retain npm runtime for standalone installs Declare npm and its bundled runtime closure as standalone resources, record its size and file count, and run it through the compiled executable in Bun mode. Preserve npm configuration, lockfile integrity checks, and script-free installation semantics for on-demand plugins. * test(build): declare absent package manager in manifest fixture * fix(build): map installed plugin SDK loads into standalone image
…ge harness Main hourly 38902471699 failed check-dependencies on two exports that lost their last consumers: the SessionWorkspaceRail re-export (callers import the Solid module directly since openclaw#174068) and SynologyChatAccountRaw (only used inside types.ts since openclaw#173734). The package-openclaw-for-docker trusted-harness test copies a fixed file closure; openclaw#174133 made src/infra/npm-command.ts import ../../cli-invocation.mjs, so the harness failed with MODULE_NOT_FOUND. cli-invocation.mjs only imports node builtins. Negative control on current main fails on macOS too; with the file added the case passes.
What Problem This Solves
Standalone builds prune the npm CLI and its runtime dependencies, so installing an omitted plugin fails with “Bundled npm CLI is missing” before registry access.
User Impact
Restores on-demand plugin installation without requiring host Node, Bun, or npm. Existing registry configuration/authentication, package-lock integrity verification, and lifecycle-script restrictions remain with npm.
Why This Change Was Made
The builder now declares npm's runtime closure as a sidecar resource and records its version, entrypoint, file count, and bytes in the manifest. The shared CLI invocation owner selects the sidecar entrypoint and runs it through the same executable with
BUN_BE_BUN=1; the three shared npm environment paths cover metadata, configuration probes, installs, peer planning, and removal. Existing public Bun and CommonJS resolver hooks map their final load targets into the embedded SDK image while admission and discovery retain physical paths.Native Bun package management is not an equivalent replacement: the installer requires npm's projected
viewoutput, remote/archivepackJSON, configuration probes, peer planning, andpackage-lock.jsonintegrity records. The pinned Bun supports self-as-Bun execution but does not provide those npm contracts. The retained npm 12.2.0 closure adds 1,591 files / 9,215,364 bytes; documentation, maps, declarations, and unrelated npm bin entrypoints are excluded.Evidence
pnpm buildpassed (737.48 s wall); final desktop-selection standalone build passed (1,165.59 s). Developer ID signed, JIT entitlements; 76 embedded / 92 omitted plugins, including omitted Teams.npm:@openclaw/[email protected]install passes in 21.124 s; ClawHub install passes in 27.543 s. Both list and inspect as loaded with no diagnostics, and both running Gateways report Teams active with successful health RPCs. Uninstalls pass (105.000 s / 99.357 s) and remove installation directories.BUN_BE_BUNoverride.Related: #172802, #172569, #173794. Includes the public SDK hook correction from #173794 and completes its CommonJS handoff. Qualification uses that PR's plugin-selection changes, excluding its separate npm embedding experiment.