process: fix Windows runExec garbled CJK output [AI-assisted]#50885
process: fix Windows runExec garbled CJK output [AI-assisted]#50885zhangyongjie1997 wants to merge 3 commits intoopenclaw:mainfrom
Conversation
Greptile SummaryThis PR fixes Windows CJK (mojibake) output when running Key findings:
Confidence Score: 2/5
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a66fca1b37
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 79c1d8d9f2
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
|
Thanks for the context here. I did a careful shell check against current Close as implemented on main. Current main and v2026.4.26 fix the Windows exec CJK mojibake problem with a broader console-codepage-aware buffer decoder, and the merged maintainer replacement #72393 explicitly credited and superseded this PR. Best possible solution: Close this PR and keep the shipped #72393/v2026.4.26 implementation. It solves the same user problem more broadly than the chcp-prefix approach by decoding captured Windows process output with console-codepage awareness across exec and spawn paths. What I checked:
So I’m closing this as already implemented rather than keeping a duplicate issue open. Codex review notes: model gpt-5.5, reasoning high; reviewed against 2ccdbc7dd93b; fix evidence: release v2026.4.26, commit be8c24633aaa. |
Summary
.cmd/.batexecution throughcmd.exewrapper could produce garbled CJK output because the active code page is often not UTF-8.runExecnow prependschcp 65001>nul &&on Windows cmd-wrapper paths when output decoding is UTF-8.runCommandWithTimeoutgets the same UTF-8 code-page prefix for cmd-wrapper consistency.useCmdWrappergate (avoids spurious throws on non-wrapper paths).utf8andutf-8trigger the UTF-8 code-page path.src/process/exec.windows.test.ts.Change Type
Linked Issue/PR
User-visible / Behavior Changes
.cmd/.batwrapper execution is no longer mojibake in UTF-8 decode scenarios.runExec(..., { encoding: "utf8" })andrunExec(..., { encoding: "utf-8" })now behave consistently for wrapper code-page setup.Security Impact
Repro + Verification
Environment
runExec,runCommandWithTimeout)Steps
.cmdcommand through Windows cmd-wrapper path with CJK output.utf8andutf-8).Result
pnpm test -- src/process/exec.windows.test.tsRisks and Mitigations
Closes #50519