openclaw - ✅(Solved) Fix [Bug]: Windows linked source install can skip Control UI auto-build through junction-launched scripts/ui.js [1 pull requests, 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#73059Fetched 2026-04-28 06:28:01
View on GitHub
Comments
1
Participants
1
Timeline
2
Reactions
0
Participants
Timeline (top)
commented ×1cross-referenced ×1

On Windows source installs linked through the global npm junction, the first-start Control UI auto-build can report success without building anything because scripts/ui.js does not run main() when launched through the junction path.

Root Cause

On Windows source installs linked through the global npm junction, the first-start Control UI auto-build can report success without building anything because scripts/ui.js does not run main() when launched through the junction path.

Fix Action

Fixed

PR fix notes

PR #52291: fix(ui): make ui:build work on Windows

Description (problem / solution / changelog)

Summary

  • Problem: pnpm ui:build can fail on Windows when the resolved pnpm.cmd path contains spaces, because scripts/ui.js launches shell-backed commands without quoting the executable path.
  • Additional issue found while reproducing on a clean checkout: the build auto-install path used pnpm install --prod, which skips vite and leaves the UI build unable to start.
  • What changed: quote Windows shell launcher paths before spawn/spawnSync, and make the build auto-install path install the full UI dependency set instead of production-only deps.
  • Scope boundary: no UI app code changed; this only touches the build wrapper script and its tests.

Change Type

  • Bug fix
  • Feature
  • Refactor
  • Docs
  • Security hardening
  • Chore/infra

Scope

  • Gateway / orchestration
  • Skills / tool execution
  • Auth / tokens
  • Memory / storage
  • Integrations
  • API / contracts
  • UI / DX
  • CI/CD / infra

Linked Issue/PR

  • Closes #52282

User-visible / Behavior Changes

On Windows, pnpm ui:build now works when the package manager lives under a path with spaces (for example C:\Program Files\...). On clean checkouts, the command also installs the build-time UI dependencies it needs before invoking Vite.

Security Impact

  • New permissions/capabilities? No
  • Secrets/tokens handling changed? No
  • New/changed network calls? No
  • Command/tool execution surface changed? No
  • Data access scope changed? No

Repro + Verification

Environment

  • OS: Windows 11
  • Runtime/container: Node v20.19.0 / pnpm v10.32.1
  • Relevant command: pnpm ui:build

Expected

  • pnpm ui:build should launch the resolved package-manager command correctly on Windows.
  • The command should be able to install the UI dependencies required for the build and complete successfully.

Actual before fix

  • On affected Windows setups, shell-backed launchers under paths with spaces fail before running: 'D:\Program' is not recognized ...
  • On a clean checkout in my local reproduction, the same code path also installed with --prod, so vite build failed because vite was absent.

Evidence

  • Failing repro before + passing after
  • Screenshot/recording
  • Perf numbers

Commands run:

  • pnpm exec vitest run --config vitest.config.ts test/scripts/ui.test.ts
  • pnpm ui:build

Observed after fix:

  • test/scripts/ui.test.ts: 1 passed, 6 passed tests
  • pnpm ui:build: completed successfully and emitted dist/control-ui/*

Human Verification

What I personally verified:

  • The Windows shell launcher path is now quoted when needed.
  • pnpm ui:build succeeds locally on a fresh worktree after the script changes.
  • Non-shell launchers remain unquoted.

Review Conversations

  • I replied to or resolved every bot review conversation I addressed in this PR.
  • I left unresolved only the conversations that still need reviewer or maintainer judgment.

Compatibility / Migration

  • Backward compatible? Yes
  • Config/env changes? No
  • Migration needed? No

Failure Recovery

  • How to disable/revert this change quickly: revert this commit
  • Known bad symptoms reviewers should watch for: none beyond the previous ui:build failures returning

Risks and Mitigations

  • Risk: quoting shell launchers on Windows could affect commands that were already quoted.
    • Mitigation: the helper preserves already-quoted commands and only touches shell-backed launchers with whitespace in the path.
  • Risk: installing full deps for build may do more work than the previous production-only install.
    • Mitigation: this is only used when UI deps are missing, and the build already requires vite/other dev-time tooling to succeed.

Changed files

  • scripts/ui.js (modified, +15/-6)
  • test/scripts/ui.test.ts (modified, +15/-1)
RAW_BUFFERClick to expand / collapse

Bug type

Behavior bug (incorrect output/state without crash)

Beta release blocker

No

Summary

On Windows source installs linked through the global npm junction, the first-start Control UI auto-build can report success without building anything because scripts/ui.js does not run main() when launched through the junction path.

Steps to reproduce

  1. On Windows, clone openclaw/openclaw.
  2. Run pnpm install.
  3. Run pnpm build.
  4. Run pnpm link --global.
  5. Delete dist/control-ui.
  6. Run ode %APPDATA%\npm\node_modules\openclaw\scripts\ui.js build (or start the gateway so it auto-builds Control UI on first run).
  7. Observe that there is no Vite build output and dist/control-ui/index.html is still missing.

Expected behavior

The junction-launched script should execute the same build path as ode .\scripts\ui.js build / pnpm ui:build and recreate dist/control-ui/index.html.

Actual behavior

The junction-launched script exits without Vite output and leaves dist/control-ui/index.html missing. On gateway startup, the log shows:

shell Control UI assets missing; building (ui:build, auto-installs UI deps)… Control UI build completed but C:\Users\hongl\AppData\Roaming\npm\node_modules\openclaw\dist\control-ui\index.html is still missing.

OpenClaw version

2026.4.25-beta.8

Operating system

Microsoft Windows 11 Pro 10.0.22631 (build 22631)

Install method

Source checkout with pnpm link --global; %APPDATA%\npm\node_modules\openclaw is a Windows directory junction to the repo root.

Model

NOT_APPLICABLE

Provider / routing chain

NOT_APPLICABLE

Additional provider/model setup details

This occurs before any model/provider request; it is in the local Control UI build wrapper.

Logs, screenshots, and evidence

`shell Manual reproduction before the fix:

BEFORE_REPO=False BEFORE_GLOBAL=False node %APPDATA%\npm\node_modules\openclaw\scripts\ui.js build AFTER_REPO=False AFTER_GLOBAL=False `

Repo-local control case on the same checkout:

`shell node .\scripts\ui.js build

emits normal Vite build output

dist/control-ui/index.html exists afterward

`

Focused regression evidence from local investigation:

  • pnpm test test/scripts/ui.test.ts -t "executes main when launched through a junction path" failed before the fix with expected exit status 2 vs actual

extent analysis

TL;DR

The issue can be fixed by ensuring that the main() function in scripts/ui.js is executed when launched through the global npm junction path.

Guidance

  • Investigate why scripts/ui.js does not run main() when launched through the junction path and modify the script to handle this case.
  • Verify that the main() function is being called by adding logging or debugging statements.
  • Check the ui.test.ts test case "executes main when launched through a junction path" to ensure it passes after applying the fix.
  • Consider modifying the pnpm link --global command or the junction path to ensure that the script is executed correctly.

Example

No code snippet is provided as the issue does not contain enough information to create a specific example.

Notes

The issue seems to be related to how the script is executed when launched through the global npm junction path. The fix will depend on the specific implementation of scripts/ui.js and how it handles different execution paths.

Recommendation

Apply a workaround to ensure that main() is executed when launched through the junction path, as the root cause of the issue is not explicitly stated and may require further investigation.

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…

FAQ

Expected behavior

The junction-launched script should execute the same build path as ode .\scripts\ui.js build / pnpm ui:build and recreate dist/control-ui/index.html.

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 - ✅(Solved) Fix [Bug]: Windows linked source install can skip Control UI auto-build through junction-launched scripts/ui.js [1 pull requests, 1 comments, 1 participants]