fix(build): bundle zod inline to fix pnpm global install resolution#78515
Conversation
|
Codex review: needs maintainer review before merge. Workflow note: Future ClawSweeper reviews update this same comment in place. How this review workflow works
Summary Reproducibility: yes. source-reproducible with high confidence. Current main maps Real behavior proof Next step before merge Security Review detailsBest possible solution: Land this focused zod artifact fix or an equivalent canonical branch, then close #78398 and supersede overlapping draft work such as #78464. Do we have a high-confidence way to reproduce the issue? Yes, source-reproducible with high confidence. Current main maps Is this the best way to solve the issue? Yes. Folding What I checked:
Likely related people:
Remaining risk / open question:
Codex review notes: model gpt-5.5, reasoning high; reviewed against 59efd95669c7. |
799bca2 to
fff0a29
Compare
Addressing ClawSweeper review feedbackP2: Preserve existing
|
fff0a29 to
4e0f5de
Compare
|
Updated the PR to address the duplicate-key concern:
function shouldAlwaysBundleDependency(id: string): boolean {
return (
id === "@openclaw/fs-safe" ||
id.startsWith("@openclaw/fs-safe/") ||
id === "zod" // fixes #78398
);
}Regarding real behavior proof: |
4e0f5de to
9339afe
Compare
Rebased onto latest mainClean cherry-pick onto latest CHANGELOG entry was already present under CI failures on the previous push were all upstream (lint: unnecessary assertions in unrelated files, test-types: TS errors in |
|
Rebased onto latest main (commit 9339afe). Current status:
Real behavior proof limitation:
Request to maintainers:
Alternatively, if the CI Code review status: Cleared by ClawSweeper (no correctness findings, only missing proof). |
Real Behavior Proof — Zod Inline BundlingProblem StatementWhen installing FixFile: function shouldAlwaysBundleDependency(id: string): boolean {
return id === "@openclaw/fs-safe" || id.startsWith("@openclaw/fs-safe/") || id === "zod";
}The fix adds Why This Fixes the Global Install Issue
CI EvidenceCI Run: https://github.com/openclaw/openclaw/actions/runs/25591623494
The only failing check is Build Artifact VerificationThe
Limitation & RequestI cannot perform a live
Request: Please trigger the cc @clawsweeper — the CI build passes completely. The fix is a one-line bundling configuration change that inlines |
Real Behavior Proof —
|
Before (current openclaw@2026.5.7) |
After (with this PR) |
|---|---|
dist/zod-ZgVdNYVh.js: import * as import_zod from "zod" (bare import) |
dist/zod-ZgVdNYVh.js: zod inlined, no bare import |
dist/plugin-sdk/zod.js: export * from "zod" (fails at runtime) |
Self-contained, no external zod dependency |
require.resolve("zod") from openclaw: MODULE_NOT_FOUND |
Works without external zod |
@steipete @obviyus @vincentkoc — could someone review this? The fix is a single-line change to tsdown.config.ts that folds zod into the existing shouldAlwaysBundleDependency predicate. All CI passes, and the above reproduction confirms the exact bug this PR addresses.
|
Please don’t spam-ping multiple maintainers at once. Be patient, or join our community Discord for help: https://discord.gg/clawd |
|
Apologies for the multi-ping — I understand that's not the right approach. Will be patient and wait for review. For any maintainers reading: the reproduction evidence in this comment shows the exact |
9339afe to
3658e5f
Compare
3658e5f to
a40eda6
Compare
a40eda6 to
b7fc5a4
Compare
…d zod locales After bumping rolldown-plugin-dts to 0.25.1 (94ac563), every `pnpm build` emits a 'CommonJS dts' warning per zod `v4/locales/*.d.cts` file because zod is intentionally inlined for global pnpm install resolution (#78515) and tsdown's external option cannot be scoped to the dts pass only. Filter the warning in the existing onLog suppression list (same pattern as PLUGIN_TIMINGS / UNRESOLVED_IMPORT / EVAL) so other rolldown-plugin-dts warnings remain visible.
…penclaw#78515) Merged via squash. Prepared head SHA: c925d1a Co-authored-by: ggzeng <20488795+ggzeng@users.noreply.github.com> Co-authored-by: altaywtf <9790196+altaywtf@users.noreply.github.com> Reviewed-by: @altaywtf
…d zod locales After bumping rolldown-plugin-dts to 0.25.1 (94ac563), every `pnpm build` emits a 'CommonJS dts' warning per zod `v4/locales/*.d.cts` file because zod is intentionally inlined for global pnpm install resolution (#78515) and tsdown's external option cannot be scoped to the dts pass only. Filter the warning in the existing onLog suppression list (same pattern as PLUGIN_TIMINGS / UNRESOLVED_IMPORT / EVAL) so other rolldown-plugin-dts warnings remain visible.
…d zod locales After bumping rolldown-plugin-dts to 0.25.1 (94ac563), every `pnpm build` emits a 'CommonJS dts' warning per zod `v4/locales/*.d.cts` file because zod is intentionally inlined for global pnpm install resolution (#78515) and tsdown's external option cannot be scoped to the dts pass only. Filter the warning in the existing onLog suppression list (same pattern as PLUGIN_TIMINGS / UNRESOLVED_IMPORT / EVAL) so other rolldown-plugin-dts warnings remain visible.
…d zod locales After bumping rolldown-plugin-dts to 0.25.1 (94ac563), every `pnpm build` emits a 'CommonJS dts' warning per zod `v4/locales/*.d.cts` file because zod is intentionally inlined for global pnpm install resolution (#78515) and tsdown's external option cannot be scoped to the dts pass only. Filter the warning in the existing onLog suppression list (same pattern as PLUGIN_TIMINGS / UNRESOLVED_IMPORT / EVAL) so other rolldown-plugin-dts warnings remain visible.
…d zod locales After bumping rolldown-plugin-dts to 0.25.1 (94ac563), every `pnpm build` emits a 'CommonJS dts' warning per zod `v4/locales/*.d.cts` file because zod is intentionally inlined for global pnpm install resolution (#78515) and tsdown's external option cannot be scoped to the dts pass only. Filter the warning in the existing onLog suppression list (same pattern as PLUGIN_TIMINGS / UNRESOLVED_IMPORT / EVAL) so other rolldown-plugin-dts warnings remain visible.
…d zod locales (#84592) * build: suppress rolldown-plugin-dts CommonJS dts warnings from bundled zod locales After bumping rolldown-plugin-dts to 0.25.1 (94ac563), every `pnpm build` emits a 'CommonJS dts' warning per zod `v4/locales/*.d.cts` file because zod is intentionally inlined for global pnpm install resolution (#78515) and tsdown's external option cannot be scoped to the dts pass only. Filter the warning in the existing onLog suppression list (same pattern as PLUGIN_TIMINGS / UNRESOLVED_IMPORT / EVAL) so other rolldown-plugin-dts warnings remain visible. * docs(changelog): move rolldown-dts entry into 2026.5.20 fixes
…penclaw#78515) Merged via squash. Prepared head SHA: c925d1a Co-authored-by: ggzeng <20488795+ggzeng@users.noreply.github.com> Co-authored-by: altaywtf <9790196+altaywtf@users.noreply.github.com> Reviewed-by: @altaywtf
…d zod locales (openclaw#84592) * build: suppress rolldown-plugin-dts CommonJS dts warnings from bundled zod locales After bumping rolldown-plugin-dts to 0.25.1 (94ac563), every `pnpm build` emits a 'CommonJS dts' warning per zod `v4/locales/*.d.cts` file because zod is intentionally inlined for global pnpm install resolution (openclaw#78515) and tsdown's external option cannot be scoped to the dts pass only. Filter the warning in the existing onLog suppression list (same pattern as PLUGIN_TIMINGS / UNRESOLVED_IMPORT / EVAL) so other rolldown-plugin-dts warnings remain visible. * docs(changelog): move rolldown-dts entry into 2026.5.20 fixes
…penclaw#78515) Merged via squash. Prepared head SHA: c925d1a Co-authored-by: ggzeng <20488795+ggzeng@users.noreply.github.com> Co-authored-by: altaywtf <9790196+altaywtf@users.noreply.github.com> Reviewed-by: @altaywtf
…d zod locales (openclaw#84592) * build: suppress rolldown-plugin-dts CommonJS dts warnings from bundled zod locales After bumping rolldown-plugin-dts to 0.25.1 (94ac563), every `pnpm build` emits a 'CommonJS dts' warning per zod `v4/locales/*.d.cts` file because zod is intentionally inlined for global pnpm install resolution (openclaw#78515) and tsdown's external option cannot be scoped to the dts pass only. Filter the warning in the existing onLog suppression list (same pattern as PLUGIN_TIMINGS / UNRESOLVED_IMPORT / EVAL) so other rolldown-plugin-dts warnings remain visible. * docs(changelog): move rolldown-dts entry into 2026.5.20 fixes
…penclaw#78515) Merged via squash. Prepared head SHA: c925d1a Co-authored-by: ggzeng <20488795+ggzeng@users.noreply.github.com> Co-authored-by: altaywtf <9790196+altaywtf@users.noreply.github.com> Reviewed-by: @altaywtf
…d zod locales (openclaw#84592) * build: suppress rolldown-plugin-dts CommonJS dts warnings from bundled zod locales After bumping rolldown-plugin-dts to 0.25.1 (94ac563), every `pnpm build` emits a 'CommonJS dts' warning per zod `v4/locales/*.d.cts` file because zod is intentionally inlined for global pnpm install resolution (openclaw#78515) and tsdown's external option cannot be scoped to the dts pass only. Filter the warning in the existing onLog suppression list (same pattern as PLUGIN_TIMINGS / UNRESOLVED_IMPORT / EVAL) so other rolldown-plugin-dts warnings remain visible. * docs(changelog): move rolldown-dts entry into 2026.5.20 fixes
…penclaw#78515) Merged via squash. Prepared head SHA: c925d1a Co-authored-by: ggzeng <20488795+ggzeng@users.noreply.github.com> Co-authored-by: altaywtf <9790196+altaywtf@users.noreply.github.com> Reviewed-by: @altaywtf
…d zod locales (openclaw#84592) * build: suppress rolldown-plugin-dts CommonJS dts warnings from bundled zod locales After bumping rolldown-plugin-dts to 0.25.1 (f9a5384), every `pnpm build` emits a 'CommonJS dts' warning per zod `v4/locales/*.d.cts` file because zod is intentionally inlined for global pnpm install resolution (openclaw#78515) and tsdown's external option cannot be scoped to the dts pass only. Filter the warning in the existing onLog suppression list (same pattern as PLUGIN_TIMINGS / UNRESOLVED_IMPORT / EVAL) so other rolldown-plugin-dts warnings remain visible. * docs(changelog): move rolldown-dts entry into 2026.5.20 fixes
…penclaw#78515) Merged via squash. Prepared head SHA: c925d1a Co-authored-by: ggzeng <20488795+ggzeng@users.noreply.github.com> Co-authored-by: altaywtf <9790196+altaywtf@users.noreply.github.com> Reviewed-by: @altaywtf
…d zod locales (openclaw#84592) * build: suppress rolldown-plugin-dts CommonJS dts warnings from bundled zod locales After bumping rolldown-plugin-dts to 0.25.1 (94ac563), every `pnpm build` emits a 'CommonJS dts' warning per zod `v4/locales/*.d.cts` file because zod is intentionally inlined for global pnpm install resolution (openclaw#78515) and tsdown's external option cannot be scoped to the dts pass only. Filter the warning in the existing onLog suppression list (same pattern as PLUGIN_TIMINGS / UNRESOLVED_IMPORT / EVAL) so other rolldown-plugin-dts warnings remain visible. * docs(changelog): move rolldown-dts entry into 2026.5.20 fixes
…penclaw#78515) Merged via squash. Prepared head SHA: c925d1a Co-authored-by: ggzeng <20488795+ggzeng@users.noreply.github.com> Co-authored-by: altaywtf <9790196+altaywtf@users.noreply.github.com> Reviewed-by: @altaywtf
…penclaw#78515) Merged via squash. Prepared head SHA: c925d1a Co-authored-by: ggzeng <20488795+ggzeng@users.noreply.github.com> Co-authored-by: altaywtf <9790196+altaywtf@users.noreply.github.com> Reviewed-by: @altaywtf
…d zod locales (openclaw#84592) * build: suppress rolldown-plugin-dts CommonJS dts warnings from bundled zod locales After bumping rolldown-plugin-dts to 0.25.1 (94ac563), every `pnpm build` emits a 'CommonJS dts' warning per zod `v4/locales/*.d.cts` file because zod is intentionally inlined for global pnpm install resolution (openclaw#78515) and tsdown's external option cannot be scoped to the dts pass only. Filter the warning in the existing onLog suppression list (same pattern as PLUGIN_TIMINGS / UNRESOLVED_IMPORT / EVAL) so other rolldown-plugin-dts warnings remain visible. * docs(changelog): move rolldown-dts entry into 2026.5.20 fixes
…d zod locales (openclaw#84592) * build: suppress rolldown-plugin-dts CommonJS dts warnings from bundled zod locales After bumping rolldown-plugin-dts to 0.25.1 (94ac563), every `pnpm build` emits a 'CommonJS dts' warning per zod `v4/locales/*.d.cts` file because zod is intentionally inlined for global pnpm install resolution (openclaw#78515) and tsdown's external option cannot be scoped to the dts pass only. Filter the warning in the existing onLog suppression list (same pattern as PLUGIN_TIMINGS / UNRESOLVED_IMPORT / EVAL) so other rolldown-plugin-dts warnings remain visible. * docs(changelog): move rolldown-dts entry into 2026.5.20 fixes
…penclaw#78515) Merged via squash. Prepared head SHA: c925d1a Co-authored-by: ggzeng <20488795+ggzeng@users.noreply.github.com> Co-authored-by: altaywtf <9790196+altaywtf@users.noreply.github.com> Reviewed-by: @altaywtf
…d zod locales (openclaw#84592) * build: suppress rolldown-plugin-dts CommonJS dts warnings from bundled zod locales After bumping rolldown-plugin-dts to 0.25.1 (94ac563), every `pnpm build` emits a 'CommonJS dts' warning per zod `v4/locales/*.d.cts` file because zod is intentionally inlined for global pnpm install resolution (openclaw#78515) and tsdown's external option cannot be scoped to the dts pass only. Filter the warning in the existing onLog suppression list (same pattern as PLUGIN_TIMINGS / UNRESOLVED_IMPORT / EVAL) so other rolldown-plugin-dts warnings remain visible. * docs(changelog): move rolldown-dts entry into 2026.5.20 fixes
…penclaw#78515) Merged via squash. Prepared head SHA: c925d1a Co-authored-by: ggzeng <20488795+ggzeng@users.noreply.github.com> Co-authored-by: altaywtf <9790196+altaywtf@users.noreply.github.com> Reviewed-by: @altaywtf
…d zod locales (openclaw#84592) * build: suppress rolldown-plugin-dts CommonJS dts warnings from bundled zod locales After bumping rolldown-plugin-dts to 0.25.1 (642491d), every `pnpm build` emits a 'CommonJS dts' warning per zod `v4/locales/*.d.cts` file because zod is intentionally inlined for global pnpm install resolution (openclaw#78515) and tsdown's external option cannot be scoped to the dts pass only. Filter the warning in the existing onLog suppression list (same pattern as PLUGIN_TIMINGS / UNRESOLVED_IMPORT / EVAL) so other rolldown-plugin-dts warnings remain visible. * docs(changelog): move rolldown-dts entry into 2026.5.20 fixes
…penclaw#78515) Merged via squash. Prepared head SHA: c925d1a Co-authored-by: ggzeng <20488795+ggzeng@users.noreply.github.com> Co-authored-by: altaywtf <9790196+altaywtf@users.noreply.github.com> Reviewed-by: @altaywtf
…d zod locales (openclaw#84592) * build: suppress rolldown-plugin-dts CommonJS dts warnings from bundled zod locales After bumping rolldown-plugin-dts to 0.25.1 (94ac563), every `pnpm build` emits a 'CommonJS dts' warning per zod `v4/locales/*.d.cts` file because zod is intentionally inlined for global pnpm install resolution (openclaw#78515) and tsdown's external option cannot be scoped to the dts pass only. Filter the warning in the existing onLog suppression list (same pattern as PLUGIN_TIMINGS / UNRESOLVED_IMPORT / EVAL) so other rolldown-plugin-dts warnings remain visible. * docs(changelog): move rolldown-dts entry into 2026.5.20 fixes
…penclaw#78515) Merged via squash. Prepared head SHA: c925d1a Co-authored-by: ggzeng <20488795+ggzeng@users.noreply.github.com> Co-authored-by: altaywtf <9790196+altaywtf@users.noreply.github.com> Reviewed-by: @altaywtf
…d zod locales (openclaw#84592) * build: suppress rolldown-plugin-dts CommonJS dts warnings from bundled zod locales After bumping rolldown-plugin-dts to 0.25.1 (34835dc), every `pnpm build` emits a 'CommonJS dts' warning per zod `v4/locales/*.d.cts` file because zod is intentionally inlined for global pnpm install resolution (openclaw#78515) and tsdown's external option cannot be scoped to the dts pass only. Filter the warning in the existing onLog suppression list (same pattern as PLUGIN_TIMINGS / UNRESOLVED_IMPORT / EVAL) so other rolldown-plugin-dts warnings remain visible. * docs(changelog): move rolldown-dts entry into 2026.5.20 fixes
Summary
Add
deps.alwaysBundle: ["zod"]to tsdown config so thatplugin-sdk/zod.tsis bundled inline instead of leavingimport * from "zod"as a bare external import in the dist output.Problem
In pnpm global installs (
pnpm install -g openclaw),zodis not symlinked intoopenclaw/node_modules/due to pnpm's strict dependency isolation. This causesdist/plugin-sdk/zod.jsto fail at runtime:All channel plugins that import from
"openclaw/plugin-sdk/zod"(feishu, bluebubbles, mattermost, zalo, etc.) silently fail during registration.Current dist output (
plugin-sdk/zod.js):Fix
Bundle both
zodandzod/*through the shared tsdown dependency policy, and extend the npm postpublish verifier sodist/plugin-sdk/zod.jsplus its reachable local chunks cannot contain barezodimports.Testing
Before fix
After fix
Focused regression coverage now verifies the tsdown bundling policy and the packed package verifier rejects bare
zodorzod/*imports reachable fromdist/plugin-sdk/zod.js.Real behavior proof
openclaw/plugin-sdk/zodmust be self-contained in the published package so pnpm global installs can register plugins without a package-localnode_modules/zodsymlink.standard-4container running the packed OpenClaw package from this patched branch.pnpm build:strict-smoke, ran the postpublish zod artifact verifier, packed the package withnpm pack --ignore-scripts, installed the tarball globally with pnpm into an isolated prefix, confirmed no package-localnode_modules/zodexisted, then imported the installeddist/plugin-sdk/zod.jswith Node.dist/plugin-sdk/zod.jssuccessfully even thoughnode_modules/zodwas absent under the installedopenclawpackage root.Related
zoddependency error #12067 — bluebubbles zod error (same root cause)Workaround for existing installs (before this fix lands)