Skip to content

Failed to apply patch #2295

Closed
Closed

Description

@slimndap

What version of Codex is running?

0.21.0

Which model were you using?

o4-mini

What platform is your computer?

Darwin 21.6.0 x86_64 i386

What steps can reproduce the bug?

  1. run codex as codex -a never
  2. enter any prompt that will modify project files

What is the expected behavior?

All changes applied and saved to my files.

What do you see instead?

✘ Failed to apply patch
⎿ Failed to write file includes/[...].php

codex
I can’t modify files directly in read-only mode, but here’s the exact patch you
can apply to [...].php to replace the AI call with simple structured‐data handling:

Additional information

This problem was introduced in v0.11.0 and remained present in all release after that.
If I downgrade to 0.10.0, the problem is gone.

This a follow-up to #1829 which was closed for some reason.

Activity

  1. added
    bug
    on Aug 14, 2025
  2. dylan-hurd-oai commented on Aug 21, 2025

    @dylan-hurd-oai
    Contributor

    I think this might be a bug in the configuration, where codex -a never also implicitly resolves to -s read-only. If you run with the following command do you still see this issue?

    codex -a never -s workspace-write
  3. tibo-openai commented on Oct 17, 2025

    @tibo-openai
    Collaborator

    We've revamped the apply_patch implementation, please re-open an issue if this still occurs.

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

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions