apply_patch intermittently hangs/stalls without returning success or error
What version of Codex CLI is running?
codex-cli 0.133.0
What subscription do you have?
Business
Which model were you using?
gpt-5-codex
What platform is your computer?
Darwin 25.3.0 arm64 arm
What terminal emulator and version are you using (if applicable)?
Codex desktop / Codex shell environment. No terminal multiplexer.
Codex doctor report
What issue are you seeing?
apply_patch intermittently hangs or stalls while applying normal file edits.
When this happens, the tool call does not quickly return either success or a useful failure
message. The agent appears blocked waiting for apply_patch, sometimes for more than 30 seconds,
and the only practical workaround was to avoid apply_patch and use direct shell-based edits
instead. In the latest releases that workaround does not work anymore.
What steps can reproduce the bug?
The issue is intermittent, but the pattern is:
- Start a Codex session in a local code workspace.
- Ask Codex to make a small source edit.
- Codex invokes
apply_patch. - Sometimes
apply_patchstalls instead of returning success or a clear failure. - The session remains blocked until the workflow is abandoned or the agent switches to shell-
based file edits.
Example class of operation:
- edit an existing source/header/test file
- apply a small patch
- expect the patch tool to return promptly
I do not have a deterministic minimal reproducer yet.
What is the expected behavior?
apply_patch should return deterministically.
If the patch applies, it should return success promptly. If the patch cannot be applied, it should fail promptly with a clear diagnostic. It should not hang or leave the agent blocked without
feedback.
Additional information
_No response_
This issue has 5 comments on GitHub. Read the full discussion on GitHub ↗