Skip to content

fix(release): probe installed bundled channel entries on plain Node - #155940

Merged
steipete merged 1 commit into
mainfrom
fix/release-check-bundled-channel-smoke
Sep 22, 2026
Merged

steipete merged 1 commit into
mainfrom
fix/release-check-bundled-channel-smoke

Conversation

@steipete

Copy link
Copy Markdown
Contributor

Summary

Full Release Validation 35775979903 -> Full Release Artifacts 35776858944 fails in Prepare npm artifacts / Check npm package contents at release-check.ts -> runPackedBundledChannelEntrySmoke:

Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: No "exports" main defined in <prefix>/node_modules/unicorn-magic/package.json
    at resolveExports (node:internal/modules/cjs/loader)
    at Module._findPath
    at j._resolveFilename (tsx/dist/register-*.mjs)

Root cause (harness, not product)

release-check.ts runs node --import tsx scripts/test-built-bundled-channel-entry-smoke.mts --package-root <prefix>/node_modules/openclaw. For a package root that already looks installed, the smoke imported the bundled channel entries in the tsx process. loadChannelPlugin() goes through the plugin loader's native require(esm) path (tryNativeRequireModule, dist/native-module-require-*.mjs), and under tsx's CJS hook that ESM graph is resolved with the require condition. execa -> npm-run-path -> unicorn-magic is ESM-only (unicorn-magic exports only import targets), so the hook fails where plain Node's require(esm) succeeds.

The source-layout branch of the same smoke already re-ran the probe in a plain process.execPath child (no --import tsx), which is why pnpm build / prepack and the sibling local smoke passed while only the npm-installed prefix failed. scripts/check-built-plugin-control-plane-modules.mts documents the same trap for source-run hosts.

Real installs run the plugin loader on plain Node; the packaged smoke now does too.

Fix

scripts/test-built-bundled-channel-entry-smoke.mts: always run the packaged probe in a plain Node child (smokeInstalledPackageOnPlainNode); the temp installed-layout path reuses the same helper. No product code changes.

Proof

  • Reproduced locally with the 2026.9.6 candidate tarball (c02ef26bcef5) plus a packed @openclaw/ai, npm-installed into a temp prefix exactly like installPackedTarball; the release-check invocation fails with the CI error before the fix and passes after it (channel=3 setup=3 legacySetup=0).
  • node --require <trace> showed the require("execa") originating from dist/exec-spawn-*.mjs via native-module-require-*.mjs under resolveTsPaths (tsx CJS hook).
  • node scripts/run-vitest.mjs run test/scripts/release-check.test.ts test/openclaw-prepack.test.ts
  • OPENCLAW_TESTBOX=1 pnpm check:changed

release-check runs scripts/test-built-bundled-channel-entry-smoke.mts under
node --import tsx against the npm-installed package. For an installed-looking
package root the smoke imported the channel entries in-process, so the plugin
loader's require(esm) of the packaged plugin graph went through tsx's CJS hook,
which resolves execa -> npm-run-path -> unicorn-magic with the require
condition and dies with ERR_PACKAGE_PATH_NOT_EXPORTED (unicorn-magic exports
only import targets). The source layout already re-ran the probe in a plain
Node child, which is why only the packed lane failed.

Always run the packaged probe in a plain Node child, like a real install.
@clawsweeper

clawsweeper Bot commented Sep 22, 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: XS maintainer Maintainer-authored PR labels Sep 22, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 22, 2026
@clawsweeper

clawsweeper Bot commented Sep 22, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 22, 2026, 4:29 PM ET / 20:29 UTC.

ClawSweeper review

What this changes

Runs installed bundled-channel package checks in a plain Node child process so the release smoke avoids tsx’s incompatible module-resolution hook.

Merge readiness

✅ Ready for maintainer review

The fix remains necessary on the inspected main and latest release. The focused patch preserves smoke assertions, failure propagation, and cleanup; no blocking correctness issue was found.

Priority: P2
Reviewed head: 88a09fba45a20d550906894e2ab54d6bec61350d

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused harness repair with relevant recorded before/after package execution and no actionable findings.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (live_output): The captured body records an npm-installed candidate exercised through the affected release smoke: the tsx export-resolution failure becomes channel=3 setup=3 legacySetup=0 after the fix. Existing fixture tests supplement that result; no stored-data contract changes.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (live_output): The captured body records an npm-installed candidate exercised through the affected release smoke: the tsx export-resolution failure becomes channel=3 setup=3 legacySetup=0 after the fix. Existing fixture tests supplement that result; no stored-data contract changes.
Evidence reviewed 8 items Introduced change: The pinned introduction delta extracts the existing child-process invocation and applies it to already-installed roots. The recursion marker, inherited output, nonzero fallback, and temporary-layout finally block remain intact.
Actual release entry point: The release command explicitly starts the smoke with --import tsx, then supplies the npm-installed package root. The patch removes that preload from the probing child without changing the release caller's frozen-entrypoint compatibility.
Still needed on main and latest release: Both fetched main and the supplied v2026.9.5 release commit retain the condition that lets already-installed roots bypass the plain-Node child. Neither inspected revision contains this repair.
Findings None None.
Security None None.

How this fits together

Release validation installs the candidate npm package and checks that its bundled channel and setup entries load correctly. This smoke supplies a pass or failure to the package-release checks.

