openclaw - 💡(How to fix) Fix build:docker missing write-npm-update-compat-sidecars step causes intermittent Install Smoke failures [1 comments, 1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#68629Fetched 2026-04-19 15:09:19
View on GitHub
Comments
1
Participants
1
Timeline
4
Reactions
0
Participants
Timeline (top)
closed ×1commented ×1mentioned ×1subscribed ×1

The build:docker script in package.json (used by the CI Dockerfile that backs the Install Smoke workflow) is missing the step that writes scripts/write-npm-update-compat-sidecars.ts outputs. As a result, dist/extensions/qa-channel/runtime-api.js (a 109-byte compat stub) is absent from fresh Docker builds, and Install Smoke fails whenever:

  1. A PR's changed paths pass the Install Smoke preflight gate (so smoke actually runs), and
  2. The CI Dockerfile layer cache is cold on the runner (so build:docker runs end-to-end rather than reusing a cached layer).

pnpm build (via scripts/build-all.mjs) does run this step, which is why local builds and most CI paths are unaffected.

Root Cause

The build:docker script in package.json (used by the CI Dockerfile that backs the Install Smoke workflow) is missing the step that writes scripts/write-npm-update-compat-sidecars.ts outputs. As a result, dist/extensions/qa-channel/runtime-api.js (a 109-byte compat stub) is absent from fresh Docker builds, and Install Smoke fails whenever:

  1. A PR's changed paths pass the Install Smoke preflight gate (so smoke actually runs), and
  2. The CI Dockerfile layer cache is cold on the runner (so build:docker runs end-to-end rather than reusing a cached layer).

pnpm build (via scripts/build-all.mjs) does run this step, which is why local builds and most CI paths are unaffected.

Code Example

-    "build:docker": "node scripts/tsdown-build.mjs && node scripts/runtime-postbuild.mjs && node scripts/build-stamp.mjs && …",
+    "build:docker": "node scripts/tsdown-build.mjs && node scripts/runtime-postbuild.mjs && node --import tsx scripts/write-npm-update-compat-sidecars.ts && node scripts/build-stamp.mjs && …",
RAW_BUFFERClick to expand / collapse

Summary

The build:docker script in package.json (used by the CI Dockerfile that backs the Install Smoke workflow) is missing the step that writes scripts/write-npm-update-compat-sidecars.ts outputs. As a result, dist/extensions/qa-channel/runtime-api.js (a 109-byte compat stub) is absent from fresh Docker builds, and Install Smoke fails whenever:

  1. A PR's changed paths pass the Install Smoke preflight gate (so smoke actually runs), and
  2. The CI Dockerfile layer cache is cold on the runner (so build:docker runs end-to-end rather than reusing a cached layer).

pnpm build (via scripts/build-all.mjs) does run this step, which is why local builds and most CI paths are unaffected.

Evidence

  • scripts/write-npm-update-compat-sidecars.ts is listed in scripts/build-all.mjs.
  • It is not listed in the build:docker script in package.json.
  • Running the script directly regenerates dist/extensions/qa-channel/runtime-api.js with the expected 109-byte contents.
  • Source of truth: NPM_UPDATE_COMPAT_SIDECARS in the infra config declares this file as a required compat stub.

Why this hasn't surfaced often

Most main-branch Install Smoke runs record "conclusion":"skipped" — the preflight changed-path gate does not trigger install-smoke on typical commits. The failure only surfaces when both the preflight gate and a cold Docker layer cache line up on the same run.

Surfaced concretely in openclaw/openclaw#67508, where the PR's changed paths happened to fall inside the smoke scope and a commit invalidated the Dockerfile layer cache.

Proposed fix (one line)

Insert scripts/write-npm-update-compat-sidecars.ts between runtime-postbuild and build-stamp in build:docker, matching the order used in build-all.mjs:

-    "build:docker": "node scripts/tsdown-build.mjs && node scripts/runtime-postbuild.mjs && node scripts/build-stamp.mjs && …",
+    "build:docker": "node scripts/tsdown-build.mjs && node scripts/runtime-postbuild.mjs && node --import tsx scripts/write-npm-update-compat-sidecars.ts && node scripts/build-stamp.mjs && …",

Alternative

Promote the sidecar-writing step into runtime-postbuild.mjs (or another shared build stage) so both pnpm build and build:docker inherit it automatically and the two scripts cannot drift again. Slightly more refactoring, removes the duplicate-declaration risk permanently.

AI-assisted

Drafted with Claude Code during openclaw/openclaw#67508 review iterations.

extent analysis

TL;DR

Insert scripts/write-npm-update-compat-sidecars.ts into the build:docker script to ensure dist/extensions/qa-channel/runtime-api.js is generated.

Guidance

  • Verify the absence of dist/extensions/qa-channel/runtime-api.js in fresh Docker builds by checking the file's presence after running build:docker.
  • Apply the proposed fix by inserting node --import tsx scripts/write-npm-update-compat-sidecars.ts between runtime-postbuild and build-stamp in build:docker.
  • Consider promoting the sidecar-writing step into runtime-postbuild.mjs to avoid duplicate declarations and ensure consistency between pnpm build and build:docker.
  • Test the fix by running Install Smoke with a cold Docker layer cache and verifying that dist/extensions/qa-channel/runtime-api.js is generated correctly.

Example

The proposed fix can be applied as follows:

-    "build:docker": "node scripts/tsdown-build.mjs && node scripts/runtime-postbuild.mjs && node scripts/build-stamp.mjs && …",
+    "build:docker": "node scripts/tsdown-build.mjs && node scripts/runtime-postbuild.mjs && node --import tsx scripts/write-npm-update-compat-sidecars.ts && node scripts/build-stamp.mjs && …",

Notes

This fix assumes that the scripts/write-npm-update-compat-sidecars.ts script is correctly implemented and generates the required dist/extensions/qa-channel/runtime-api.js file.

Recommendation

Apply the workaround by inserting scripts/write-npm-update-compat-sidecars.ts into the build:docker script, as this is a straightforward fix that addresses the immediate issue. Promoting the sidecar-writing step into runtime-postbuild.mjs is a more robust solution but requires additional refactoring.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

openclaw - 💡(How to fix) Fix build:docker missing write-npm-update-compat-sidecars step causes intermittent Install Smoke failures [1 comments, 1 participants]