Skip to content

[Repo Assist] fix(setup): accept hyphenated and localized WSL version labels in preflight - #666

Merged
ranjeshj merged 3 commits into
masterfrom
repo-assist/fix-issue-661-wsl-localized-version-564657b90072bd36
Jun 3, 2026
Merged

ranjeshj merged 3 commits into
masterfrom
repo-assist/fix-issue-661-wsl-localized-version-564657b90072bd36

Conversation

@github-actions

@github-actions github-actions Bot commented Jun 3, 2026 •

Copy link
Copy Markdown
Contributor

🤖 This is an automated pull request from Repo Assist, with follow-up maintainer updates.

Summary

Addresses #661 — preflight-wsl fails on non-English Windows even when WSL is installed and at a supported version.

Note: #661 should remain open after this PR merges until the fix is included in a release and verified there.

Root Cause

wsl.exe --version returns localized, human-readable text and can also emit UTF-16LE/NUL-interleaved output on some Windows builds. The old parser normalized NUL/BOM characters, but still required the English label shape:

WSL version: 2.7.3.0

That failed for valid localized output such as:

WSL-Version: 2.7.7.0
Versión de WSL: 2.7.3.0

So setup could report WSL version output did not include a parseable WSL version even when WSL was installed, up to date, and wsl.exe --version exited successfully.

Fix

The parser no longer tries to match translated label text like version, Version, Versión, etc.

Instead, WslInstallSupport.TryParseWslVersion now:

  1. Normalizes NUL/BOM output.
  2. Splits wsl.exe --version output by line.
  3. Finds a line containing the stable WSL product token.
  4. Parses the semantic version on that same line.
  5. Avoids accidentally reading adjacent component versions such as WSLg, Windows, or kernel versions.

This keeps the fix narrow while removing the localization dependency from the version-label words.

Locale Coverage

Added regression coverage using the upstream microsoft/WSL localization resources:

  • Source checked: localization/strings/*/Resources.resw
  • Resource key: MessagePackageVersions
  • Coverage: all 22 currently published locale labels, including Czech, Danish, German, Spanish, Finnish, French, Hungarian, Italian, Japanese, Korean, Norwegian, Dutch, Polish, Portuguese, Russian, Swedish, Turkish, Simplified Chinese, and Traditional Chinese.

The parser is also covered for:

  • English, German, Spanish, Japanese-style, and no-separator labels.
  • NUL-stripped UTF-16-style output.
  • Multi-line output with Kernel, WSLg, and Windows component versions.
  • False-positive guard where only adjacent component version lines are present.

Verification

A contributor verified the PR fix on a Chinese-localized Windows install: #661 (comment)

They reported that setup successfully got through the wizard and connected to the gateway and chat.

Validation

Local validation completed on Windows:

./build.ps1                                                     ✅ passed
dotnet test ./tests/OpenClaw.SetupEngine.Tests/...              ✅ 230/230
dotnet test ./tests/OpenClaw.Shared.Tests/... --no-restore      ✅ 2045 passed, 29 skipped integrations
dotnet test ./tests/OpenClaw.Tray.Tests/... --no-restore        ✅ 934/934

Structured review also reported no accepted/actionable findings.

Notes / Trade-offs

Parsing wsl.exe --version remains less ideal than a locale-independent WSL API or capability probe. However, the current implementation now depends on the stable product token WSL plus a semantic version, not on translated human-readable label text.

Longer term, the cleanest design may be to make the version check non-blocking and let the actual wsl --install --distribution ... --name ... --location ... command validate capability directly, with cleanup and clearer error handling if WSL lacks those flags.

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

To install this agentic workflow, run

gh aw add githubnext/agentics/workflows/repo-assist.md@97143ac59cb3a13ef2a77581f929f06719c7402a

…flight

wsl.exe on non-English Windows emits UTF-16LE output. After NUL-stripping,
the label becomes 'WSL-Version:' (German) instead of 'WSL version:' (English).
Localized systems can also emit e.g. 'Versión de WSL:' (Spanish).

The previous regex only matched 'WSL\s+version:' so preflight-wsl would
return a terminal failure even though wsl.exe reported a supported version.

Fix: extend the regex to an alternation that covers:
  - 'WSL version:'       (English, space-separated)
  - 'WSL-Version:'       (German / NUL-stripped UTF-16 output)
  - 'Versión de WSL:'    (Spanish localized)

Add Theory regression tests covering all three forms plus a NUL-byte
simulation test that encodes/strips UTF-16 bytes before parsing.

Closes #661

Co-authored-by: Copilot <[email protected]>
@github-actions github-actions Bot added automation bug Something isn't working repo-assist labels Jun 3, 2026
@clawsweeper

clawsweeper Bot commented Jun 3, 2026 •

Copy link
Copy Markdown

Codex review: needs maintainer review before merge. Reviewed June 3, 2026, 1:41 PM ET / 17:41 UTC.

Summary
The PR updates WSL setup preflight version parsing to find a semantic version on the line containing the WSL product token and expands setup-engine tests for localized WSL version labels.

Reproducibility: yes. source inspection gives a high-confidence reproduction path: current main's parser requires WSL version: and preflight-wsl fails terminally when that parse returns false. The linked report also provides a v0.6.0 runtime log for the same terminal failure on a supported WSL version.

Review metrics: 2 noteworthy metrics.

  • Changed surface: 2 files affected. The patch is limited to one setup-engine source file and its test file, which keeps review focused on parser behavior.
  • Regression coverage: 22 localized label cases added. The tests exercise the locale family described in the linked setup failure rather than only the reporter's single label.

Merge readiness
Overall: 🦞 diamond lobster
Proof: 🌊 off-meta tidepool
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

  • [P1] This read-only review did not rerun the Windows build and test commands; the PR body reports Windows validation, so maintainers should rely on CI or rerun the repository-required validation before merge.

Maintainer options:

  1. Decide the mitigation before merge
    Land the focused parser and regression-test fix after maintainer validation, so the linked setup bug is closed by the implementation rather than by stale cleanup.
  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 because the PR already contains the focused parser and regression-test changes; the remaining action is maintainer validation and merge review.

Security
Cleared: The diff only changes setup-engine parsing logic and tests; it does not add dependencies, scripts, credential handling, or supply-chain-sensitive behavior.

Review details

Best possible solution:

Land the focused parser and regression-test fix after maintainer validation, so the linked setup bug is closed by the implementation rather than by stale cleanup.

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

Yes, source inspection gives a high-confidence reproduction path: current main's parser requires WSL version: and preflight-wsl fails terminally when that parse returns false. The linked report also provides a v0.6.0 runtime log for the same terminal failure on a supported WSL version.

Is this the best way to solve the issue?

Yes. The PR solves the immediate bug at the parser boundary by keying on the stable WSL product token plus a same-line semantic version, while tests guard against adjacent component-version false positives.

AGENTS.md: found and applied where relevant.

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

Label changes

Label justifications:

  • P1: The PR addresses a real setup preflight failure that can block non-English Windows users from completing OpenClaw setup even with a supported WSL version.
  • rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🌊 off-meta tidepool and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This is a Repo Assist bot PR, so the external-contributor real-behavior proof gate is not applied; the PR body reports Windows validation as supporting context.
Evidence reviewed

What I checked:

  • Current main still has the narrow English parser: At current main, TryParseWslVersion normalizes output but still matches only WSL\s+version:, so labels like WSL-Version: or Versión de WSL: remain outside the current parser contract. (src/OpenClaw.SetupEngine/SetupSteps.cs:55, f839cf53aa0c)
  • Preflight uses the parser for a terminal setup decision: PreflightWslStep combines stdout/stderr from wsl.exe --version and returns a terminal failure when TryParseWslVersion cannot parse a WSL version, matching the linked report's user-visible failure mode. (src/OpenClaw.SetupEngine/SetupSteps.cs:444, f839cf53aa0c)
  • PR source changes the parsing boundary narrowly: The PR adds product-token and semantic-version regexes, scans normalized output line by line, ignores non-WSL component lines, and keeps the parsed Version construction in a helper. (src/OpenClaw.SetupEngine/SetupSteps.cs:40, d4305eb65f39)
  • PR tests cover the reported locale class: The PR adds localized Microsoft WSL label cases, hyphenated labels, NUL-stripped UTF-16 simulations, and guards against parsing WSLg, Windows, or kernel component versions as the WSL package version. (tests/OpenClaw.SetupEngine.Tests/SetupStepsTests.cs:509, d4305eb65f39)
  • Diff scope is focused: The branch changes only SetupSteps.cs and SetupStepsTests.cs, with 115 additions and 10 deletions concentrated in the WSL parser and regression coverage. (src/OpenClaw.SetupEngine/SetupSteps.cs:37, d4305eb65f39)
  • History provenance for existing parser: git blame attributes the current English-only parser and nearby setup-engine tests to the v0.6.0 release commit, which explains why the linked v0.6.0 report still matters. (src/OpenClaw.SetupEngine/SetupSteps.cs:55, 7d9152f427a3)

Likely related people:

  • RBrid: Blame on current main attributes the existing WSL version parser and original setup-engine parser tests to the v0.6.0 release commit authored by this account. (role: introduced behavior; confidence: high; commits: 7d9152f427a3; files: src/OpenClaw.SetupEngine/SetupSteps.cs, tests/OpenClaw.SetupEngine.Tests/SetupStepsTests.cs)
  • ranjeshj: Recent current-main work changed the same setup-engine and test files for WSL gateway setup behavior, and the PR follow-up commits refine this parser fix. (role: recent adjacent contributor; confidence: medium; commits: 3ddade7072b0, 174c79c6f526, d4305eb65f39; files: src/OpenClaw.SetupEngine/SetupSteps.cs, tests/OpenClaw.SetupEngine.Tests/SetupStepsTests.cs)
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 rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. P1 Urgent regression or broken agent/channel workflow affecting real users now. labels Jun 3, 2026
Avoid matching localized human-readable labels from wsl.exe --version. Instead, find the stable WSL product token on a line and parse the semantic version from that same line, while ignoring adjacent WSLg, Windows, and kernel version lines.

Co-authored-by: Copilot <[email protected]>
Add regression data for the MessagePackageVersions labels from microsoft/WSL localization resources so the WSL version parser is exercised against every published locale.

Co-authored-by: Copilot <[email protected]>
@clawsweeper clawsweeper Bot added rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. labels Jun 3, 2026
@ranjeshj
ranjeshj marked this pull request as ready for review June 3, 2026 17:36
@ranjeshj
ranjeshj merged commit be64bea into master Jun 3, 2026
34 checks passed
@ranjeshj
ranjeshj deleted the repo-assist/fix-issue-661-wsl-localized-version-564657b90072bd36 branch June 3, 2026 19:50
@github-actions github-actions Bot mentioned this pull request Jun 4, 2026
26 tasks
@clawsweeper clawsweeper Bot mentioned this pull request Sep 5, 2026
4 of 16 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

automation bug Something isn't working P1 Urgent regression or broken agent/channel workflow affecting real users now. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. repo-assist 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.

1 participant