Everytime codex tries to use the `apply_patch` tool, it hangs indefinitely.

Resolved 💬 10 comments Opened Nov 24, 2025 by denismaciel Closed Mar 2, 2026
💡 Likely answer: A maintainer (github-actions[bot], contributor) responded on this thread — see the highlighted reply below.

What version of Codex is running?

0.63

What subscription do you have?

Pro

Which model were you using?

It happens with all of tehm

What platform is your computer?

NixOS

What issue are you seeing?

Everytime codex tries to use the apply_patch tool, it hangs indefinitely.

<img width="1581" height="737" alt="Image" src="https://github.com/user-attachments/assets/d44a6e2f-6a4c-43a8-8e73-4b499e712b13" />

What steps can reproduce the bug?

Uploaded thread: 019ab7d4-42dc-7402-88e8-476998ceb487

What is the expected behavior?

Codex successfully applies a patch.

Additional information

_No response_

View original on GitHub ↗

10 Comments

github-actions[bot] contributor · 7 months ago

Potential duplicates detected. Please review them and close your issue if it is a duplicate.

  • #7109

Powered by Codex Action

amitbcp · 7 months ago

Facing the same issue

448523760 contributor · 7 months ago

Try enabling debug logging to see what Codex is doing when it hangs. It may be stuck in an infinite loop.

For more detail, set the RUST_LOG environment variable to codex_core=debug, reproduce the issue, and then check the logs at ~/.codex/log.

Hope this helps.

lionel-oai contributor · 7 months ago

Hi @448523760, @amitbcp, @denismaciel thanks for filling in this bug. I've just tried your example @denismaciel and it worked for me on a dummy markdown file that I have on a testing codex repo:

<img width="1254" height="1018" alt="Image" src="https://github.com/user-attachments/assets/239f69c4-dd33-4098-a242-324a0ac5ccc0" />

Could you try again using gpt-5.1-codex-mini see if that helps? the max model worked for me but I would like to understand if switching to a faster model improves this issue.

amitbcp · 7 months ago

@lionel-oai I have tried all variations and it hangs!

Can you please tell me how to enable debug a bit unclear on how to, so that can share

denismaciel · 7 months ago

I have uninstall codex and reinstalled with bun and it works for me. No idea why.

lionel-oai contributor · 7 months ago

You can check out https://github.com/openai/codex/blob/main/docs/advanced.md#tracing--verbose-logging for enabling tracing for your codex session @amitbcp. Are you using the CLI or the IDE?

amitbcp · 7 months ago

I am using CLI

sayan-oai contributor · 7 months ago

@amitbcp After enabling tracing, please share any relevant snippets from the logs. #7491 has a similar issue with a solution; see if that applies in your case as well.

Also, it would be helpful if you could share the thread-id for a session with the issue (you can obtain this via the /feedback command in the CLI).

etraut-openai contributor · 4 months ago

Closing because of no response.