fix: PowerShell exec output with BOM renders as text#109163
Conversation
30c23a5 to
be9d0ae
Compare
|
Codex review: needs maintainer review before merge. Reviewed July 16, 2026, 9:57 PM ET / July 17, 2026, 01:57 UTC. Summary PR surface: Source +92, Tests +55. Total +147 across 2 files. Reproducibility: yes. at the source-and-transcript level: BOM-prefixed PowerShell stdout follows the shared Windows decoder path, and the PR body shows native Windows results for all three BOM forms. This review did not independently execute Windows. Review metrics: none identified. Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Risk before merge
Maintainer options:
Next step before merge
Security Review detailsBest possible solution: Refresh the branch against current main, retain BOM precedence over UTF-8 and console-code-page fallback, and land the shared decoder change with the split-chunk regression tests. Do we have a high-confidence way to reproduce the issue? Yes at the source-and-transcript level: BOM-prefixed PowerShell stdout follows the shared Windows decoder path, and the PR body shows native Windows results for all three BOM forms. This review did not independently execute Windows. Is this the best way to solve the issue? Yes; BOM sniffing in the existing shared Windows decoder is narrower and more maintainable than changing attachment classification or adding a configuration surface. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 6b6bf3a34bd3. Label changesLabel justifications:
Evidence reviewedPR surface: Source +92, Tests +55. Total +147 across 2 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
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
|
be9d0ae to
c7092fa
Compare
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
AI-assisted: yes
Closes #108802
What Problem This Solves
Fixes an issue where users running
execon Windows would see BOM-prefixed PowerShell output render as unreadable output or attachment-like text instead of normal text.Why This Change Was Made
Windows subprocess output now checks for UTF-8, UTF-16LE, and UTF-16BE BOMs before falling back to the existing UTF-8 / console-code-page path. The streaming decoder also waits for enough leading bytes to resolve split BOM chunks.
User Impact
PowerShell commands that emit BOM-prefixed text now stay readable in the agent context instead of degrading into corrupted output.
Evidence
node scripts/run-vitest.mjs src/infra/windows-encoding.test.ts- passed, 13 testsnode_modules\.bin\oxlint.cmd src/infra/windows-encoding.ts src/infra/windows-encoding.test.ts- passedgit diff --check- passedupstream/main; the previouscheck-dependenciesunused-export failures were already fixed on currentmainpnpm deadcode:fullproof blocked by local Node 24.13.0; current OpenClaw requires Node >=24.15.0, while GitHub CI uses Node 24.18.0--end-of-optionsargumentNative Windows exec-path proof:
Command shape:
node_modules\.bin\tsx.cmd -e "<script>"importedcreateChildAdapterfromsrc/process/supervisor/adapters/child.ts, launchedpowershell.exe -NoLogo -NoProfile -NonInteractive -Command "[Console]::OpenStandardOutput().Write(...)", and wrote BOM-prefixed bytes directly to stdout.