Repository navigation
fix: fresh npm updates fail to load Undici - #160015
Conversation
|
🦞👀 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: needs maintainer review before merge. Reviewed September 27, 2026, 9:43 PM ET / September 28, 2026, 01:43 UTC (Revision 2). ClawSweeper reviewWhat this changesThe branch bundles the existing pinned Undici dependency in OpenClaw’s npm package, documents its relationship to Proxyline, and makes the package checker reject missing peers that OpenClaw directly requires. Regression provenancePossible regression — suspected (reproduction). No predecessor PR is attributed. Merge readiness✅ Ready for maintainer review Current main still bundles Proxyline without Undici, so this repair remains necessary. The updated PR evidence addresses the previous review’s package and staged-update proof gap; no actionable patch defect was found. Priority: P0 Review scores
Verification
How this fits togetherOpenClaw builds an npm archive from its root package manifest and checks its bundled dependencies before installation. Fresh installs and staged updates consume that archive, then start Doctor and the Gateway. flowchart LR
A[Root package dependencies] --> B[npm archive build]
B --> C[Bundled Proxyline and Undici]
C --> D[Archive integrity check]
D --> E[Fresh install or staged update]
E --> F[Doctor and Gateway]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceTests +46, Docs +2, Config +1, Other +12. Total +61 across 4 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Keep required bundled-peer validation with the existing package checker and use the canonical archive for future install and update acceptance. Do we have a high-confidence way to reproduce the issue? Yes. The PR records a fresh isolated npm 11.19.1 install of the affected archive that succeeds at installation but fails when Undici is imported; current main retains the bundle arrangement responsible. Is this the best way to solve the issue? Yes. Bundling the already pinned runtime and checking root-required peers at the existing archive boundary is a focused repair, supported by the reported canonical-package and staged-update results. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 8f2c35981951. LabelsLabel changes:
Label 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.
|
…160583) The bundleDependencies change in #160015 exposed exact-path closure checks rejecting valid undici CommonJS requires. Resolve require edges with Node file and directory rules while keeping ESM imports strict, and carry package metadata through bootstrap inspection. Restore cloud-session dispatch on the next Gateway update. Add checker and transferred-artifact regressions; verify a real undici 8.10.2 bootstrap artifact without starting or stopping a Gateway.
…penclaw#160583) The bundleDependencies change in openclaw#160015 exposed exact-path closure checks rejecting valid undici CommonJS requires. Resolve require edges with Node file and directory rules while keeping ESM imports strict, and carry package metadata through bootstrap inspection. Restore cloud-session dispatch on the next Gateway update. Add checker and transferred-artifact regressions; verify a real undici 8.10.2 bootstrap artifact without starting or stopping a Gateway.
What Problem This Solves
Fixes fresh npm installs and staged updates failing to start with a missing
undici/index.jsafter the Proxyline bundling change in #159851.User Impact
New installations and update candidates retain the patched Proxyline runtime and can complete Doctor. No dependency versions, configuration, migrations, or updater safeguards change.
Why This Change Was Made
npm infers that a bundled package's peers are already bundled, but its packlist does not include those peers automatically. Consequently, npm 11.19.1 reports a successful installation while omitting Undici, even though OpenClaw requires it directly.
Bundle the already-pinned Undici alongside Proxyline. The existing archive validator now catches missing peers of bundled owners when OpenClaw independently requires those peers; optional peer metadata cannot waive that root requirement. Genuinely absent optional peers remain allowed. The patch notes retain the removal condition for both bundle entries.
Evidence
package.jsonchanged, and all 214 added files belonged to Undici. Fresh installation, Proxyline import, and isolated Doctor all passed. No existing archive files were removed or otherwise changed.libexecnpm path and takes its documented version-command fallback; that fixture prohibits the fallback. The peer validator is not entered by that fixture. This separate toolchain-discovery issue is recorded as a follow-up.pnpm buildpassed (13m38s); the canonical source packer passed archive inventory, bundled-dependency, and import-graph checks. Candidate archive SHA-256:3ce6f646dee517ac8cb55163d97052ec210d83efeb311ec5c5f2e1eaf580fef6.[email protected]updater installed that canonical candidate into a fresh stage and completed the update in 139.1s: npm install, copied-state snapshot, Doctor/fix, Doctor/lint, config, plugin inventory, recovery import, candidate Gateway startup, swap, and final Doctor all exited 0. The test used a private npm prefix and nondefault state/config/home; native service management was intentionally skipped and recorded. Loopback/synthetic-config warnings remained advisory.The change adds one bundle entry and 12 validator lines, with no runtime code changes. The validator growth establishes the missing archive/dependency contract at the existing package owner.