Skip to content

apply_patch command generates requests with illegible diff #2005

Closed

Description

@nestedlogicsol

What version of Codex is running?

0.19.0

Which model were you using?

gpt-5

What platform is your computer?

Darwin 25.0.0 arm64 arm

What steps can reproduce the bug?

  1. Fresh install Codex
  2. Login with ChatGPT
  3. Run in sandbox mode (second option)
  4. Ask it to make a random edit to a random file
  5. Observe that:
    • Codex may fail to apply_patch
    • The apply_patch command lacks a proper diff—raw file content is injected instead

What is the expected behavior?

The expected behavior is that I receive a legible diff to approve.

What do you see instead?

Codex attempts to run the patch command option through the terminal, producing an illegible diff, instead of using tools available to itself and asking for approval.

Image Image

Additional information

I could be assuming the correct behavior, but I seem to remember this not being a problem before the sandbox prompt added recently.

Activity

  1. changed the title [-]Title: `apply_patch` command generates malformed requests with no visible diff[/-] [+]Title: `apply_patch` command generates malformed requests with illegible diff[/+] on Aug 8, 2025
  2. changed the title [-]Title: `apply_patch` command generates malformed requests with illegible diff[/-] [+]Title: `apply_patch` command generates requests with illegible diff[/+] on Aug 8, 2025
  3. changed the title [-]Title: `apply_patch` command generates requests with illegible diff[/-] [+]`apply_patch` command generates requests with illegible diff[/+] on Aug 8, 2025
  4. overthetop commented on Aug 9, 2025

    @overthetop

    This makes the codex cli impossible to use...I can't track any changes it makes

  5. cthacker commented on Aug 15, 2025

    @cthacker

    I also have this issue running on mac. Basically every patch I only get a proper diff AFTER it is approved

  6. cthacker commented on Aug 16, 2025

    @cthacker

    0.22.0 seems to actually fix this now

  7. gpeal commented on Aug 24, 2025

    @gpeal
    Contributor

    This should be fixed now. Feel free to reopen if there is still an issue.

  8. vmotta8 commented on Oct 8, 2025

    @vmotta8
    Contributor

    @gpeal It looks like there are still related issues with the approval workflow (#4940, #4892). The "Don't Trust" option isn't applying the approval policy correctly. Opened PR #4941 to address this, would appreciate a review when you get a chance.

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

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions