apply_patch stalls for several minutes after patch generation while token usage continues, and the file is not modified

Open 💬 3 comments Opened Jul 17, 2026 by bait0ngxaxa

What version of Codex CLI is running?

codex-cli 0.144.4

What subscription do you have?

plus

Which model were you using?

gpt-5.6

What platform is your computer?

Windows 11

What terminal emulator and version are you using (if applicable)?

Powershell

Codex doctor report

What issue are you seeing?

After upgrading to GPT-5.6, I frequently experience a severe delay when Codex applies file changes.

The agent completes its reasoning and displays the generated patch or the code it intends to write. However, the actual file in the workspace is not modified immediately.

I consistently have to wait around 2–3 minutes before the file is updated. In some cases, the operation stalls for more than 5 minutes and eventually fails without modifying the file at all.

During the entire waiting period, token usage continues to increase even though:

The reasoning appears to have already completed.
The generated patch is already visible in the UI.
No actual changes have been written to the file.
The task may eventually fail without producing any usable result.

This causes a significant amount of token usage to be consumed while no work is completed.

What steps can reproduce the bug?

  • Open a project in Codex.
  • Use a GPT-5.6 model.
  • Ask the agent to modify an existing file.
  • Wait for the agent to finish reasoning and generate the patch.
  • Observe that the patch or intended code is displayed in the UI.
  • Check the actual file on disk.
  • The file remains unchanged for approximately 2–3 minutes, and sometimes for more than 5 minutes.
  • Observe the token usage during this period.
  • Token usage continues to increase while waiting for the patch operation to complete.
  • In some cases, the patch eventually fails and the file is never modified.

What is the expected behavior?

Once the agent has completed reasoning and generated the patch:

The patch should be applied to the file within a reasonable amount of time.
Token usage should not continue increasing while the local patch or filesystem operation is stalled.
If the patch cannot be applied, the operation should fail quickly with a clear error.
Codex should not continue consuming tokens while waiting on a blocked or failed file-write operation.

Additional information

_No response_

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