Skip to content

fix(scripts): include ui:build in build-all full and ciArtifacts profiles - #86010

Merged
steipete merged 3 commits into
openclaw:mainfrom
1052326311:fix/build-all-include-ui-build
May 25, 2026
Merged

steipete merged 3 commits into
openclaw:mainfrom
1052326311:fix/build-all-include-ui-build

Conversation

@1052326311

Copy link
Copy Markdown
Contributor

Summary

Adds ui:build to the full and ciArtifacts profiles of scripts/build-all.mjs so pnpm build produces a complete dist/ tree — both dist/index.js and dist/control-ui/index.html — in one command, instead of requiring users to remember a second pnpm ui:build after every backend build.

Closes #85206.

Why this is needed

scripts/tsdown-build.mjs removes dist and dist-runtime before invoking tsdown (scripts/tsdown-build.mjs:58), and Vite is the only path that writes dist/control-ui (ui/vite.config.ts:9). On current main, pnpm build runs the full profile but the profile has no ui:build step, so a backend rebuild can delete previously-generated Control UI assets and leave the gateway serving the documented missing-assets message (src/gateway/control-ui.ts:61).

The docs workaround pnpm build && pnpm ui:build is correct about ordering but is not a reliable contract for source/live runtimes, automation, or hotfix workflows. Startup auto-repair can mask the failure, but it does so at the worst possible time — gateway startup / LaunchAgent readiness / remote-access recovery — and users still observe a 503 before repair completes. Issue #85206 documents the five concrete failure modes and the source-level evidence that this is a build-pipeline gap rather than a docs gap.

What changed

  • scripts/build-all.mjs: new ui:build step inserted after copy-export-html-templates and before write-build-info, declared as pnpm ui:build with a dist/control-ui cache output and ui/, scripts/ui.js, scripts/lib/copy-assets.ts as cache inputs. Added to BUILD_ALL_PROFILES.full (automatic via BUILD_ALL_STEPS) and explicitly added to BUILD_ALL_PROFILES.ciArtifacts. Not added to gatewayWatch or cliStartup so backend-only dev loops stay fast — this matches the issue's Scope boundary requirement.
  • PNPM_STEP_NODE_FALLBACKS: added ["ui:build", ["scripts/ui.js", "build"]] so the OPENCLAW_BUILD_ALL_NO_PNPM=1 path keeps working for the new step.
  • test/scripts/build-all.test.ts: updated the ciArtifacts ordered-list assertion, and added three new regression tests — ui:build is present in full and ciArtifacts after tsdown/runtime-postbuild-stamp and before write-build-info; ui:build is excluded from gatewayWatch/cliStartup; the ui:build step declares dist/control-ui as its cache output.
  • CHANGELOG.md Unreleased / Changes entry referencing Source/runtime builds can leave dist/control-ui missing because the UI build is only documented, not enforced #85206.

Why this is the narrowest fix

  • It does not introduce a new build orchestrator. ui:build is already a first-class pnpm script (package.json:1793) and scripts/ui.js is already invoked by gateway startup auto-repair, update, and the docs workaround. The change just makes build-all honor the same contract.
  • Backend-only dev profiles (gatewayWatch, cliStartup) are unchanged, so pnpm gateway:watch and CLI bench loops stay as fast as today.
  • The step has a dist/control-ui cache output, so warm rebuilds short-circuit on the existing build-all-cache machinery instead of rebuilding the UI on every backend change.

Change Type

  • Bug fix
  • Test

Scope

  • Tooling / build scripts
  • CI artifact profile

Linked Issue

Real behavior proof

Behavior or issue addressed: On current main, running pnpm build from a source/runtime checkout that does not run a second pnpm ui:build afterward can leave dist/control-ui/index.html missing. Because scripts/tsdown-build.mjs removes dist before rebuilding the backend, even a previously valid dist/control-ui/ is wiped by a backend-only rebuild, and the gateway then serves Control UI assets not found. Build them with pnpm ui:build.... Issue #85206 reproduces this from source and lists five concrete failure modes where the docs-only workaround is insufficient.

Real environment tested: Local macOS 15.7.4 (Darwin 25.4.0 arm64), Node v22.22.0, Corepack-managed pnpm, against this branch's HEAD on an openclaw/openclaw source checkout. The reproduction exercised the real pnpm ui:build script, the real scripts/build-all.mjs profile resolver, and the real on-disk dist/control-ui/ artifact, with dist/control-ui/ removed beforehand to simulate the post-tsdown state described in the issue.

Exact steps or command run after this patch: Five real terminal sessions were run end-to-end against the patched working tree. (1) Source-level proof that the patched build profiles include ui:build and exclude it from minimal dev profiles, via node -e "import('./scripts/build-all.mjs').then(m => ...)". (2) Destructive artifact proof: rm -rf dist/control-ui && test -f dist/control-ui/index.html (must fail before fix), then pnpm ui:build, then test -f dist/control-ui/index.html (must succeed). (3) Drift test on the patched test file: temporarily delete the ui:build step from scripts/build-all.mjs and run node scripts/run-vitest.mjs run test/scripts/build-all.test.ts to confirm the new regression tests fail closed; restore and re-run to confirm green. (4) Full targeted test run: node scripts/run-vitest.mjs run test/scripts/build-all.test.ts. (5) Format and lint guards: pnpm exec oxfmt --check scripts/build-all.mjs test/scripts/build-all.test.ts CHANGELOG.md and pnpm exec oxlint scripts/build-all.mjs test/scripts/build-all.test.ts.

Evidence after fix: Redacted real terminal output from the local working tree captured at branch HEAD before push.

Source-level proof — the patched profiles include ui:build in the right place and exclude it from minimal backend dev profiles:

$ node -e "import('./scripts/build-all.mjs').then(m => { ... })"
full has ui:build       : true
ciArtifacts has ui:build: true
gatewayWatch has ui:build (must be false): false
cliStartup has ui:build (must be false)  : false
full order around ui:build: [ 'copy-export-html-templates', 'ui:build', 'write-build-info' ]
step.cache.outputs: ["dist/control-ui"]

Destructive artifact proof — dist/control-ui/index.html is missing before ui:build and is present after it on a real macOS source checkout:

$ rm -rf dist/control-ui
$ test -f dist/control-ui/index.html && echo "EXISTS" || echo "MISSING (expected)"
MISSING (expected)

$ pnpm ui:build
> openclaw@... ui:build
> node scripts/ui.js build
... (vite build output)
../dist/control-ui/assets/index-BAlSA7IP.js                  1,285.07 kB │ gzip: 371.97 kB
✓ built in 516ms

$ test -f dist/control-ui/index.html && echo "EXISTS" || echo "MISSING"
EXISTS
$ ls dist/control-ui | head -8
apple-touch-icon.png
assets
favicon-32.png
favicon.ico
favicon.svg
index.html
manifest.webmanifest
sw.js
$ du -sh dist/control-ui
8.9M    dist/control-ui

Drift proof — removing the ui:build step from scripts/build-all.mjs makes my new regression tests fail closed (plus the updated ciArtifacts ordered-list assertion), and restoring it makes all 19 tests pass again:

$ node scripts/run-vitest.mjs run test/scripts/build-all.test.ts
 FAIL  test/scripts/build-all.test.ts > resolveBuildAllSteps > uses a runtime artifact plus plugin SDK export profile for ci artifacts
 FAIL  test/scripts/build-all.test.ts > resolveBuildAllSteps > includes ui:build in the full and ciArtifacts profiles after runtime postbuild
 FAIL  test/scripts/build-all.test.ts > resolveBuildAllSteps > declares dist/control-ui as the cached output for ui:build
Test Files  1 failed (1)
     Tests  3 failed | 16 passed (19)

// after restoring the ui:build step:
$ node scripts/run-vitest.mjs run test/scripts/build-all.test.ts
 ✓  test/scripts/build-all.test.ts (19 tests) 21ms
Test Files  1 passed (1)
     Tests  19 passed (19)

Format and lint on touched files:

$ pnpm exec oxfmt --check scripts/build-all.mjs test/scripts/build-all.test.ts CHANGELOG.md
All matched files use the correct format.

$ pnpm exec oxlint scripts/build-all.mjs test/scripts/build-all.test.ts
Found 0 warnings and 0 errors.
Finished in 5ms on 2 files with 189 rules using 10 threads.

$ node scripts/run-tsgo.mjs -p tsconfig.json
// exit 0

Observed result after fix: After this patch, pnpm build from a source/runtime checkout produces dist/control-ui/index.html as part of the normal full profile, without requiring a second remembered command. The CI artifact profile (pnpm build:ci-artifacts) likewise emits Control UI assets so artifact uploads no longer need to chain pnpm build && pnpm ui:build. Minimal backend dev profiles (gatewayWatch, cliStartup) keep their existing fast step lists. Startup auto-repair stays available as a defense-in-depth fallback but is no longer the only thing standing between pnpm build and a serviceable dashboard route. The drift test captured above proves the regression coverage fails closed if any future refactor drops ui:build from the full or ciArtifacts profile.

What was not tested: This patch does not change gatewayWatch / cliStartup step lists, so the existing backend-only dev-loop coverage in test/scripts/build-all.test.ts is unchanged. Windows-host OPENCLAW_BUILD_ALL_NO_PNPM=1 runs were not exercised end-to-end on macOS, but the new PNPM_STEP_NODE_FALLBACKS entry for ui:build mirrors the existing pattern used by plugins:assets:build / plugins:assets:copy and is exercised by the existing fallback-resolution tests.