flowchart TD
  A[Candidate npm package] --> B[Release validation]
  B --> C[Package layout check]
  C -->|Already installed| E[Plain Node child]
  C -->|Source layout| D[Temporary installed layout]
  D --> E
  E --> F[Load channel and setup entries]
  F --> G[Assertions and exit status]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Other +7. Total +7 across 1 file.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 0 0 0 0
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 1 18 11 +7
Total 1 18 11 +7

Review metrics

None.

Technical review

Best possible solution:

Keep one plain-Node probe for both package layouts while preserving package assertions and failure cleanup.

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

Yes: the release caller's raw tsx preload and installed-root bypass establish the affected path, corroborated by the recorded candidate-package failure. This review did not execute it.

Is this the best way to solve the issue?

Yes: reusing the existing plain-Node child is a narrow repair that keeps the installed-package check representative of the deployed runtime.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 88f60ff9bcbf.

Labels

Label changes:

  • add P2: Repairs a bounded package-release validation failure without changing deployed product behavior.
  • add proof: sufficient: Contributor real behavior proof is sufficient. The captured body records an npm-installed candidate exercised through the affected release smoke: the tsx export-resolution failure becomes channel=3 setup=3 legacySetup=0 after the fix. Existing fixture tests supplement that result; no stored-data contract changes.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The captured body records an npm-installed candidate exercised through the affected release smoke: the tsx export-resolution failure becomes channel=3 setup=3 legacySetup=0 after the fix. Existing fixture tests supplement that result; no stored-data contract changes.

Label justifications:

  • P2: Repairs a bounded package-release validation failure without changing deployed product behavior.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The captured body records an npm-installed candidate exercised through the affected release smoke: the tsx export-resolution failure becomes channel=3 setup=3 legacySetup=0 after the fix. Existing fixture tests supplement that result; no stored-data contract changes.
  • proof: sufficient: Contributor real behavior proof is sufficient. The captured body records an npm-installed candidate exercised through the affected release smoke: the tsx export-resolution failure becomes channel=3 setup=3 legacySetup=0 after the fix. Existing fixture tests supplement that result; no stored-data contract changes.

Evidence

What I checked:

  • Introduced change: The pinned introduction delta extracts the existing child-process invocation and applies it to already-installed roots. The recursion marker, inherited output, nonzero fallback, and temporary-layout finally block remain intact. (scripts/test-built-bundled-channel-entry-smoke.mts:77, 88a09fba45a2)
  • Actual release entry point: The release command explicitly starts the smoke with --import tsx, then supplies the npm-installed package root. The patch removes that preload from the probing child without changing the release caller's frozen-entrypoint compatibility. (scripts/release-check.ts:156, 88a09fba45a2)
  • Still needed on main and latest release: Both fetched main and the supplied v2026.9.5 release commit retain the condition that lets already-installed roots bypass the plain-Node child. Neither inspected revision contains this repair. (scripts/test-built-bundled-channel-entry-smoke.mts:91, ec9c1a13db89)
  • Existing boundary coverage: The existing standalone smoke suite checks three layouts against valid entries, invalid entries, and missing transitive dependencies, including exit status, a single success marker, preserved source files, and temporary-directory cleanup. Tests were inspected but not executed during this read-only review. (test/openclaw-prepack.test.ts:347, 88a09fba45a2)
  • Recorded real package proof: The captured PR body reports the same release-check invocation failing before and passing after the change against an npm-installed 2026.9.6 candidate plus packed @openclaw/ai, with output channel=3 setup=3 legacySetup=0. It also records a trace through tsx's CJS hook and the native module loader. This is contributor-reported execution, not a reviewer-run test. (88a09fba45a2)
  • Verified merge scope: The raw test-merge record has fetched main followed by the exact PR head as its parents. Comparing that result with its main parent changes only the smoke script; the other endpoint differences are base-branch work. (scripts/test-built-bundled-channel-entry-smoke.mts:85, 0957c1353884)

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • vincentkoc: 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.

@steipete
steipete merged commit b060cfe into main Sep 22, 2026
242 of 244 checks passed
@steipete
steipete deleted the fix/release-check-bundled-channel-smoke branch September 22, 2026 21:06
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

steipete added a commit that referenced this pull request Sep 23, 2026
…155940)

release-check runs scripts/test-built-bundled-channel-entry-smoke.mts under
node --import tsx against the npm-installed package. For an installed-looking
package root the smoke imported the channel entries in-process, so the plugin
loader's require(esm) of the packaged plugin graph went through tsx's CJS hook,
which resolves execa -> npm-run-path -> unicorn-magic with the require
condition and dies with ERR_PACKAGE_PATH_NOT_EXPORTED (unicorn-magic exports
only import targets). The source layout already re-ran the probe in a plain
Node child, which is why only the packed lane failed.

Always run the packaged probe in a plain Node child, like a real install.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 23, 2026
…penclaw#155940)

release-check runs scripts/test-built-bundled-channel-entry-smoke.mts under
node --import tsx against the npm-installed package. For an installed-looking
package root the smoke imported the channel entries in-process, so the plugin
loader's require(esm) of the packaged plugin graph went through tsx's CJS hook,
which resolves execa -> npm-run-path -> unicorn-magic with the require
condition and dies with ERR_PACKAGE_PATH_NOT_EXPORTED (unicorn-magic exports
only import targets). The source layout already re-ran the probe in a plain
Node child, which is why only the packed lane failed.

Always run the packaged probe in a plain Node child, like a real install.
@roboclaw-bot roboclaw-bot mentioned this pull request Sep 24, 2026
2 of 8 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. scripts Repository scripts size: XS 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