will constantly generate taskkill.exe when executing,

Open 💬 3 comments Opened Jul 22, 2026 by mengshenup
💡 Likely answer: A maintainer (github-actions[bot], contributor) responded on this thread — see the highlighted reply below.

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

win11 microsoft ChatGPT 2026/7/22

What subscription do you have?

20x pro

What platform is your computer?

_No response_

What issue are you seeing?

New versions of the code will constantly generate taskkill.exe when executing, canceling, or cleaning up Shell commands, and will not be properly recycled. Each taskkill.exe in turn brings conhost.exe, which adds up to 287 taskkills + 302 conhosts for a single session. Codex then repeatedly queries an increasingly large process tree through WMI, creating a storm of WMI failures: 987 occurrences of Event ID 5858 in two hours. Processes, handles, and queries continued to pile up, further dragging down the DWM: handles went from 1,205 to 4,458 (growing faster than they could be cleaned up, and the system eventually ran out of quota), resulting in white Windows, stuttering inputs, rendering errors, and even system death

What steps can reproduce the bug?

Any step. Every few minutes taskkill spikes, and after intervals of 1 to 3 hours codex does not respond

What is the expected behavior?

_No response_

Additional information

_No response_

View original on GitHub ↗

3 Comments

github-actions[bot] contributor · 1 month ago

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

  • #33776
  • #34260
  • #34691
  • #34579
  • #34302

Powered by Codex Action

1284477813 · 1 month ago

这是我根据我电脑出现问题后排查的追溯结果:

特定会话保存了 453 个 Review 文件
→ Codex 将所有路径逐个放进 git diff 命令行
→ 命令约 39.7k 字符,超过 Windows 32,767 上限
→ git.exe 无法启动,记录 spawnFailed
→ Review 重试、取消其他 Git 命令
→ Codex 进入有缺陷的 killProcessTree
→ 失效 PID 被复用
→ taskkill/conhost 递归

把项目下的所有未提交git的文件整理好(该忽略忽略),减少一次 Review 涉及的文件数量:拆分提交、缩小未提交改动,避免一次包含数百文件。经过整理后验证发现“大量taskkill”现象得到解决。

注意:在整理好项目未提交文件之前打开具体codex会话,都会直接开启taskkill异常现象。

OpenAI 需要修复(只能等官方修复了)

  • 在启动 Git 前检查 Windows 命令行长度,并对文件路径分批处理。
  • spawnFailed 后不要进入无效的进程树终止流程。
  • 终止进程时使用进程句柄或 Job Object,至少校验 PID、创建时间和进程映像,避免 PID 复用后误杀其他进程。
NI-SO · 1 month ago

我也遇到了