Failed to apply patch due to encoding issues

Open 💬 3 comments Opened Jan 21, 2026 by tengmmvp
💡 Likely answer: A maintainer (etraut-openai, contributor) responded on this thread — see the highlighted reply below.

What version of Codex is running?

0.87.0

What subscription do you have?

Chatgpt Plus

Which model were you using?

gpt-5.2-codex

What platform is your computer?

Microsoft Windows NT 10.0.26220.0 x64

What terminal emulator and version are you using (if applicable)?

Windows Terminal

What issue are you seeing?

✘ Failed to apply patch
└ execution error: Io(Custom { kind: Other, error: "windows sandbox join error: task 5601 panicked with message \"byte index 200 is not a char
boundary; it is inside '阴' (bytes 199..202) of D:\\\\Download\\\\npm-global\\\\node_modules\\\\@openai\\\\codex\\\\vendor\\\\x86_64-pc-windows-msvc\
\\\codex\\\\codex.exe --codex-run-as-apply-patch *** Begin Patch\\n*** Update File: frontend/src/styles/variables.css\\n@@\\n /* 阴影 */\\n --sm-
shadow-1: 0 1px 2px rgba(0, 0, 0, 0.04)
[...]\"" })
• The patch tool fails on non-ASCII Chinese characters, so I'll avoid apply_patch and use a Python script to insert lines after the --sm-shadow-2
substring, ensuring ASCII safety.

What steps can reproduce the bug?

This issue may occur when Chinese characters are present in the code.

What is the expected behavior?

_No response_

Additional information

_No response_

View original on GitHub ↗

3 Comments

etraut-openai contributor · 7 months ago

Please use the /feedback slash command to upload your logs and session details for the session where the failure occurred. Then post the thread ID here.

umairshahid-1 · 7 months ago

#9661 is also the same issue. @etraut-openai

etraut-openai contributor · 7 months ago

@umairshahid-1, these look like different issues. This problem is related to text encoding. The other is related to permissions.