Skip to content

preflight-wsl UTF-16 parsing bug still present in v0.6.0 (re: #660 closed prematurely) #661

Closed

Description

@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:

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.

Originally posted by @clawsweeper in #660

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)

Activity

  1. clawsweeper commented on Jun 3, 2026

    @clawsweeper

    Codex review: keeping this open for maintainer follow-up; there is still a little grit to resolve. Reviewed June 3, 2026, 2:52 AM ET / 06:52 UTC.

    Summary
    Keep this issue open: current main and v0.6.0 strip NUL/BOM characters, but the parser still only accepts WSL version: with whitespace, while the reported sample includes the hyphenated WSL-Version: form that remains unparsable.

    Reproducibility: yes. from source inspection, though not by running the Windows installer here. After current normalization, the reported WSL-Version: label still cannot match the parser's WSL\s+version: regex, so preflight-wsl can still reach the reported terminal failure.

    Next step
    This is a focused setup-engine parser/test repair with clear files and no product or security decision blocker.

    Review details

    Best possible solution:

    Land a narrow setup-engine parser fix with regression coverage for NUL-separated and hyphenated WSL version output while preserving the existing minimum-version and environment-diagnostic behavior.

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

    Yes from source inspection, though not by running the Windows installer here. After current normalization, the reported WSL-Version: label still cannot match the parser's WSL\s+version: regex, so preflight-wsl can still reach the reported terminal failure.

    Is this the best way to solve the issue?

    Yes, the best path is a narrow parser/test repair. It should accept the observed hyphenated/NUL-separated WSL label without changing setup policy, version thresholds, or unrelated WSL diagnostics.

    AGENTS.md: found and applied where relevant.

    Remaining risk / open question:

    • I did not run the Windows installer in this Linux checkout, so the exact live wsl.exe --version bytes should be preserved from reporter logs or a Windows smoke when fixing.
    • The parser fix should stay narrow enough to accept the observed WSL-Version: form without treating unrelated command output numbers as a valid WSL version.

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

    Label changes

    Label changes:

    • add P1: The terminal preflight failure blocks setup for affected Windows users with otherwise supported WSL installations.
    • add impact:other: The affected surface is installer/setup preflight availability, which is maintainer-visible but outside the specific auth, message, session, security, or crash-loop labels.
    • add issue-rating: 🦞 diamond lobster: Current issue advisory state selects this label.
    • add clawsweeper:source-repro: Current issue advisory state selects this label.
    • add clawsweeper:queueable-fix: Current issue advisory state selects this label.
    • add clawsweeper:fix-shape-clear: Current issue advisory state selects this label.

    Label justifications:

    • P1: The terminal preflight failure blocks setup for affected Windows users with otherwise supported WSL installations.
    • impact:other: The affected surface is installer/setup preflight availability, which is maintainer-visible but outside the specific auth, message, session, security, or crash-loop labels.
    Evidence reviewed

    Acceptance criteria:

    • dotnet test ./tests/OpenClaw.SetupEngine.Tests/OpenClaw.SetupEngine.Tests.csproj --no-restore
    • ./build.ps1
    • dotnet test ./tests/OpenClaw.Shared.Tests/OpenClaw.Shared.Tests.csproj --no-restore
    • dotnet test ./tests/OpenClaw.Tray.Tests/OpenClaw.Tray.Tests.csproj --no-restore

    What I checked:

    • Current parser still requires whitespace form: WslInstallSupport.TryParseWslVersion normalizes the string, then matches only WSL\s+version: before the version number; that does not cover the reported normalized WSL-Version: shape. (src/OpenClaw.SetupEngine/SetupSteps.cs:55, 53ff55aff974)
    • Preflight failure path is still active: PreflightWslStep combines stdout/stderr, normalizes them, and returns the exact terminal failure when TryParseWslVersion returns false. (src/OpenClaw.SetupEngine/SetupSteps.cs:444, 53ff55aff974)
    • Normalization is too narrow for the reported shape: The current normalization removes NUL and BOM characters only; it does not convert WSL-Version: into the whitespace form required by the regex. (src/OpenClaw.SetupEngine/SetupSteps.cs:162, 53ff55aff974)
    • Regression coverage does not include the reported format: Existing setup-engine tests cover the plain English WSL version: 2.7.3.0 case but not NUL-separated or hyphenated WSL-Version: output. (tests/OpenClaw.SetupEngine.Tests/SetupStepsTests.cs:496, 53ff55aff974)
    • v0.6.0 has the same parser: Inspecting v0.6.0:src/OpenClaw.SetupEngine/SetupSteps.cs shows the same WSL\s+version: regex, and git diff v0.6.0..HEAD -- src/OpenClaw.SetupEngine/SetupSteps.cs tests/OpenClaw.SetupEngine.Tests/SetupStepsTests.cs produced no setup parser/test changes. (src/OpenClaw.SetupEngine/SetupSteps.cs:55, 7d9152f427a3)
    • Related report contains the missing format clue: The related closed report supplied a NUL-separated sample beginning W^@S^@L^@-^@V...; after NUL stripping, that becomes a hyphenated label rather than the current parser's whitespace label.

    Likely related people:

    • RBrid: Current blame attributes the WSL preflight parser, NUL/BOM normalization, command runner path, and nearby tests to the v0.6.0 merge commit associated with 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)
    • Ranjesh Jaganathan: History shows the deterministic WSL setup work added the setup engine, command runner, and setup-engine tests, then adjusted WSL setup failure handling in the same area. (role: introduced WSL setup behavior; confidence: medium; commits: 98d0760cb5b6, ff3a7cc53736; files: src/OpenClaw.SetupEngine/SetupSteps.cs, src/OpenClaw.SetupEngine/CommandRunner.cs, tests/OpenClaw.SetupEngine.Tests/SetupStepsTests.cs)
    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.
  2. added
    P1
    impact:other
    issue-rating: 🦞 diamond lobster
    clawsweeper:source-repro
    clawsweeper:queueable-fix
    clawsweeper:fix-shape-clear
    on Jun 3, 2026
  3. jdominguez81 commented on Jun 3, 2026

    @jdominguez81

    I can reproduce this on a Spanish Windows install.

    PowerShell output:
    Versión de WSL: 2.7.3.0

    OpenClaw Companion v0.6.0 fails at preflight-wsl with:
    WSL version output did not include a parseable WSL version.

    It looks like the setup engine expects the English "WSL version:" label and does not handle localized WSL output such as Spanish "Versión de WSL:".

  4. EAGDuelks commented on Jun 3, 2026

    @EAGDuelks

    Same in Germany:

    Windows-Version: 10.0.26200.8457
    WSL-Version: 2.7.3.0
    OpenClaw Setup failed at preflight-wsl
    Output contains UTF-16/NUL bytes in setup log
    German localized output: WSL-Version

  5. JustAmply commented on Jun 3, 2026

    @JustAmply

    I can reproduce this as well on a German Windows installation.

    The setup fails at the same preflight-wsl step, even though wsl.exe --version exits successfully with exit code 0.

    Environment:

    • Windows: 10.0.26300.8553
    • WSL: 2.7.7.0
    • Kernel: 6.18.26.1-1
    • Locale / language: German
    • Setup log timestamp: 2026-06-03 10:32 UTC

    Relevant log excerpt:

    step.started: Verify WSL available
    cmd.start: C:\WINDOWS\System32\wsl.exe --version
    cmd.done: C:\WINDOWS\System32\wsl.exe exit=0
    step.completed: preflight-wsl → FailedTerminal
    message: WSL version output did not include a parseable WSL version.
    

    The captured stdout contains a valid WSL version, but it is localized and appears to contain NUL bytes:

    W\u0000S\u0000L\u0000-\u0000V\u0000e\u0000r\u0000s\u0000i\u0000o\u0000n\u0000:\u0000 \u00002\u0000.\u00007\u0000.\u00007\u0000.\u00000\u0000
    

    Rendered normally, this is:

    WSL-Version: 2.7.7.0
    Kernelversion: 6.18.26.1-1
    WSLg-Version: 1.0.73.2
    Windows-Version: 10.0.26300.8553
    

    So this looks like the same issue, with one additional detail: the parser may also be language-dependent. On German Windows, the label is WSL-Version, not WSL version.

    A robust fix probably needs both:

    • stripping NUL/BOM characters before parsing
    • avoiding an English-only WSL version: label match, or accepting localized variants / parsing the version more defensively
  6. added a commit that references this issue on Jun 3, 2026
    30c3d78
  7. github-actions commented on Jun 3, 2026

    @github-actions
  8. fvnks commented on Jun 3, 2026

    @fvnks

    I can reproduce this on a Spanish Windows install.

    PowerShell output: Versión de WSL: 2.7.3.0

    OpenClaw Companion v0.6.0 fails at preflight-wsl with: WSL version output did not include a parseable WSL version.

    It looks like the setup engine expects the English "WSL version:" label and does not handle localized WSL output such as Spanish "Versión de WSL:".


    same here!

  9. ranjeshj commented on Jun 3, 2026

    @ranjeshj
    Contributor

    There’s a potential mitigation in PR #666 that should handle the reported German and Spanish cases more robustly.

    The tricky part is that wsl.exe --version appears to return localized, human-readable output, so matching English labels like WSL version: is fragile. The PR now avoids matching the localized label text and instead looks for the stable WSL product token on a line with a semantic version, while avoiding adjacent component lines like WSLg-Version, Windows-Version, and kernel versions.

    If anyone who can reproduce this on a localized Windows install has a chance to try the PR build/branch, that would be very helpful. Also open to better ideas here: if there’s a more reliable locale-independent way to get the installed WSL package/version than parsing wsl.exe --version, that would likely be preferable.

  10. christineyan4 commented on Jun 3, 2026

    @christineyan4
    Contributor

    I was able to verify that the fix in PR #666 resolves the WSL version error on a Chinese-localized version of Windows--successfully got through the setup wizard and connected to the gateway and chat.

  11. ranjeshj commented on Jun 3, 2026

    @ranjeshj
    Contributor

    PR #666 has been merged and should be included in the next release.

    We are keeping this issue open for now so the fix can be verified more widely once it is available in a release. The underlying problem here is tricky because wsl.exe --version output is localized, so the merged change avoids matching translated label text and instead parses the stable WSL product-version line structurally.

  12. iamfineliliang-web commented on Jun 4, 2026

    @iamfineliliang-web

    Also reproduced on v0.6.2.0 (installed via OpenClaw.Tray.WinUI 0.6.2.0). System locale zh-CN, code page 936, WSL 2.7.3.0 / kernel 6.6.114.1-1 confirmed working. The master-branch fix in WslInstallSupport.TryParseWslVersion (per-line WSL token + semantic-version match) is exactly what's needed, but it hasn't been backported to the 0.6.x release channel — every user installing the current shipped Windows binary hits this. Pinging for a 0.6.3 patch release.

  13. shanselman commented on Jun 7, 2026

    @shanselman
    Collaborator

    No additional code fix looks needed on master: #666 is merged and addresses the localized / hyphenated / UTF-16 wsl.exe --version parsing path.

    Keeping this open for the remaining release-channel verification/backport question noted above, since users on the current 0.6.x installer can still hit it until a build containing #666 is shipped and verified.

  14. TurboTheTurtle commented on Jun 13, 2026

    @TurboTheTurtle
    Contributor

    Release-channel Windows runtime proof for #661.

    I verified the latest stable release asset, v0.6.3, on a real Windows runtime (ANDY-DESKTOP, Windows NT 10.0.26200.0) with real wsl.exe --version output.

    Release asset used:

    https://github.com/openclaw/openclaw-windows-node/releases/download/v0.6.3/OpenClawTray-0.6.3-win-x64.zip
    

    The release ZIP contains SetupEngine/OpenClaw.SetupEngine.dll. I loaded that release DLL from a small net10 harness and invoked WslInstallSupport.TryParseWslVersion against this machine's actual wsl.exe --version output.

    Observed raw runtime output shape:

    PowerShell 5.1.26100.8655
    OS: Microsoft Windows NT 10.0.26200.0
    wsl.exe --version output is UTF-16/NUL-interleaved over SSH, e.g.:
    W\0S\0L\0 \0v\0e\0r\0s\0i\0o\0n\0:\0 \02\0.\06\0.\03\0.\00\0
    ...
    W\0i\0n\0d\0o\0w\0s\0 \0v\0e\0r\0s\0i\0o\0n\0:\0 \01\00\0.\00\0.\02\06\02\00\00\0.\08\06\05\05\0
    

    Release-binary parse result:

    MARKER=ISSUE661-WINDOWS-REAL-WSL-PARSE-20260613-0121
    ASSEMBLY=C:\Users\andyl\openclaw-proof\win-node-v063\extract\SetupEngine\OpenClaw.SetupEngine.dll
    HOST=ANDY-DESKTOP
    OS=Microsoft Windows NT 10.0.26200.0
    WSL_EXIT=0
    RAW_NUL_COUNT=220
    PARSE_OK=True
    PARSED_VERSION=2.6.3.0
    

    I also ran the focused parser regression tests from current main on the same Windows PC after installing the repo-pinned .NET SDK 10.0.100 into a user-local .dotnet10 folder:

    dotnet test .\tests\OpenClaw.SetupEngine.Tests\OpenClaw.SetupEngine.Tests.csproj \
      --filter "FullyQualifiedName~WslInstallSupport_TryParseWslVersion"
    
    Test Run Successful.
    Total tests: 33
    Passed: 33
    

    Those 33 tests cover English, German/hyphenated, Spanish, Chinese, Japanese, the 22 Microsoft WSL localized package-version labels, NUL-stripped UTF-16 simulations, and adjacent WSLg / Windows / kernel false-positive guards.

    This confirms the released v0.6.3 x64 setup-engine binary parses a real NUL-interleaved Windows WSL version response that would have hit the old preflight parsing bug.

    @clawsweeper re-review

  15. github-actions commented on Jun 13, 2026

    @github-actions
    Contributor

    🤖 This is an automated response from Repo Assist.

    Just noting a helpful data point: as of today (2026-06-13), @TurboTheTurtle has posted release-channel runtime proof confirming that v0.6.3 correctly parses real NUL-interleaved WSL version output on Windows NT 10.0.26200.0.

    The key result from their test:

    PARSE_OK=True
    PARSED_VERSION=2.6.3.0
    

    And the focused parser regression suite (33 tests covering English, German, Spanish, Chinese, Japanese, and the 22 Microsoft WSL localized labels) passes fully on current main.

    This appears to confirm the fix from PR #666 is working correctly in the released v0.6.3 binary. The original preflight-wsl parsing failure should no longer occur on non-English Windows systems with the current installer.

    Maintainers: this issue looks ready to close now that the fix has been independently verified in the release binary. Happy to defer to the team's judgment on timing.

    Generated by 🌈 Repo Assist, see workflow run. Learn more.

    Add this agentic workflows to your repo

    To install this agentic workflow, run

    gh aw add githubnext/agentics/workflows/repo-assist.md@97143ac59cb3a13ef2a77581f929f06719c7402a
    
  16. clawsweeper commented on Jun 15, 2026

    @clawsweeper

    🦞⚠️
    Automatic implementation stopped before completion.
    Reason: The automatic implementation worker stopped before all deterministic gates completed. Open the workflow run for the exact blocker.
    Worker: https://github.com/openclaw/clawsweeper/actions/runs/27583082843

  17. TurboTheTurtle commented on Jun 16, 2026

    @TurboTheTurtle
    Contributor

    Current main already contains the localized / hyphenated / NUL-stripped WSL version parser fix and regression coverage from the merged #666 path.

    I rechecked the current branch at d392f7d4 and ran the focused setup-engine parser coverage:

    dotnet test ./tests/OpenClaw.SetupEngine.Tests/OpenClaw.SetupEngine.Tests.csproj --filter 'FullyQualifiedName~WslInstallSupport_TryParseWslVersion'
    Passed: 33, Failed: 0, Skipped: 0
    

    The current tests cover WSL-Version, Spanish Versión de WSL, localized Microsoft package-version labels, and NUL-stripped UTF-16 output. I do not see a remaining source fix to PR against main; this issue now looks like a release-channel verification/backport tracking item rather than an unfixed parser bug on the default branch.

    @clawsweeper re-review

  18. TurboTheTurtle commented on Jun 16, 2026

    @TurboTheTurtle
    Contributor

    @clawsweeper re-review

  19. modified the milestone: 0.7 ALPHA on Jun 25, 2026
  20. shanselman commented on Jun 27, 2026

    @shanselman
    Collaborator

    Closing as fixed/verified on current main. I re-ran the focused parser coverage for the reported path:

    dotnet test .\tests\OpenClaw.SetupEngine.Tests\OpenClaw.SetupEngine.Tests.csproj --filter "FullyQualifiedName~WslInstallSupport_TryParseWslVersion"
    Passed: 33, Failed: 0, Skipped: 0
    

    I also re-ran the full setup-engine suite after the current setup changes:

    dotnet test .\tests\OpenClaw.SetupEngine.Tests\OpenClaw.SetupEngine.Tests.csproj --no-restore
    Passed: 361, Failed: 0, Skipped: 0
    

    Current main covers localized labels, hyphenated WSL-Version, and NUL-stripped UTF-16 WSL output. The release-channel v0.6.3 proof already posted above confirms the fixed parser also works against real Windows wsl.exe --version output.

  21. locked as resolved and limited conversation to collaborators on Jun 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1clawsweeper:fix-shape-clearclawsweeper:queueable-fixclawsweeper:source-reproimpact:otherissue-rating: 🦞 diamond lobster

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions