Skip to content

will constantly generate taskkill.exe when executing, #34730

Open

Description

@mengshenup

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

Activity

  1. added
    app
    on Jul 22, 2026
  2. added
    bug
    windows-os
    tool-calls
    on Jul 22, 2026
  3. 1284477813 commented on Jul 23, 2026

    @1284477813

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

    特定会话保存了 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 复用后误杀其他进程。
  4. NI-SO commented on Jul 24, 2026

    @NI-SO

    我也遇到了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    appbugperformancetool-callswindows-os

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions