openclaw-windows-node icon indicating copy to clipboard operation
openclaw-windows-node copied to clipboard

preflight-wsl fails on all Windows builds due to UTF-16 encoded wsl.exe output

Open panic-Patrick opened this issue 5 months ago • 2 comments

Environment

  • Windows 10.0.26200.0 (64-bit)
  • WSL 2.7.3.0
  • Installer: OpenClawCompanion-Setup-x64 v0.4.7 and v0.6.0-alpha.14

Problem The preflight-wsl step fails with: "WSL version output did not include a parseable WSL version"

wsl.exe --version returns UTF-16 LE encoded output (null byte between every character). The installer reads it as raw bytes and the version regex finds no match.

Evidence from log: stdout contains: W\u0000S\u0000L\u0000-\u0000V\u0000e\u0000r\u0000s\u0000i\u0000o\u0000n\u0000...

panic-Patrick avatar Jun 03 '26 06:06 panic-Patrick

Thanks for the context here. I did a careful shell check against current main, and this is already implemented.

Current main already normalizes WSL command output before version parsing, so the reported UTF-16-style NUL-byte output no longer blocks preflight-wsl; the fix is present in the v0.6.0 tag.

I found the merged PR that appears to have closed this: #567: Chat: render in-bubble Allow/Deny approval banner + harden plumbing.

So I’m closing this as already implemented rather than keeping a duplicate issue open.

Review details

Best possible solution:

Keep the current v0.6.0 setup-engine behavior that strips NUL and BOM characters before parsing WSL version output.

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

No Windows runtime reproduction was run in this Linux checkout, but the source path is clear: NUL-byte WSL version text is normalized before the version regex on current main.

Is this the best way to solve the issue?

Yes. Removing NUL/BOM characters at the WSL parsing boundary is the narrow fix for UTF-16-style ASCII output and preserves the existing preflight behavior.

Security review:

Security review: This is a non-PR issue triage item with no patch security surface to review.

AGENTS.md: found, but no applicable review policy affected this item.

What I checked:

  • Current source normalizes WSL version output: PreflightWslStep combines stdout/stderr, normalizes the text, and passes it into WslInstallSupport.TryParseWslVersion; WslInstallSupport.Normalize removes \0 and BOM characters before the regex runs. (src/OpenClaw.SetupEngine/SetupSteps.cs:444, 53ff55aff974)
  • Git history ties the normalization to the released setup implementation: git blame shows the version parser, preflight version call, and Normalize helper all come from commit 7d9152f427a3007cbe663513ef34c89719473a41. (src/OpenClaw.SetupEngine/SetupSteps.cs:162, 7d9152f427a3)
  • Release provenance: git tag --contains reports v0.6.0 contains commit 7d9152f427a3007cbe663513ef34c89719473a41, and inspecting v0.6.0:src/OpenClaw.SetupEngine/SetupSteps.cs confirms the NUL-stripping normalization is in that tag. (src/OpenClaw.SetupEngine/SetupSteps.cs:162, 7d9152f427a3)

Likely related people:

  • RBrid: The current WSL preflight parser, NUL/BOM normalization helper, setup command runner, and nearby tests are all attributed by blame/history to the release commit authored by this GitHub account. (role: recent setup-engine contributor; confidence: high; commits: 7d9152f427a3; files: src/OpenClaw.SetupEngine/SetupSteps.cs, src/OpenClaw.SetupEngine/CommandRunner.cs, tests/OpenClaw.SetupEngine.Tests/SetupStepsTests.cs)

Codex review notes: model gpt-5.5, reasoning high; reviewed against 53ff55aff974; fix evidence: merged PR #567, release v0.6.0, commit 7d9152f427a3.

clawsweeper[bot] avatar Jun 03 '26 06:06 clawsweeper[bot]

The bot incorrectly closed this. The fix is NOT present in v0.6.0.

I just tested v0.6.0 (OpenClawCompanion-Setup-x64.exe) and it still fails with the identical error. Log from v0.6.0 run at 06:32 UTC today:

{"StepId":"preflight-wsl","Event":"completed","Outcome":"FailedTerminal", "Detail":"WSL version output did not include a parseable WSL version..."}

System: Windows 10.0.26200.0, WSL 2.7.3.0 (fully updated)

Please reopen.

panic-Patrick avatar Jun 03 '26 06:06 panic-Patrick