Repository navigation
fix: preserve .wslconfig encoding - #1224
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 25, 2026, 9:10 PM ET / August 26, 2026, 01:10 UTC. ClawSweeper reviewWhat this changesThe PR adds strict Merge readinessKeep this active PR open. Current main still uses permissive UTF-8-only handling, while this focused repair safely preserves supported encodings and its updated body includes direct after-fix rollback output. Priority: P2 Review scores
Verification
Live VerificationCommand: Result: FAIL (failed) — execution before step 1 Assertions:
How this fits togetherThe Setup Engine reads a user-owned flowchart LR
A[User .wslconfig bytes] --> B[Setup Engine]
B --> C[Strict encoding validation]
C --> D[Mirrored networking edit]
D --> E[WSL networking]
D --> F[Original-byte backup]
F --> G[Rollback restore]
Before merge
Agent review detailsSecurityNone. Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep strict pre-write rejection and representation-preserving writes, while making the recovery text actionable for users whose existing file is unsupported. Do we have a high-confidence way to reproduce the issue? Yes. Current main’s UTF-8-only path is source-reproducible for BOM-marked UTF-16 input, and the PR body supplies current-head update-and-rollback output. Is this the best way to solve the issue? Yes. Strict detection before backup or write, preservation of recognized representations, and rejection of ambiguous input are the narrowest safe repair. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against c446f34882af. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
Preserve valid decoded control characters while rejecting NUL-bearing ambiguous Unicode encodings before any backup or write. Expand encoding, rollback, and unknown-content coverage. Co-authored-by: Copilot App <[email protected]>
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
Summary
.wslconfig.Validation
.\build.ps1(passed on AMD64; Shared, CLI, WinNode CLI, SetupEngine, and WinUI built)dotnet test .\tests\OpenClaw.SetupEngine.Tests\OpenClaw.SetupEngine.Tests.csproj --filter FullyQualifiedName~WslGlobalConfigManagerTests --no-restore(30 passed, 0 failed)dotnet test .\tests\OpenClaw.SetupEngine.Tests\OpenClaw.SetupEngine.Tests.csproj --no-restore(967 passed, 0 failed)dotnet test .\tests\OpenClaw.Shared.Tests\OpenClaw.Shared.Tests.csproj --no-restore(3,812 passed, 32 skipped, 0 failed)dotnet test .\tests\OpenClaw.Tray.Tests\OpenClaw.Tray.Tests.csproj --no-restore(2,703 passed, 0 failed)Real behavior proof
Current-head proof loaded the built
OpenClaw.SetupEngine.dlland invokedWslGlobalConfigManageragainst an isolated CRLF UTF-16 LE BOM file containing unrelated[experimental]content.{ "encoding": "UTF-16 LE with BOM", "applyChanged": true, "bomPreserved": true, "mirroredSettingPresent": true, "unknownContentPreserved": true, "rollbackResult": "Restored", "originalSha256": "3a95220877974453a6475a51cdb8944aae960bd010c6148d44c96bec1bc98c4f", "restoredSha256": "3a95220877974453a6475a51cdb8944aae960bd010c6148d44c96bec1bc98c4f", "rollbackByteIdentical": true }Malformed UTF-8/UTF-16, UTF-32 BOM, and BOM-less UTF-16 cases also assert that the original bytes remain unchanged and the backup directory is never created.
Closes #1193