Skip to content

fix: fresh npm updates fail to load Undici - #160015

Merged
steipete merged 1 commit into
mainfrom
codex/package-bundled-peer-runtime
Sep 28, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/package-bundled-peer-runtime

Conversation

@steipete

@steipete steipete commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes fresh npm installs and staged updates failing to start with a missing undici/index.js after 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

  • Reproduced the exact failing archive in a fresh isolated npm 11.19.1 prefix: exit 0 and 341 packages, followed by the same missing Undici import.
  • Repacked a differential fixture: only package.json changed, 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.
  • Four real tarball-checker regression cases pass (4.21s wall); the original missing-peer case failed on the baseline because the broken archive was accepted.
  • Package checker and bundled browser MCP siblings: 108 passed. One existing Homebrew-specific fixture failed because the npm runner does not recognize the active keg's libexec npm 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 build passed (13m38s); the canonical source packer passed archive inventory, bundled-dependency, and import-graph checks. Candidate archive SHA-256: 3ce6f646dee517ac8cb55163d97052ec210d83efeb311ec5c5f2e1eaf580fef6.
  • The actual published [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.
  • Independent review found no actionable issues. Targeted tooling/test lint and all 706 direct dependency pins passed. One lint attempt overlapped package preparation and was correctly rejected for changing dependency topology; the serialized rerun passed after both owners joined.

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.

@clawsweeper

clawsweeper Bot commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added scripts Repository scripts size: S labels Sep 28, 2026
@steipete
steipete marked this pull request as ready for review September 28, 2026 01:25
@github-actions github-actions Bot added the dependencies-changed PR changes dependency-related files label Sep 28, 2026
@github-actions

Copy link
Copy Markdown
Contributor

⚠️ Dependency graph changes

This maintainer PR changes the dependency graph. This comment is informational because the PR author has repository Maintain or Admin access.

  • Current SHA: 53b66f2936af171719e52a9cbec3050d3362a754
  • Maintainer: @steipete
  • Repository role: admin

These dependency graph changes were made:

  • patches/README.md
  • package.json

Carefully review these changes before merging.

@clawsweeper clawsweeper Bot added P0 Emergency: data loss, security bypass, crash loop, or unusable core runtime. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 28, 2026
@clawsweeper

clawsweeper Bot commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 27, 2026, 9:43 PM ET / September 28, 2026, 01:43 UTC (Revision 2).

ClawSweeper review

What this changes

The 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 provenance

Possible 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
Reviewed head: 53b66f2936af171719e52a9cbec3050d3362a754

Review scores

Measure Result What it means
Overall readiness 🦞 diamond lobster (5/6) A focused package-boundary repair has a baseline failure, targeted regressions, and reported canonical archive and published-updater recovery proof.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (terminal): The changed package owner puts Undici in the canonical archive; the captured PR body reports a fresh npm install and a published-updater staged update of that candidate, with Doctor and candidate Gateway startup completing after the fix. No stored-data contract changes.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (terminal): The changed package owner puts Undici in the canonical archive; the captured PR body reports a fresh npm install and a published-updater staged update of that candidate, with Doctor and candidate Gateway startup completing after the fix. No stored-data contract changes.
Evidence reviewed 7 items Introduced package change: The PR adds the already pinned Undici dependency to the root npm bundle alongside Proxyline.
Package admission owner: The checker now rejects an absent bundled peer when the root manifest also declares that peer as a required dependency.
Boundary regression coverage: Four added archive cases exercise required peers, root-required optional peers, a present bundled peer, and an absent optional peer through the package checker.
Findings None None.
Security None None.

How this fits together

OpenClaw 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]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Tests +46, Docs +2, Config +1, Other +12. Total +61 across 4 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 1 46 0 +46
Docs 1 3 1 +2
Config 1 2 1 +1
Generated 0 0 0 0
Other 1 12 0 +12
Total 4 63 2 +61

Review metrics

Metric Value Why it matters
Bundled direct dependencies 2 → 3 The additional entry places the existing pinned Undici runtime in the npm archive used by installs and updates.

Technical review

Best 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.

Labels

Label changes:

  • add proof: sufficient: Contributor real behavior proof is sufficient. The changed package owner puts Undici in the canonical archive; the captured PR body reports a fresh npm install and a published-updater staged update of that candidate, with Doctor and candidate Gateway startup completing after the fix. No stored-data contract changes.
  • add rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • remove rating: 🦐 gold shrimp: Current PR rating is rating: 🦞 diamond lobster, so this older rating label is no longer current.

Label justifications:

  • P0: The reported missing module blocks a fresh npm install or staged update from starting OpenClaw without a usable in-product recovery path.
  • rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (terminal): The changed package owner puts Undici in the canonical archive; the captured PR body reports a fresh npm install and a published-updater staged update of that candidate, with Doctor and candidate Gateway startup completing after the fix. No stored-data contract changes.
  • proof: sufficient: Contributor real behavior proof is sufficient. The changed package owner puts Undici in the canonical archive; the captured PR body reports a fresh npm install and a published-updater staged update of that candidate, with Doctor and candidate Gateway startup completing after the fix. No stored-data contract changes.

Evidence

What I checked:

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • joshavant: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • RoboClaw: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

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-09-28T01:32:42.110Z sha 53b66f2 :: blocked before merge. :: none

@steipete
steipete merged commit ce73f2c into main Sep 28, 2026
311 of 313 checks passed
@steipete
steipete deleted the codex/package-bundled-peer-runtime branch September 28, 2026 01:44
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. labels Sep 28, 2026
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 28, 2026
steipete added a commit that referenced this pull request Sep 28, 2026
…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.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 29, 2026
…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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies-changed PR changes dependency-related files P0 Emergency: data loss, security bypass, crash loop, or unusable core runtime. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. scripts Repository scripts size: S status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant