Built-in Agent subsystem enters a runaway loop, repeatedly running taskkill and launching conhost.exe, maxing out the CPU
What version of the Codex App are you using (From “About Codex” dialog)?
26.715.4045.0
What subscription do you have?
plus
What platform is your computer?
Windows 11
What issue are you seeing?
内置 Agent 子系统进入了一个失控循环,不断执行 taskkill(可能是在做进程清理)和启动 conhost.exe(每次命令执行都创建新 conhost)导致CPU爆满.
1..30 | ForEach-Object {
> $tk = @(Get-Process taskkill -ErrorAction SilentlyContinue).Count > $ch = @(Get-Process conhost -ErrorAction SilentlyContinue).Count > $ps = @(Get-Process powershell -ErrorAction SilentlyContinue).Count > > "{0:HH:mm:ss} taskkill={1} conhost={2} powershell={3}" -f ` > (Get-Date),$tk,$ch,$ps > > Start-Sleep 1 > }
18:53:55 taskkill=174 conhost=188 powershell=1
18:53:56 taskkill=184 conhost=199 powershell=1
18:53:57 taskkill=196 conhost=212 powershell=1
18:53:58 taskkill=209 conhost=224 powershell=1
18:53:59 taskkill=221 conhost=238 powershell=3
18:54:00 taskkill=231 conhost=248 powershell=3
18:54:01 taskkill=242 conhost=258 powershell=3
18:54:02 taskkill=251 conhost=267 powershell=3
18:54:03 taskkill=261 conhost=278 powershell=3
18:54:04 taskkill=271 conhost=288 powershell=3
18:54:05 taskkill=282 conhost=300 powershell=3
18:54:06 taskkill=293 conhost=310 powershell=3
18:54:07 taskkill=306 conhost=322 powershell=3
18:54:09 taskkill=303 conhost=316 powershell=3
18:54:10 taskkill=303 conhost=315 powershell=4
18:54:11 taskkill=302 conhost=313 powershell=4
18:54:12 taskkill=293 conhost=303 powershell=3
18:54:13 taskkill=285 conhost=296 powershell=3
18:54:14 taskkill=292 conhost=303 powershell=3
18:54:15 taskkill=298 conhost=308 powershell=3
18:54:16 taskkill=300 conhost=309 powershell=3
18:54:17 taskkill=302 conhost=313 powershell=3
18:54:18 taskkill=299 conhost=306 powershell=1
18:54:19 taskkill=302 conhost=310 powershell=1
18:54:20 taskkill=298 conhost=308 powershell=3
18:54:21 taskkill=293 conhost=301 powershell=2
18:54:22 taskkill=296 conhost=304 powershell=1
18:54:23 taskkill=295 conhost=303 powershell=1
18:54:25 taskkill=295 conhost=303 powershell=1
18:54:26 taskkill=296 conhost=304 powershell=1
<html>
<body>
<!--StartFragment-->
进程 | 行为
-- | --
ChatGPT.exe (64856) | 父进程,大量 spawn taskkill.exe
codex.exe (42884) | 父进程,大量 spawn conhost.exe
taskkill / conhost | 被 Codex 不断重复执行
<!--EndFragment-->
</body>
</html>
What steps can reproduce the bug?
启动codex后就会触发
What is the expected behavior?
修复异常把CPU打爆的bug
Additional information
_No response_
5 Comments
English translation:
What version of the Codex App are you using (From “About Codex” dialog)?
26.715.4045.0
What subscription do you have?
plus
What platform is your computer?
Windows 11
What issue are you seeing?
The built-in Agent subsystem entered a runaway loop, repeatedly running taskkill (possibly for process cleanup) and launching conhost.exe (creating a new conhost for every command execution), causing CPU usage to max out.
1..30 | ForEach-Object {
18:53:55 taskkill=174 conhost=188 powershell=1
18:53:56 taskkill=184 conhost=199 powershell=1
18:53:57 taskkill=196 conhost=212 powershell=1
18:53:58 taskkill=209 conhost=224 powershell=1
18:53:59 taskkill=221 conhost=238 powershell=3
18:54:00 taskkill=231 conhost=248 powershell=3
18:54:01 taskkill=242 conhost=258 powershell=3
18:54:02 taskkill=251 conhost=267 powershell=3
18:54:03 taskkill=261 conhost=278 powershell=3
18:54:04 taskkill=271 conhost=288 powershell=3
18:54:05 taskkill=282 conhost=300 powershell=3
18:54:06 taskkill=293 conhost=310 powershell=3
18:54:07 taskkill=306 conhost=322 powershell=3
18:54:09 taskkill=303 conhost=316 powershell=3
18:54:10 taskkill=303 conhost=315 powershell=4
18:54:11 taskkill=302 conhost=313 powershell=4
18:54:12 taskkill=293 conhost=303 powershell=3
18:54:13 taskkill=285 conhost=296 powershell=3
18:54:14 taskkill=292 conhost=303 powershell=3
18:54:15 taskkill=298 conhost=308 powershell=3
18:54:16 taskkill=300 conhost=309 powershell=3
18:54:17 taskkill=302 conhost=313 powershell=3
18:54:18 taskkill=299 conhost=306 powershell=1
18:54:19 taskkill=302 conhost=310 powershell=1
18:54:20 taskkill=298 conhost=308 powershell=3
18:54:21 taskkill=293 conhost=301 powershell=2
18:54:22 taskkill=296 conhost=304 powershell=1
18:54:23 taskkill=295 conhost=303 powershell=1
18:54:25 taskkill=295 conhost=303 powershell=1
18:54:26 taskkill=296 conhost=304 powershell=1
<html>
<body>
<!--StartFragment-->
Process | Behavior
-- | --
ChatGPT.exe (64856) | Parent process, spawns a large number of taskkill.exe processes
codex.exe (42884) | Parent process, spawns a large number of conhost.exe processes
taskkill / conhost | Repeatedly executed by Codex
<!--EndFragment-->
</body>
</html>
What steps can reproduce the bug?
It is triggered as soon as Codex is launched.
What is the expected behavior?
Fix the bug that causes CPU usage to max out.
Additional information
_No response_
<!-- codex-issue-translator -->
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
Additional same-build reproduction with a startup-resume A/B test.
Environment
OpenAI.Codex_26.715.4045.0_x64__2p2nqsd0c76g00.145.0-alpha.1810.0.26200.8655, x64Process/WMI evidence
The issue was first noticed as WMI Provider Host using 58.4% total CPU (about 231 MB working set). Process-parent tracing attributed the repeated cleanup activity to the Codex desktop
ChatGPT.exeprocess, not to the other development tool that happened to be open.A 12-second high-frequency sample captured 126 newly created processes:
taskkill.exegit.exebash.execonhost.exeA later 9-second window captured 98
taskkill.exeinvocations. WMI Activity Event 5858 repeatedly showed cancelledWin32_Processqueries from short-lived client PIDs with0x80041032(WBEM_E_CALL_CANCELLED). The locallogs_2.sqlitegrew to about 422 MB while the loop was active.Reinstalling the same MSIX build did not help because the local Codex state survived.
Archive/resume A/B test
The most useful new finding is that this appears tied to stale resumable execution state:
taskkill.exeinvocations. Existingbash,git, and a prior project launch command were being revived even though no corresponding task was visibly active.~/.codex, while retaining authentication and configuration.taskkill.exeinvocations and 0 new WMI errors. The desktop app remained stable.Because the quarantine moved several state surfaces together, this does not prove that one specific file under
sessions/is solely responsible. It does strongly implicate startup resume/reconciliation of retained local thread/rollout state. Restoring the affected state has not been attempted because it may retrigger the storm.Expected behavior
This also appears related to #34025, #33776, #23851, and #22411. I retained the quarantined evidence and can provide sanitized process samples or WMI entries if maintainers request them.
Subscription and weekly-quota impact
token_count.rate_limitstelemetry confirmsplan_type=proand a10080-minute (7-day) usage window.The timing strongly associates the quota consumption with the runaway recovery behavior, but exact billing attribution requires a server-side audit. Please audit usage for this incident window and consider restoring weekly quota consumed by product-driven background execution.
Same issue here, ChatGPT/Codex windows app is stuck in a runaway process-enumeration loop with taskkill.exe whenever launched, causing WMI to get stuck at 25% CPU constantly, lagging my entire PC.
The runaway
taskkill/conhost.exeloop here is very close to the downstream behavior I measured. In my reproduction, repeated desktop Git refreshes were upstream, so this workaround is worth testing if the same parent chain is present.I published a single-file Windows launcher for the original Microsoft Store/MSIX Codex app:
It starts Codex with a process-scoped
GIT_DIR=NUL. On my machine, the stable trace changed from 247 newgit.exeand 137 newtaskkill.exeprocesses per 10 seconds to 0 and 0 over 15 seconds; WMI Provider Host fell from about 6.6% to 0.9%.Usage: fully exit Codex from the Windows system tray, then run the script.
This is an unofficial workaround, not an upstream fix. It deliberately disables or limits Review, Changes, branch detection, commit, and other Git-backed Codex features. If the process storm in this issue has a different upstream cause, this may not apply. The launcher does not patch Codex, modify repositories or Git configuration, write system environment variables, require elevation, terminate processes, or remove chat history. Launching Codex normally restores Git integration.