Skip to content

Failed to apply patch due to encoding issues #9580

Open

Description

@tengmmvp

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

Activity

  1. added
    bug
    on Jan 21, 2026
  2. added
    CLI
    windows-os
    tool-calls
    sandbox
    on Jan 21, 2026
  3. etraut-openai commented on Jan 21, 2026

    @etraut-openai
    Contributor

    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.

  4. umairshahid-1 commented on Jan 22, 2026

    @umairshahid-1

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

  5. etraut-openai commented on Jan 22, 2026

    @etraut-openai
    Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    CLIbugsandboxtool-callswindows-os

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions