You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
apply_patch stalls for several minutes after patch generation while token usage continues, and the file is not modified #33719
CLIIssues related to the Codex CLIbugSomething isn't workingperformancetool-callsIssues related to tool callingwindows-osIssues related to Codex on Windows systems
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.
CLI tool calls stall for minutes on Windows, while Desktop appears unaffected
What version of Codex CLI is running?
codex-cli 0.144.5
What platform are you using?
Windows 11
What terminal are you using?
PowerShell
What model were you using?
gpt-5.6-luna
Issue description
Codex CLI frequently stalls while executing tools, especially apply_patch.
The model finishes reasoning and generates the patch, but the tool call remains stuck in a running state for several minutes. During this time, the file is not modified and token usage continues to increase.
In one recent session:
apply_patch started at approximately 2026-07-17 10:00:03 China Standard Time.
It returned no output after 10 seconds.
It remained running through two additional 60-second waits.
It finally returned {} after approximately 149 seconds.
The patch was eventually applied, but the delay was around 2 minutes and 29 seconds.
Other local tools such as Get-Content and git diff also occasionally take 50–80 seconds to return.
Desktop vs CLI behavior
The same machine appears to have different behavior between Codex Desktop and Codex CLI:
The issue is reproducible in CLI sessions (originator: codex-tui, source: cli).
Recent Desktop sessions have not shown the same multi-minute apply_patch stall.
Both appear to use the Windows sandbox and codex-command-runner-0.144.5.
This suggests the issue may be specific to the CLI tool execution or terminal integration path rather than the model response itself.
Relevant logs
The affected session log records repeated states similar to:
apply_patch started
Script running with cell ID ...
Wall time 10.0 seconds
Script running with cell ID ...
Wall time 60.0 seconds
Script running with cell ID ...
Wall time 60.0 seconds
Script completed
Wall time 17.0 seconds
Output: {}
CLIIssues related to the Codex CLIbugSomething isn't workingperformancetool-callsIssues related to tool callingwindows-osIssues related to Codex on Windows systems
Activity
github-actions commentedon Jul 17, 2026
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
yyc-labs commentedon Jul 17, 2026
CLI tool calls stall for minutes on Windows, while Desktop appears unaffected
What version of Codex CLI is running?
codex-cli 0.144.5
What platform are you using?
Windows 11
What terminal are you using?
PowerShell
What model were you using?
gpt-5.6-luna
Issue description
Codex CLI frequently stalls while executing tools, especially
apply_patch.The model finishes reasoning and generates the patch, but the tool call remains stuck in a running state for several minutes. During this time, the file is not modified and token usage continues to increase.
In one recent session:
apply_patchstarted at approximately2026-07-17 10:00:03China Standard Time.{}after approximately 149 seconds.Other local tools such as
Get-Contentandgit diffalso occasionally take 50–80 seconds to return.Desktop vs CLI behavior
The same machine appears to have different behavior between Codex Desktop and Codex CLI:
originator: codex-tui,source: cli).apply_patchstall.codex-command-runner-0.144.5.This suggests the issue may be specific to the CLI tool execution or terminal integration path rather than the model response itself.
Relevant logs
The affected session log records repeated states similar to:
ygireesh commentedon Jul 17, 2026
I am seeing essentially the same issue in Codex Desktop on Windows 11, not only in the CLI.
Environment
Behaviour
Small edits repeatedly stall during the patch-application stage.
Examples:
The slowdown also affects basic agent tool calls:
git status --shortand read the first 10 lines offirestore.rules.Get-Content .\firestore.rules -TotalCount 10directly in normal PowerShell completed immediately.Troubleshooting already performed
The issue remained after the clean reinstall.
This suggests that Desktop is also affected, contrary to the current comment stating that recent Desktop sessions appear unaffected.
This may share a root cause with:
Please let me know which logs or session diagnostics would be useful. I also have screenshots showing the repeated patch-service delay messages.