Repository navigation
fix(scripts): avoid redundant npm version process in package checks - #157809
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: blocked before merge. Reviewed September 24, 2026, 10:51 PM ET / September 25, 2026, 02:51 UTC (Revision 4). ClawSweeper reviewWhat this changesThe branch reads npm’s diagnostic version from the selected Node toolchain manifest when available, retains the command fallback, and strengthens package-check tests. Merge readiness⛔ Blocked before merge - 1 item remains Keep open. Current main and the latest release still run the diagnostic npm version process before package inventory validation. The earlier migration concern does not apply because this patch changes no stored OpenClaw data. Priority: P2 Review scores
Verification
How this fits togetherOpenClaw’s release tooling checks a package tarball against the files npm would pack before accepting the artifact. The npm runner selects the toolchain command, and the checker uses its result to report diagnostics and validate inventory. flowchart LR
A[Package tarball] --> B[Package checker]
C[Node toolchain] --> D[npm runner]
D --> E[Version diagnostic]
E --> B
B --> F[npm pack dry run]
F --> G[Inventory comparison]
G --> H[Accept or reject package]
Before merge
Agent review detailsSecurityNone. PR surfaceTests +25, Other +14. Total +39 across 4 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Technical reviewBest possible solution: Land the focused checker repair through ordinary review gates, keeping real npm pack inventory as the package-validation authority. Do we have a high-confidence way to reproduce the issue? Yes. Current main runs npm --version before inventory comparison, and the PR’s production-checker test blocks that subprocess to expose the failure; this read-only review did not execute the test. Is this the best way to solve the issue? Yes. Using the manifest associated with the already-selected npm CLI removes the unnecessary diagnostic process while preserving the command fallback and actual npm inventory check. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against eacc8dcd118c. LabelsLabel changes: No label changes. Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
History |
|
Merged via squash.
|
…4-prep * commit '8fe893da516ebdc817692fb2d272e27bc3c88376': (31 commits) fix(test): wait for reload admission before restart polling (#157964) refactor(mattermost): reuse DM retry option selection (#157800) chore(i18n): refresh native locales (#157850) perf(sessions): reuse current participants across transcript appends (#157622) refactor(signal): share pending transport migration results (#157777) fix(tui): open model pickers without waiting for the Gateway (#157839) fix(gateway): apply config despite delayed file notifications (#157906) fix(auth): clear deleted account selections and support account recovery (#157745) fix: plugin reloads lose tool results and strand subagent settlement (#157339) fix(gateway): avoid preview errors during worker metadata updates (#157943) refactor(diffs): reuse native promisify for compression (#157835) fix(models): keep current choices on the first picker page (#157869) fix(plugins): retain existing quarantine across unrelated reloads (#157907) fix(openai): prioritize ChatGPT sign-in and clarify auth choices (#157792) chore(ui): refresh control ui locales (#157955) fix(ui): refresh connected accounts after auth changes (#157950) fix(scripts): avoid redundant npm version process in package checks (#157809) refactor(usage): capture hosted pricing once per operation (#157838) refactor(ui): share slash-command failure results (#157649) fix(cron): announce runs miss the channel's formatting rules (#157877) ...
What Problem This Solves
Package verification can reject a valid tarball before inspecting its npm inventory because a separate diagnostic-only
npm --versionprocess fails. While qualifying #157765, Windows CI timed out this probe after 10 seconds even though tarball preflight and extraction succeeded. The reason for that Windows startup delay remains unproven.User Impact
Standard Node toolchain installations now read npm's diagnostic version from the package manifest belonging to the exact CLI selected by the existing npm runner. Real
npm pack --dry-runstill owns inventory validation. Its timeout, sandbox, lifecycle suppression, output limits, error handling, and file comparisons are unchanged. Executable/shim/PATH npm installations without a known CLI manifest retain their existing version probe.Why This Change Was Made
npm itself reports the version from its package manifest. Returning that manifest location from the canonical toolchain resolver removes the redundant process without a second npm locator or a longer timeout. The existing real-pnpm package test now rejects the separate version process while allowing actual npm packing and inventory comparison to run.
Evidence
Blacksmith Testbox
tbx_01m3b2ajg4vgtdvy8hd314h5ax, run 36081500042, fresh-main baseef2dd3235123371860c9154da7b47b2c1e940788:npm version subprocess unavailable, then passes with the repair. It allows actual npm packing and comparison to run; no added real timer or production test hook.check-openclaw-package-tarball.test.tsran 21 consecutive times, with all 101 tests passing each time and no skips. Every existing rejection case remains enabled.pnpm test <file> --maxWorkers=1): npm runner 1.29s; full tarball file 20.65s (101 cases). No test count was added; the existing positive tarball case is stronger. Hosted Windows tarball-file time is 59.087s / 101 tests, including the strengthened regression at 1.174s. The file retains real tar-header, extraction, lifecycle, and npm-inventory boundaries; cheaper helper-only proof would miss those contracts. All nine npm-runner cases also passed on native Windows; that reporter emits only per-case timings for this fast file, so no hosted file-level duration is available.node scripts/check-changed.mjs -- <four changed paths>passed in 299s, including script/test-root types, formatting, lint, erasability, and dead-export checks.pnpm buildpassed in 484s. A declaration compiler emittedcontext canceled, then both declaration batches completed, all 158 public SDK subpaths verified, and the complete build exited zero. No rerun was required.The first transfer stopped before test execution because the local index changed during source freezing. The retry used the same lease with a fixed index; it did not retry a failed product test. Final candidate hashes matched after all phases, the wrapper exited zero, and the lease was explicitly stopped. No timeout, retry policy, assertion, skip, or baseline was relaxed.
Hosted CI — READY-TO-LAND
Exact-head CI run 36084529216, head
ab201d64c0a3b4b4165cc69665821abd3446b555, completed successfully: 132 jobs terminal, zero failures. Required statusesopenclaw/ci-gate,openclaw/security-sensitive-review, andopenclaw/dependency-revieware all successful.checks-windows-node-test-2(job 107913764707) passed the real-pnpm regression, all 101 tarball cases, and all nine npm-runner cases on native Windows. Hosted Ubuntu assignment delayed the run; CI was not rerun and no routing or capacity settings changed. This PR is left open and unmerged at READY-TO-LAND.Review disposition
ClawSweeper's technical reviews found no actionable code or security issue; its revision 2 also explicitly agrees that stored-data upgrade proof does not apply. Its automated data-model heuristic separately requested migration proof for
scripts/lib/npm-pack-inventory.mts; that requirement does not apply to this patch. The added operation only reads the existing manifest belonging to the selected npm installation. No persisted OpenClaw state, schema, serialized format, retention, or upgrade contract changes. The pre-existingwithoutPackageScriptsoperation still touches only a unique disposable extracted package and restores its original bytes and mode; that code is unchanged, and the retained inventory tests verify restoration on success and failure. No migration or approval exception is needed.