Codex Desktop on Windows leaves Node/MCP helper processes alive until memory pressure makes PC unresponsive
Summary
Codex Desktop on Windows sometimes leaves many Node/MCP/helper processes running after Codex work, which appears to grow memory usage until the PC becomes sluggish or unresponsive. I am not sure whether the trigger is heavy subagent usage, MCP/Node REPL tool usage, or a broader helper lifecycle issue, but Task Manager shows many Node.js JavaScript Runtime and node_repl.exe processes after Codex activity.
This looks similar to the previously reported Windows helper stack issue in #26327, but I am filing a fresh report because the behavior is still visible on Codex Desktop 26.616.3767.0.
Environment
- App: Codex Desktop on Windows
- Codex package:
OpenAI.Codex_26.616.3767.0_x64__2p2nqsd0c76g0 - OS: Microsoft Windows 11 Pro
- OS version/build:
10.0.26200, build26200, 64-bit - Approx. physical memory: 64 GB
- Usage pattern: long-running Codex Desktop work, including multiple threads/subagents and MCP/tool-enabled sessions
Observed behavior
On 2026-06-19 around 06:28 local time, Windows Task Manager filtered for node showed many Codex-related Node processes. The machine was under substantial memory pressure and became difficult to use.
From the screenshots:
- Task Manager showed overall memory around 67-69%.
- Many
Node.js JavaScript Runtimeentries were present. - Several Node processes were using very large memory individually, including approximately:
- 1,448 MB
- 1,197 MB
- 1,054 MB
- 1,010 MB
- 869 MB
- The same filtered view also showed many
node_repl.exeentries. - CPU and disk activity for many of these processes were low, so the issue appears to be retained idle helper processes rather than active work.
A later live diagnostic sample after the system had recovered/settled still showed repeated Codex helper processes under Codex:
Category Count PrivateMB WorkingMB OldestStart
-------- ----- --------- --------- ---------------------
codex_app_server 1 205.5 257.5 2026-06-19 06:44:42
mcp_server_cjs 3 68.3 116.1 2026-06-19 06:45:02
mcp_server_mjs 3 203.1 154.3 2026-06-19 06:45:02
node_repl 4 188.8 254.8 2026-06-19 06:45:02
other_codex_related 11 865.7 894.5
Representative live process command lines included repeated helpers like:
node_repl.exe
node.exe ./mcp/server.mjs --stdio
node.exe ./mcp/server.cjs --stdio
These were all children of the Codex process tree.
Expected behavior
Codex should keep helper process count and memory bounded during normal Desktop usage.
In particular:
- Completed or closed subagents should not leave their MCP/Node REPL/helper processes alive indefinitely.
- MCP stdio servers should be reused or torn down after the owning session/tool/subagent completes.
- Idle helper processes should not accumulate until Windows becomes memory-constrained.
- Users should not need to restart Codex or manually kill Node processes to recover the machine.
Actual behavior
After Codex Desktop usage, Task Manager can show many retained Node/MCP/helper processes. Some of the Node processes remain idle while holding hundreds of MB to more than 1 GB each, creating enough memory pressure that the PC becomes unresponsive.
Suspected trigger
I do not have a minimal isolated reproduction yet. The issue seems correlated with normal Codex Desktop work that uses:
- multiple threads
- subagents
- MCP tools
- Node REPL/tool-backed sessions
Subagent-heavy work may make it worse, but I cannot confirm that it is the only cause.
Related reports
- #26327: Windows accumulates Node REPL/MCP/stdio app-server helper stacks during long multi-thread sessions
- #25015: app-server leaks MCP process stacks for subagents, causing linear memory growth on Linux
- #20883: project-scoped MCP process pool instead of per-session MCP
- #20349: duplicate MCP/helper process trees and multi-GB RSS during UI/debugging workflows
Diagnostic commands used
These PowerShell commands were used to inspect the live process state:
Get-Process node,node_repl -ErrorAction SilentlyContinue |
Select-Object Id,ProcessName,CPU,WorkingSet64,StartTime,Path |
Sort-Object WorkingSet64 -Descending |
Format-Table -AutoSize
Get-CimInstance Win32_Process |
Where-Object { $_.Name -in @('node.exe','node_repl.exe') } |
Select-Object ProcessId,ParentProcessId,Name,CreationDate,CommandLine |
Sort-Object CreationDate |
Format-List
$procInfo = Get-CimInstance Win32_Process |
Where-Object { $_.Name -in @('node.exe','node_repl.exe') -or $_.CommandLine -match 'Codex|codex|mcp|node_repl' }
$perf = @{}
Get-Process | ForEach-Object { $perf[$_.Id] = $_ }
$rows = foreach ($w in $procInfo) {
$p = $perf[[int]$w.ProcessId]
$cmd = [string]$w.CommandLine
$cat =
if ($cmd -match 'node_repl.exe') { 'node_repl' }
elseif ($cmd -match 'mcp/server\.cjs --stdio') { 'mcp_server_cjs' }
elseif ($cmd -match 'mcp/server\.mjs --stdio') { 'mcp_server_mjs' }
elseif ($cmd -match 'app-server') { 'codex_app_server' }
elseif ($w.Name -eq 'node.exe') { 'node_other' }
else { 'other_codex_related' }
[pscustomobject]@{
Category = $cat
Id = $w.ProcessId
PPid = $w.ParentProcessId
PrivateMB = if ($p) { [math]::Round($p.PrivateMemorySize64 / 1MB, 1) } else { 0 }
WorkingMB = if ($p) { [math]::Round($p.WorkingSet64 / 1MB, 1) } else { 0 }
Start = if ($p) { $p.StartTime } else { $null }
}
}
$rows |
Group-Object Category |
ForEach-Object {
[pscustomobject]@{
Category = $_.Name
Count = $_.Count
PrivateMB = [math]::Round(($_.Group | Measure-Object PrivateMB -Sum).Sum, 1)
WorkingMB = [math]::Round(($_.Group | Measure-Object WorkingMB -Sum).Sum, 1)
OldestStart = ($_.Group | Sort-Object Start | Select-Object -First 1).Start
}
} |
Sort-Object Category |
Format-Table -AutoSize
7 Comments
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
Helper processes should be owned by session/subagent ids and reconciled after terminal states.
When spawning Node/MCP helpers, record owner session id, child agent id if any, command, pid, started_at, last heartbeat, and expected shutdown condition. A periodic reconciler can reap helpers whose owner is completed/failed/cancelled and report leaked helpers in
doctor.---
_Generated with ax._
Matching evidence from a Windows 11 host, Codex Desktop, observed during a host-memory incident:
codex.exeapp-server process (the desktop app's own long-lived server, child of the ChatGPT desktop app process) had 175 childnode.exe/node_repl.exeprocesses, ~19 GB combined committed memory. No single child process was large — the mass was entirely in the count, invisible to a normal "top processes by memory" view../mcp/server.bundle.mjs,./mcp/server.cjs --stdio,./mcp/server.mjs,./mcp/server.mjs --stdio, plus one third-party MCP server's ownserver.js) — consistent with one full set spawned per session/thread and never reaped, not 175 distinct server types.taskkill /F /Ton the app-server PID) reaped all sidecars immediately, and the parent app (ChatGPT desktop) auto-respawned a clean app-server ~20 seconds later. Re-checked ~90 minutes later in the same session: the count had already climbed back to 110 children under a fresh app-server PID — so this isn't a one-time leak, it's continuous accumulation during normal use.taskkill /F /Tthat PID. No need to quit the parent ChatGPT app — it respawns a clean app-server automatically.Happy to share the exact process-tree snapshot (redacted) if useful for repro.
Additional reproduction: two peer threads coordinating one local tool-heavy workflow
I can reproduce the same class of issue on a substantially newer Windows Desktop build:
OpenAI.Codex_26.810.4967.0_x64__2p2nqsd0c76g0Trigger pattern
Two peer Codex threads were instructed to exchange findings and advance the same local ComfyUI video-generation test. Both threads repeatedly used local tools to inspect processes, submit or monitor jobs, check queue/history/logs, and validate outputs.
This created a feedback loop:
An audit of local rollout metadata after one Desktop start showed 282 top-level
execcalls in roughly 80 minutes across five threads:The four ComfyUI-related threads accounted for 258/282 calls (91.5%). The earliest rapid growth began when two benchmark threads were active concurrently.
Process evidence
During the incident I observed a peak of approximately:
node_repl.exeprocessescodex.exe%LOCALAPPDATA%\OpenAI\Codex\runtimes\cua_node\<hash>\bin\node_repl.exeThe important part was not the helpers' aggregate memory. Each helper had about 20 threads, so process/thread count and IPC/event-loop overhead grew substantially.
Creation-time correlation against rollout metadata linked surviving helpers to several active threads, but exact ownership was impossible because the process command line exposes no thread/session id.
Paging ruled out as the primary cause
After ComfyUI was idle:
Pages Output/secandPage Writes/secsamples were zeroDespite that, the Desktop UI remained noticeably sluggish. Fully exiting and reopening Codex immediately restored responsiveness and removed the helpers.
This suggests the primary problem is helper lifecycle/process-pool reclamation and missing global backpressure, not Windows paging or the external ComfyUI process.
Why this trigger may be useful
This case does not require hundreds of projects or one very large child process. A small number of peer threads coordinating the same local task can multiply top-level tool executions quickly. If helper creation is scoped per execution cell/thread and reclamation is delayed, the creation rate can exceed the reap rate.
Even if retaining these helpers is intentional for resumable execution, the resulting unbounded process/thread growth and UI degradation appear to be a product bug.
Suggested fixes / diagnostics
node_replpool bounded globally and per workspace/thread.codex doctoroutput that maps helper PID -> owner -> lifecycle state.As a local mitigation, I changed the workflow instructions to submit once and poll internally inside one bounded runner, resuming the same execution cell instead of creating a new top-level call for every status check. That reduces the trigger rate but does not fix helper reclamation in the Desktop runtime.
Additional reproducible evidence from Codex Desktop for Windows:
Environment
OpenAI.Codex_26.810.6296.0_x64__2p2nqsd0c76g0Reproduction and process lifecycle
I observed the Codex
app-serverprocess tree before and after successive tool calls.node_repl.exe.codex.exe app-server.In the first sample there were five retained waves, including five instances of each configured MCP server and five
node_repl.exehelpers. Cleanup terminated 42 leaked wrapper/runtime processes and recovered about 1 GB of available RAM.After disabling the three optional local MCP servers and cleaning up, those MCP processes no longer recurred. However,
node_repl.execontinued to accumulate. A later bounded retest found:node_repl.execount: 17A within-call “before/after” sample initially masked the leak because the new helper is created before the tool command begins. Comparing persistent counts and creation timestamps across calls exposed the one-per-call growth.
Configuration behavior
I attempted to disable the built-in helper using:
Codex later removed or ignored that setting. By contrast,
enabled = falsepersisted and worked for the three ordinary local MCP server entries. This suggests the Desktop-managednode_repllifecycle bypasses or overrides the normal MCP enablement path.Expected
node_repl.execount should remain bounded.Current mitigation
Targeted PID-based cleanup restores performance, but the helpers return with later tool calls. Disabling unrelated optional MCP servers reduces the impact but does not solve the Desktop-managed
node_replleak.This appears to narrow the trigger from general long-running/subagent use to the ChatGPT-style tool-session activation path on Windows.
Controlled reproduction: activation waves with partial cleanup
I reproduced this on Codex Desktop for Windows using package
26.810.6296.0on Windows x64 build26200.A process-tree snapshot during normal tool-heavy use showed:
node_repl.exehelpersControlled comparisons refined the trigger:
This confirms Codex-owned retention but does not support a strict “one new process for every individual command” rule. The evidence fits higher-level tool-host/session activation waves followed by partial, non-deterministic reclamation. Some cleanup exists, but it does not keep the population reliably bounded during regular use.
Suggested diagnostics/fix boundary:
This report intentionally omits user paths, process IDs, workspace/repository names, exact timestamps, runtime hashes, and command history.
Update: recurrence on 26.814.5167 with no other agents active
Additional evidence from a newer Codex Desktop build:
OpenAI.Codex_26.814.5167.0_x64__2p2nqsd0c76g0During a live slowdown investigation, the persistent
node_repl.exepopulation was initially 1, then later measured at 32:BelowNormalpriorityI terminated 31 stale helpers and temporarily retained the newest helper in case it belonged to the current tool runtime. Immediately afterward, two
node_repl.exeprocesses were present again. Because the user confirmed there were no other active agents, I terminated every remaining helper and verified:The foreground
codex.exeapp-server and its active code-mode host were left running.This recurrence reinforces that helper cleanup remains non-deterministic and is not reliably tied to whether other agents are active. It also shows that helpers may appear again during the same foreground diagnostic task immediately after targeted cleanup.
Important causality distinction
The peak system slowdown in this particular incident was not caused primarily by the 32 idle helpers. A separate agent-owned recursive
rg.exesearch was still running, which amplified Microsoft Defender and OneDrive activity:No Voice Chat process or activity was identified as the cause.
So this observation contains two separate lifecycle defects/risks:
node_repl.exepool still grows and respawns without a bounded, observable owner lifecycle, even when no other agents are active.Suggested diagnostic improvement remains: expose helper/child PID -> owning task/turn/tool call -> last-used time -> expected shutdown condition, and reap all agent-owned subprocesses when their operation reaches a terminal state.