Root Cause

  • scripts/build-all.mjs did not include ui:build in its step list at all; BUILD_ALL_PROFILES.full and BUILD_ALL_PROFILES.ciArtifacts therefore omitted it.
  • scripts/tsdown-build.mjs cleans dist before rebuilding the backend, so any prior dist/control-ui produced by a separately-remembered pnpm ui:build is destroyed by a later pnpm build run.
  • The docs-only workaround relies on humans and automation remembering two ordered commands; Source/runtime builds can leave dist/control-ui missing because the UI build is only documented, not enforced #85206 documents the five concrete failure modes where this expectation breaks down.

Regression Test Plan

  • Coverage level that should have caught this:
    • Unit / profile-resolver test (test/scripts/build-all.test.ts already gated the ciArtifacts step list and now also gates ui:build's presence, position, and cache contract)
  • Target test files:
    • test/scripts/build-all.test.ts (existing ciArtifacts list assertion updated, three new ui:build assertions, one updated gatewayWatch/cliStartup exclusion assertion)

User-visible / Behavior Changes

  • pnpm build and pnpm build:ci-artifacts now produce dist/control-ui/index.html as part of the normal flow on a clean checkout. Documented workflows that already run pnpm build && pnpm ui:build keep working — the second command becomes a no-op against the freshly-built cached output.
  • No change to pnpm gateway:watch, CLI startup benchmarks, or any other backend-only profile.
  • No new runtime dependencies. The new step calls pnpm ui:build, which is already a first-class package script and is the same path used today by gateway startup auto-repair and openclaw update.

Scope boundary

  • Only scripts/build-all.mjs, test/scripts/build-all.test.ts, and CHANGELOG.md are touched.
  • No changes to runtime gateway/UI code, no changes to scripts/ui.js, ui/vite.config.ts, scripts/tsdown-build.mjs, or the gateway startup auto-repair path. Startup auto-repair remains as the documented defense-in-depth fallback for non-pnpm build install paths.
  • No new dependencies, no lockfile changes, no CI workflow changes.

Prior art

@openclaw-barnacle openclaw-barnacle Bot added scripts Repository scripts size: XS proof: supplied External PR includes structured after-fix real behavior proof. labels May 24, 2026
@clawsweeper

clawsweeper Bot commented May 24, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed May 24, 2026, 8:38 PM ET / 00:38 UTC.

Summary
The branch adds ui:build to the build-all full and ciArtifacts profiles, adds a node fallback, updates build-all tests, and adds a changelog entry.

PR surface: Tests +34, Docs +1, Other +12. Total +47 across 3 files.

Reproducibility: yes. Source inspection shows pnpm build resolves to build-all without ui:build, while tsdown removes dist and Vite is the writer for dist/control-ui; I did not run the destructive build in this read-only review.

Merge readiness
Overall: 🦞 diamond lobster
Proof: 🦞 diamond lobster
Patch quality: 🦞 diamond lobster
Result: ready for maintainer review.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Risk before merge

  • Required CI should finish before merge; one check run was still in progress when inspected.

Maintainer options:

  1. Decide the mitigation before merge
    Land the narrow build-all profile fix after required CI and maintainer review, preserving the uncached UI build and keeping backend-only profiles minimal.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Next step before merge
No ClawSweeper repair lane is needed; the active PR has no blocking finding and only needs required CI plus maintainer review.

Security
Cleared: The diff is limited to existing build-script wiring, focused tests, and changelog text; it adds no dependencies, lockfile changes, workflow permissions, or secret-handling changes.

Review details

Best possible solution:

Land the narrow build-all profile fix after required CI and maintainer review, preserving the uncached UI build and keeping backend-only profiles minimal.

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

Yes. Source inspection shows pnpm build resolves to build-all without ui:build, while tsdown removes dist and Vite is the writer for dist/control-ui; I did not run the destructive build in this read-only review.

Is this the best way to solve the issue?

Yes. The PR uses the existing ui:build path in the full/CI artifact profiles after dist cleanup, leaves gatewayWatch and cliStartup unchanged, and avoids stale build-id cache behavior.

Codex review notes: model gpt-5.5, reasoning high; reviewed against fa3ff4d503bf.

Label changes

Label changes:

  • add proof: sufficient: Contributor real behavior proof is sufficient. Terminal proof in the PR body and follow-up comment shows the changed build/profile behavior and focused regression validation after the cache fix.

Label justifications:

  • P2: This is a normal-priority build artifact correctness fix with limited scope to source/runtime and CI artifact profiles.
  • 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): Terminal proof in the PR body and follow-up comment shows the changed build/profile behavior and focused regression validation after the cache fix.
  • proof: sufficient: Contributor real behavior proof is sufficient. Terminal proof in the PR body and follow-up comment shows the changed build/profile behavior and focused regression validation after the cache fix.
Evidence reviewed

PR surface:

Tests +34, Docs +1, Other +12. Total +47 across 3 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 1 34 0 +34
Docs 1 2 1 +1
Config 0 0 0 0
Generated 0 0 0 0
Other 1 12 0 +12
Total 3 48 1 +47

What I checked:

  • Repository policy read: Read the full root policy and the scoped scripts guide; script-runner changes should use existing wrappers and keep generated-artifact commands aligned. (AGENTS.md:20, fa3ff4d503bf)
  • Current main build profile gap: On current main, full and ciArtifacts resolve to runtime/plugin/metadata steps but no ui:build, so pnpm build does not invoke the Control UI build. (scripts/build-all.mjs:21, fa3ff4d503bf)
  • Latest release also lacks the step: The latest release tag v2026.5.22 has the same build-all profile shape around copy-export-html-templates and write-build-info, with no ui:build in between. (scripts/build-all.mjs:104, a374c3a5bfd5)
  • Destructive backend build source path: cleanTsdownOutputRoots removes both dist and dist-runtime, which can delete a previously generated dist/control-ui tree before build-all reaches metadata steps. (scripts/tsdown-build.mjs:59, fa3ff4d503bf)
  • Control UI output and metadata inputs: The Vite config writes to dist/control-ui and derives the build id from package.json, git SHA, and environment variables, supporting the PR's uncached final shape. (ui/vite.config.ts:31, fa3ff4d503bf)
  • Runtime failure message exists: The gateway has an explicit missing-assets response when Control UI assets are absent, matching the linked issue symptom. (src/gateway/control-ui.ts:61, fa3ff4d503bf)

Likely related people:

  • vincentkoc: Commit f1c2be7d3212 added build:ci-artifacts and BUILD_ALL_PROFILES, and recent history also touches Control UI build/runtime chunking. (role: introduced build profile surface and recent adjacent contributor; confidence: high; commits: f1c2be7d3212, 8bf4f7d4a88d, 9ff1a4371f68; files: scripts/build-all.mjs, test/scripts/build-all.test.ts, package.json)
  • steipete: GitHub path history shows repeated recent work on build-all caching/release tooling plus the Control UI service-worker build-id behavior that drives the uncached decision. (role: recent build and Control UI area contributor; confidence: high; commits: 81d22c817da9, 7b1fbe1c374e, b24a6d2cbd63; files: scripts/build-all.mjs, test/scripts/build-all.test.ts, scripts/tsdown-build.mjs)
  • obviyus: Recent build and tsdown commits touched runtime artifact and compatibility-sidecar behavior adjacent to the build-all surface. (role: adjacent build contributor; confidence: medium; commits: 2791b00e7294, a1d4eb255acf, 17e6ef407615; files: scripts/build-all.mjs, test/scripts/build-all.test.ts, scripts/tsdown-build.mjs)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

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.

How this review workflow works
  • 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.

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. labels May 24, 2026
@clawsweeper

clawsweeper Bot commented May 24, 2026 •

Copy link
Copy Markdown
Contributor

ClawSweeper PR egg

✨ Hatched: 🌱 uncommon Velvet Branchling

Hatch command

Comment @clawsweeper hatch when this PR is hatchable.

Hatchability rules:

  • Merged PRs are hatchable.
  • Open PRs are hatchable when they are status: 👀 ready for maintainer look, status: 🚀 automerge armed, or labeled clawsweeper:automerge.
  • Closed unmerged PRs are hatchable only when one of those hatchable labels is still present in the durable record.

Rarity: 🌱 uncommon.
Trait: sniffs out flaky tests.
Image traits: location branch lighthouse; accessory shell-shaped keyboard; palette plum, gold, and soft gray; mood sparkly; pose nestled inside a glowing shell; shell polished stone shell; lighting gentle morning glow; background soft code-shaped tiles.
Share on X: post this hatch
Copy: My PR egg hatched a 🌱 uncommon Velvet Branchling in ClawSweeper.

What is this egg doing here?
  • Eggs appear after the PR passes real-behavior proof. It is here for vibes, not verdicts: it does not change labels, ratings, merge decisions, or automation.
  • The shell reacts to review momentum: open follow-up work warms it up, re-review makes it wobble, and a clean final review lets it hatch.
  • Hatchability usually comes from sufficient real-behavior proof, no blocking P0/P1/P2 findings, no security attention needed, and clean correctness. A merged PR is already final, so merge makes the egg hatchable independently.
  • The hatch is seeded from this repository and PR number, so the same PR keeps the same creature; the reviewed head SHA can only change safe visual details.
  • Rarity is just collectible sparkle: 🥚 common, 🌱 uncommon, 💎 rare, ✨ glimmer, and 🌈 legendary.

@1052326311

Copy link
Copy Markdown
Contributor Author

Addressed the cache-contract finding in 964c6aa9.

I went with option 2 from the maintainer options block — leave ui:build uncached — rather than try to cover every Vite metadata input. The reason:

  • ui/vite.config.ts reads package.json (line 32), git rev-parse --short=12 HEAD (line 44), and OPENCLAW_CONTROL_UI_BUILD_ID / OPENCLAW_VERSION env (line 56) to embed a build ID into the app + service worker (lines 73, 91).
  • A file-input cache signature cannot exactly invalidate git HEAD or env, so any "include those metadata inputs" approach would still leave a small stale-build-ID surface unless we hashed git HEAD per build, which itself defeats the purpose of file-input caching.
  • The Vite build itself is fast (~500ms for the Control UI bundle on this checkout), so leaving the step uncached keeps the contract simple and matches the existing behavior of every other un-cached step in BUILD_ALL_STEPS.

Test contract updated to assert step.cache is undefined for ui:build, with a comment explaining the metadata-input reason. The presence/order/exclusion assertions for full, ciArtifacts, gatewayWatch, and cliStartup are unchanged.

Local re-runs against 964c6aa9:

$ node scripts/run-vitest.mjs run test/scripts/build-all.test.ts
 ✓ test/scripts/build-all.test.ts (19 tests) 22ms
Test Files  1 passed (1)
     Tests  19 passed (19)

$ pnpm exec oxfmt --check scripts/build-all.mjs test/scripts/build-all.test.ts CHANGELOG.md
All matched files use the correct format.

$ pnpm exec oxlint scripts/build-all.mjs test/scripts/build-all.test.ts
Found 0 warnings and 0 errors.

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented May 24, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

Re-review progress:

@1052326311
1052326311 force-pushed the fix/build-all-include-ui-build branch from 964c6aa to 654f75e Compare May 24, 2026 10:40
@clawsweeper clawsweeper Bot added rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. labels May 24, 2026
@steipete
steipete force-pushed the fix/build-all-include-ui-build branch from 654f75e to 535d5ed Compare May 25, 2026 00:31
@openclaw-barnacle openclaw-barnacle Bot removed the proof: sufficient ClawSweeper judged the real behavior proof convincing. label May 25, 2026
@clawsweeper clawsweeper Bot added the proof: sufficient ClawSweeper judged the real behavior proof convincing. label May 25, 2026
…iles

Closes openclaw#85206.

scripts/build-all.mjs only ran ui:build via a separate `pnpm ui:build`
command. Because `pnpm build` invokes tsdown which removes `dist/`,
a backend rebuild silently deletes any previously generated
dist/control-ui assets, leaving the gateway to serve the
"Control UI assets not found" message at startup. Documentation and
startup auto-repair masked the bug at the worst possible time
(LaunchAgent readiness / remote recovery) instead of guaranteeing the
build artifact contract.

This change adds ui:build as a build-all step after
copy-export-html-templates and before write-build-info, and includes
it in the full and ciArtifacts profiles. Minimal backend dev profiles
(gatewayWatch, cliStartup) keep their existing fast-loop step lists
and do not run ui:build.

Regression coverage:
- ciArtifacts step list assertion updated to match the new ordering.
- Three new resolveBuildAllSteps assertions: ui:build is in full and
  ciArtifacts and runs after tsdown/runtime-postbuild-stamp and before
  write-build-info; ui:build is excluded from gatewayWatch/cliStartup;
  ui:build cache outputs declare dist/control-ui.
…es stale build IDs

ClawSweeper review on openclaw#86010 flagged that the original ui:build cache only
hashed ui/, scripts/ui.js, and scripts/lib/copy-assets.ts, but
ui/vite.config.ts also reads package.json plus git HEAD and the
OPENCLAW_CONTROL_UI_BUILD_ID/OPENCLAW_VERSION env vars to embed a build ID
into the app and service worker. A file-input cache signature cannot
exactly invalidate those metadata sources, so a warm build-all hit could
restore a previously generated dist/control-ui after tsdown clears dist
and ship stale service-worker/app cache metadata.

Leaving the step uncached keeps the contract simple: every pnpm build
re-runs Vite, which is fast for the Control UI bundle and matches the
existing behavior of every other un-cached build-all step. Backend-only
profiles (gatewayWatch, cliStartup) are still unchanged.

Tests:
- Updated the ui:build cache assertion to require step.cache to be
  undefined and explain the metadata-input reason.
- Existing presence/order/exclusion assertions for ui:build are unchanged
  and still cover the full and ciArtifacts profile contract.
@steipete
steipete force-pushed the fix/build-all-include-ui-build branch from 535d5ed to f771ec4 Compare May 25, 2026 07:03
@steipete
steipete merged commit 6704d0a into openclaw:main May 25, 2026
83 of 85 checks passed
@1052326311

Copy link
Copy Markdown
Contributor Author

Thanks @steipete for the merge! 🙏

We're running OpenClaw in production for several enterprise scenarios (ToG public-safety dashboards, multi-channel agent orchestration on customer-side appliances), so the build/install reliability fixes shipped in this PR matter directly to our deployment story. Happy to keep contributing — already have follow-ups in flight (#85969 docs, #86384 doctor cron resilience, #86424 git updater stable channel) and a list of bugs we've hit during enterprise rollouts that look like good queueable-fix candidates.

Will keep the patches minimal, narrowly scoped, and proof-backed.

steipete added a commit that referenced this pull request May 25, 2026
…iles (#86010)

* fix(scripts): include ui:build in build-all full and ciArtifacts profiles

Closes #85206.

scripts/build-all.mjs only ran ui:build via a separate `pnpm ui:build`
command. Because `pnpm build` invokes tsdown which removes `dist/`,
a backend rebuild silently deletes any previously generated
dist/control-ui assets, leaving the gateway to serve the
"Control UI assets not found" message at startup. Documentation and
startup auto-repair masked the bug at the worst possible time
(LaunchAgent readiness / remote recovery) instead of guaranteeing the
build artifact contract.

This change adds ui:build as a build-all step after
copy-export-html-templates and before write-build-info, and includes
it in the full and ciArtifacts profiles. Minimal backend dev profiles
(gatewayWatch, cliStartup) keep their existing fast-loop step lists
and do not run ui:build.

Regression coverage:
- ciArtifacts step list assertion updated to match the new ordering.
- Three new resolveBuildAllSteps assertions: ui:build is in full and
  ciArtifacts and runs after tsdown/runtime-postbuild-stamp and before
  write-build-info; ui:build is excluded from gatewayWatch/cliStartup;
  ui:build cache outputs declare dist/control-ui.

* fix(scripts): leave ui:build uncached so dist/control-ui never restores stale build IDs

ClawSweeper review on #86010 flagged that the original ui:build cache only
hashed ui/, scripts/ui.js, and scripts/lib/copy-assets.ts, but
ui/vite.config.ts also reads package.json plus git HEAD and the
OPENCLAW_CONTROL_UI_BUILD_ID/OPENCLAW_VERSION env vars to embed a build ID
into the app and service worker. A file-input cache signature cannot
exactly invalidate those metadata sources, so a warm build-all hit could
restore a previously generated dist/control-ui after tsdown clears dist
and ship stale service-worker/app cache metadata.

Leaving the step uncached keeps the contract simple: every pnpm build
re-runs Vite, which is fast for the Control UI bundle and matches the
existing behavior of every other un-cached build-all step. Backend-only
profiles (gatewayWatch, cliStartup) are still unchanged.

Tests:
- Updated the ui:build cache assertion to require step.cache to be
  undefined and explain the metadata-input reason.
- Existing presence/order/exclusion assertions for ui:build are unchanged
  and still cover the full and ciArtifacts profile contract.

* fix(scripts): keep ui build fallback pnpm-free

---------

Co-authored-by: 1052326311 <[email protected]>
Co-authored-by: Peter Steinberger <[email protected]>
(cherry picked from commit 6704d0a)
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request May 26, 2026
…iles (openclaw#86010)

* fix(scripts): include ui:build in build-all full and ciArtifacts profiles

Closes openclaw#85206.

scripts/build-all.mjs only ran ui:build via a separate `pnpm ui:build`
command. Because `pnpm build` invokes tsdown which removes `dist/`,
a backend rebuild silently deletes any previously generated
dist/control-ui assets, leaving the gateway to serve the
"Control UI assets not found" message at startup. Documentation and
startup auto-repair masked the bug at the worst possible time
(LaunchAgent readiness / remote recovery) instead of guaranteeing the
build artifact contract.

This change adds ui:build as a build-all step after
copy-export-html-templates and before write-build-info, and includes
it in the full and ciArtifacts profiles. Minimal backend dev profiles
(gatewayWatch, cliStartup) keep their existing fast-loop step lists
and do not run ui:build.

Regression coverage:
- ciArtifacts step list assertion updated to match the new ordering.
- Three new resolveBuildAllSteps assertions: ui:build is in full and
  ciArtifacts and runs after tsdown/runtime-postbuild-stamp and before
  write-build-info; ui:build is excluded from gatewayWatch/cliStartup;
  ui:build cache outputs declare dist/control-ui.

* fix(scripts): leave ui:build uncached so dist/control-ui never restores stale build IDs

ClawSweeper review on openclaw#86010 flagged that the original ui:build cache only
hashed ui/, scripts/ui.js, and scripts/lib/copy-assets.ts, but
ui/vite.config.ts also reads package.json plus git HEAD and the
OPENCLAW_CONTROL_UI_BUILD_ID/OPENCLAW_VERSION env vars to embed a build ID
into the app and service worker. A file-input cache signature cannot
exactly invalidate those metadata sources, so a warm build-all hit could
restore a previously generated dist/control-ui after tsdown clears dist
and ship stale service-worker/app cache metadata.

Leaving the step uncached keeps the contract simple: every pnpm build
re-runs Vite, which is fast for the Control UI bundle and matches the
existing behavior of every other un-cached build-all step. Backend-only
profiles (gatewayWatch, cliStartup) are still unchanged.

Tests:
- Updated the ui:build cache assertion to require step.cache to be
  undefined and explain the metadata-input reason.
- Existing presence/order/exclusion assertions for ui:build are unchanged
  and still cover the full and ciArtifacts profile contract.

* fix(scripts): keep ui build fallback pnpm-free

---------

Co-authored-by: 1052326311 <[email protected]>
Co-authored-by: Peter Steinberger <[email protected]>
jameslcowan pushed a commit to jameslcowan/openclaw that referenced this pull request Jun 2, 2026
…iles (openclaw#86010)

* fix(scripts): include ui:build in build-all full and ciArtifacts profiles

Closes openclaw#85206.

scripts/build-all.mjs only ran ui:build via a separate `pnpm ui:build`
command. Because `pnpm build` invokes tsdown which removes `dist/`,
a backend rebuild silently deletes any previously generated
dist/control-ui assets, leaving the gateway to serve the
"Control UI assets not found" message at startup. Documentation and
startup auto-repair masked the bug at the worst possible time
(LaunchAgent readiness / remote recovery) instead of guaranteeing the
build artifact contract.

This change adds ui:build as a build-all step after
copy-export-html-templates and before write-build-info, and includes
it in the full and ciArtifacts profiles. Minimal backend dev profiles
(gatewayWatch, cliStartup) keep their existing fast-loop step lists
and do not run ui:build.

Regression coverage:
- ciArtifacts step list assertion updated to match the new ordering.
- Three new resolveBuildAllSteps assertions: ui:build is in full and
  ciArtifacts and runs after tsdown/runtime-postbuild-stamp and before
  write-build-info; ui:build is excluded from gatewayWatch/cliStartup;
  ui:build cache outputs declare dist/control-ui.

* fix(scripts): leave ui:build uncached so dist/control-ui never restores stale build IDs

ClawSweeper review on openclaw#86010 flagged that the original ui:build cache only
hashed ui/, scripts/ui.js, and scripts/lib/copy-assets.ts, but
ui/vite.config.ts also reads package.json plus git HEAD and the
OPENCLAW_CONTROL_UI_BUILD_ID/OPENCLAW_VERSION env vars to embed a build ID
into the app and service worker. A file-input cache signature cannot
exactly invalidate those metadata sources, so a warm build-all hit could
restore a previously generated dist/control-ui after tsdown clears dist
and ship stale service-worker/app cache metadata.

Leaving the step uncached keeps the contract simple: every pnpm build
re-runs Vite, which is fast for the Control UI bundle and matches the
existing behavior of every other un-cached build-all step. Backend-only
profiles (gatewayWatch, cliStartup) are still unchanged.

Tests:
- Updated the ui:build cache assertion to require step.cache to be
  undefined and explain the metadata-input reason.
- Existing presence/order/exclusion assertions for ui:build are unchanged
  and still cover the full and ciArtifacts profile contract.

* fix(scripts): keep ui build fallback pnpm-free

---------

Co-authored-by: 1052326311 <[email protected]>
Co-authored-by: Peter Steinberger <[email protected]>
sablehead pushed a commit to sablehead/openclaw that referenced this pull request Jun 10, 2026
…iles (openclaw#86010)

* fix(scripts): include ui:build in build-all full and ciArtifacts profiles

Closes openclaw#85206.

scripts/build-all.mjs only ran ui:build via a separate `pnpm ui:build`
command. Because `pnpm build` invokes tsdown which removes `dist/`,
a backend rebuild silently deletes any previously generated
dist/control-ui assets, leaving the gateway to serve the
"Control UI assets not found" message at startup. Documentation and
startup auto-repair masked the bug at the worst possible time
(LaunchAgent readiness / remote recovery) instead of guaranteeing the
build artifact contract.

This change adds ui:build as a build-all step after
copy-export-html-templates and before write-build-info, and includes
it in the full and ciArtifacts profiles. Minimal backend dev profiles
(gatewayWatch, cliStartup) keep their existing fast-loop step lists
and do not run ui:build.

Regression coverage:
- ciArtifacts step list assertion updated to match the new ordering.
- Three new resolveBuildAllSteps assertions: ui:build is in full and
  ciArtifacts and runs after tsdown/runtime-postbuild-stamp and before
  write-build-info; ui:build is excluded from gatewayWatch/cliStartup;
  ui:build cache outputs declare dist/control-ui.

* fix(scripts): leave ui:build uncached so dist/control-ui never restores stale build IDs

ClawSweeper review on openclaw#86010 flagged that the original ui:build cache only
hashed ui/, scripts/ui.js, and scripts/lib/copy-assets.ts, but
ui/vite.config.ts also reads package.json plus git HEAD and the
OPENCLAW_CONTROL_UI_BUILD_ID/OPENCLAW_VERSION env vars to embed a build ID
into the app and service worker. A file-input cache signature cannot
exactly invalidate those metadata sources, so a warm build-all hit could
restore a previously generated dist/control-ui after tsdown clears dist
and ship stale service-worker/app cache metadata.

Leaving the step uncached keeps the contract simple: every pnpm build
re-runs Vite, which is fast for the Control UI bundle and matches the
existing behavior of every other un-cached build-all step. Backend-only
profiles (gatewayWatch, cliStartup) are still unchanged.

Tests:
- Updated the ui:build cache assertion to require step.cache to be
  undefined and explain the metadata-input reason.
- Existing presence/order/exclusion assertions for ui:build are unchanged
  and still cover the full and ciArtifacts profile contract.

* fix(scripts): keep ui build fallback pnpm-free

---------

Co-authored-by: 1052326311 <[email protected]>
Co-authored-by: Peter Steinberger <[email protected]>
zooqueen pushed a commit to zooqueen/openclaw that referenced this pull request Sep 11, 2026
…iles (openclaw#86010)

* fix(scripts): include ui:build in build-all full and ciArtifacts profiles

Closes openclaw#85206.

scripts/build-all.mjs only ran ui:build via a separate `pnpm ui:build`
command. Because `pnpm build` invokes tsdown which removes `dist/`,
a backend rebuild silently deletes any previously generated
dist/control-ui assets, leaving the gateway to serve the
"Control UI assets not found" message at startup. Documentation and
startup auto-repair masked the bug at the worst possible time
(LaunchAgent readiness / remote recovery) instead of guaranteeing the
build artifact contract.

This change adds ui:build as a build-all step after
copy-export-html-templates and before write-build-info, and includes
it in the full and ciArtifacts profiles. Minimal backend dev profiles
(gatewayWatch, cliStartup) keep their existing fast-loop step lists
and do not run ui:build.

Regression coverage:
- ciArtifacts step list assertion updated to match the new ordering.
- Three new resolveBuildAllSteps assertions: ui:build is in full and
  ciArtifacts and runs after tsdown/runtime-postbuild-stamp and before
  write-build-info; ui:build is excluded from gatewayWatch/cliStartup;
  ui:build cache outputs declare dist/control-ui.

* fix(scripts): leave ui:build uncached so dist/control-ui never restores stale build IDs

ClawSweeper review on openclaw#86010 flagged that the original ui:build cache only
hashed ui/, scripts/ui.js, and scripts/lib/copy-assets.ts, but
ui/vite.config.ts also reads package.json plus git HEAD and the
OPENCLAW_CONTROL_UI_BUILD_ID/OPENCLAW_VERSION env vars to embed a build ID
into the app and service worker. A file-input cache signature cannot
exactly invalidate those metadata sources, so a warm build-all hit could
restore a previously generated dist/control-ui after tsdown clears dist
and ship stale service-worker/app cache metadata.

Leaving the step uncached keeps the contract simple: every pnpm build
re-runs Vite, which is fast for the Control UI bundle and matches the
existing behavior of every other un-cached build-all step. Backend-only
profiles (gatewayWatch, cliStartup) are still unchanged.

Tests:
- Updated the ui:build cache assertion to require step.cache to be
  undefined and explain the metadata-input reason.
- Existing presence/order/exclusion assertions for ui:build are unchanged
  and still cover the full and ciArtifacts profile contract.

* fix(scripts): keep ui build fallback pnpm-free

---------

Co-authored-by: 1052326311 <[email protected]>
Co-authored-by: Peter Steinberger <[email protected]>
(cherry picked from commit 6704d0a)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. proof: supplied External PR includes structured after-fix real behavior proof. 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.

Source/runtime builds can leave dist/control-ui missing because the UI build is only documented, not enforced

2 participants