Intermittent multi-minute apply_patch hangs on Codex Desktop for Windows

Open 💬 2 comments Opened Jul 20, 2026 by andytran86

What version of the Codex App are you using (From “About Codex” dialog)?

26.715.31925

What subscription do you have?

ChatGPT Pro

What platform is your computer?

Microsoft Windows NT 10.0.26200.0 x64

What issue are you seeing?

Title: Intermittent multi-minute apply_patch hangs on Codex Desktop for Windows

Codex Desktop version: 26.715.4045.0
Operating system: Windows
Storage: Local SSD, partitioned into C: and D:
Security software: Trend Micro Apex One Security Agent 14.0.14096 with real-time scanning enabled
Microsoft Defender Antivirus: stopped

Issue:
apply_patch is consistently slow and sometimes remains active for several minutes, even when the patch only adds or changes one or two lines.

In an affected task, the UI displayed “Edited a file”, but the task continued waiting around the apply_patch stage for more than three minutes.

Controlled reproduction:
I created a 78-byte UTF-8 text file in a writable local workspace and measured these apply_patch operations:

  • Create file: 3.671 seconds
  • Change one line: 6.930 seconds
  • Change one line again: 6.188 seconds
  • Delete file: 6.531 seconds

For one measured update:

  • apply_patch started at 14:32:31.552
  • An independent file watcher detected the filesystem change at 14:32:37.718
  • apply_patch returned at 14:32:37.758

This indicates that approximately 6.16 seconds were spent before the file was changed, while the result was returned only about 40 ms after the change.

Additional observations:

  • Repeated warm reads of the same source file take approximately 2 ms.
  • A cold read may take about 0.5 seconds.
  • Trend Micro Real-Time Monitor confirms that it scans both source files and Codex LocalCache files.
  • Trend Micro likely contributes overhead, but the measured file-scan latency does not appear sufficient to explain intermittent 3–4 minute hangs.
  • Security policy does not allow adding Codex or project directories to antivirus exclusions.

Expected behavior:
A one-line patch to a small local file should complete promptly and should not intermittently remain active for several minutes.

Please investigate possible delays or deadlocks in the Windows apply_patch implementation, tool broker/sandbox layer, or interactions with real-time filesystem filter drivers.

Attachments:

  1. Screenshot showing apply_patch waiting for more than three minutes.
  2. Trend Micro Real-Time Monitor scanning a project source file.
  3. Trend Micro Real-Time Monitor scanning the Codex LocalCache directory.

Additional Task Manager evidence:

During the slowdown, Task Manager showed:

  • Overall CPU usage: 61%
  • Overall memory usage: 86%
  • Overall disk usage: 4%
  • Trend Micro Unauthorized Change Prevention: 16.3% CPU
  • ChatGPT/Codex process group: 14% CPU, approximately 745 MB RAM and 3.4 MB/s disk activity
  • Two codex-windows-sandbox processes were performing approximately 1.5 MB/s and 1.8 MB/s disk I/O
  • Some Codex processes were placed in Windows Efficiency mode

This suggests that apply_patch was actively performing sandboxed file I/O while Trend Micro was inspecting file changes. However, a very small one-line patch still taking several minutes appears disproportionate and may indicate an interaction or timeout issue between the Codex Windows sandbox/tool broker and real-time filesystem security filters.

What steps can reproduce the bug?

Dán nội dung sau vào trường “What steps can reproduce the bug?”:

1. Open Codex Desktop on Windows.
2. Open a local source-code workspace located on an internal SSD.
3. Ask Codex to make a very small change to an existing text/source file, for example changing one line:

```diff
-iteration=1
+iteration=2
  1. Codex invokes the apply_patch tool.
  2. Observe that the patch takes approximately 6–7 seconds in a controlled test, even for a 78-byte UTF-8 file.
  3. In normal development tasks, the same tool intermittently remains active for more than 3 minutes when adding or changing only one or two lines.
  4. Check the target file using a separate terminal with git diff. In some cases the UI already displays “Edited a file” while the Codex task continues waiting around the patch stage.

Controlled measurements:

  • Create a 78-byte file: 3.671 seconds
  • Change one line: 6.930 seconds
  • Change one line again: 6.188 seconds
  • Delete the file: 6.531 seconds

For one measured update:

  • apply_patch started at 14:32:31.552
  • An independent file watcher detected the change at 14:32:37.718
  • apply_patch returned at 14:32:37.758

Environment notes:

  • Windows x64
  • C: and D: are partitions on the same local SSD
  • Trend Micro Apex One Security Agent 14.0.14096 real-time scanning is enabled
  • Microsoft Defender Antivirus is stopped
  • Corporate security policy does not allow antivirus exclusions
  • Trend Micro Real-Time Monitor confirms scanning of both project files and Codex LocalCache files
  • During an affected operation, Task Manager showed 61% CPU, 86% memory, Trend Micro using 16.3% CPU, and active disk I/O from codex-windows-sandbox processes


### What is the expected behavior?

<img width="492" height="178" alt="Image" src="https://github.com/user-attachments/assets/a860ec5f-24b7-4cda-8eb2-01073e72b875" />

<img width="903" height="597" alt="Image" src="https://github.com/user-attachments/assets/8a76dc79-ba19-4478-a87f-aa0afd12d623" />

<img width="860" height="581" alt="Image" src="https://github.com/user-attachments/assets/e81f89ee-83fd-434b-bb76-728ac4dcdd60" />

### Additional information

_No response_

View original on GitHub ↗

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