[Windows 26.818] MCP process-batch accumulation and incomplete cleanup still reproducible with 5 MCP servers
What version of the Codex App are you using (From “About Codex” dialog)?
OpenAI.Codex_26.818.8289.0
What subscription do you have?
Plus
What platform is your computer?
Microsoft Windows NT 10.0.26100.0, x64
What issue are you seeing?
Codex Desktop repeatedly launches complete or near-complete sets of configured stdio MCP servers during ordinary task activity. Older MCP process trees remain alive instead of being reclaimed, causing cmd.exe and node.exe processes and their memory usage to accumulate over the lifetime of the Desktop session.
The affected configuration contained five Node/npx-based MCP servers: Context7, Sequential Thinking, Memory, Playwright, and Chrome DevTools. Some were configured directly, while Playwright and Chrome DevTools were supplied by plugins, so the behavior does not appear specific to one MCP package.
The observed Windows process chain was:
codex.exe app-server
-> cmd.exe /c npx ...
-> npx.cmd
-> cmd.exe /d /s /c ...
-> node.exe
The child processes appeared in distinct start-time batches: one around 13:56 and several more around 15:56–15:59.
A process-tree snapshot attributable to the live Codex app-server contained approximately:
- 30
cmd.exeprocesses - 34
node.exeprocesses - ~3.7 GB combined working-set memory
The same MCP server names occurred repeatedly across the batches. Completing or closing the visible task did not reclaim the older process trees. The wrappers also caused visible cmd.exe console-window flashes on Windows.
Disabling MCP entries in config.toml did not terminate already-running children. A full Codex Desktop tray exit/restart was required before the reduced MCP configuration took effect.
What steps can reproduce the bug?
- Start Codex Desktop on Windows with multiple stdio MCP servers configured. In my case these included Context7, Sequential Thinking, Memory, Playwright, and Chrome DevTools.
- Use Codex Desktop normally across multiple tasks/session activity while leaving the Desktop app running.
- Inspect the process tree of the active
codex.exe app-serverin Task Manager or PowerShell. - Observe multiple start-time batches containing repeated instances of the same MCP servers under
cmd.exe/npx.cmd/node.exe. - Complete or close the visible Codex task and inspect the process tree again.
- The older MCP process trees remain alive rather than being reclaimed.
- Disable manually configured MCP entries in
config.toml. - Observe that already-running MCP children remain alive.
- Fully exit Codex Desktop from the system tray and restart it.
- The stale processes from the previous app-server generation are finally removed.
In my observed incident, the live app-server process tree accumulated approximately 30 cmd.exe processes and 34 node.exe processes, using about 3.7 GB of combined working-set memory.
What is the expected behavior?
Codex Desktop should keep the number of MCP server processes bounded.
When an MCP connection manager/runtime generation is replaced, the previous MCP server set should be shut down and the complete Windows process tree should be reaped, including cmd.exe-wrapped node.exe grandchildren.
Completing tasks or disabling MCP servers should not leave stale MCP process trees alive.
Background MCP wrappers should also launch without visible cmd.exe console windows.
Additional information
This appears closely related to #32797, #34614, and #38825.
I am filing this as a separate current-build reproduction because the same process-batch accumulation and incomplete cleanup behavior is still reproducible on the newer Codex Desktop package OpenAI.Codex_26.818.8289.0.
Unlike #32797, which reports a much larger MCP configuration, my affected setup contained only five Node/npx-based MCP servers (Context7, Sequential Thinking, Memory, Playwright, and Chrome DevTools). Despite the smaller configuration, the live Codex app-server process tree still accumulated approximately 30 cmd.exe processes and 34 node.exe processes, using about 3.7 GB of combined working-set memory.
The processes appeared in distinct start-time batches, with the same MCP server names recurring across batches. Completing the visible task did not reclaim the older process trees. Disabling MCP entries in config.toml also did not terminate already-running children; a full Codex Desktop tray exit/restart was required before the reduced configuration took effect.
The bundled Codex version observed from the Desktop process was 0.149.0-alpha.4.3. A separate codex executable exists on my PATH, but it is not the Desktop-bundled binary and was not used as the Desktop version reported above.
I can provide a fresh sanitized process snapshot containing PID, PPID, process name, sanitized command line, start time, and working-set memory if useful for identifying which app-server/runtime generation owns each stale MCP process tree.
I have intentionally not attached my full config.toml for security reasons.
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
- #39982
Powered by Codex Action
Thanks for the pointer to #39982.
For comparison, this reproduction was observed on Codex Desktop package
OpenAI.Codex_26.818.8289.0 on Windows. During ordinary task/session activity,
complete or near-complete sets of configured stdio MCP servers appeared in
distinct process start-time batches.
The observed Windows process chain was:
codex.exe app-server -> cmd.exe -> npx.cmd -> cmd.exe -> node.exe
The live app-server process tree contained approximately 30 cmd.exe processes
and 34 node.exe processes, with about 3.7 GB combined working-set memory,
while the affected configuration contained five Node/npx-based MCP servers.
Completing the visible task did not reclaim the older process trees. Disabling
MCP entries in config.toml also did not terminate already-running children.
The stale processes remained until a full Codex Desktop tray exit/restart.
Visible cmd.exe console flashes were also observed during MCP launches.
These are the observations from this Codex Desktop reproduction. I am adding them here so maintainers can compare the process lifecycle and teardown behavior with #39982 and determine whether they share the same underlying cause.
I can confirm the same MCP process-batch accumulation and incomplete cleanup on substantially newer Codex Desktop builds. It has reproduced repeatedly on four consecutive days and returned after a full desktop restart and version update. The visible end-user failure is:
App server request expired while queued
Environment
- Microsoft Windows 11 Pro, 64-bit
- Version
10.0.26200, Build26200 - 95.5 GiB physical RAM
- Codex Desktop Microsoft Store/MSIX package
- Current affected installation: Codex Desktop
26.901.6511.0with its embedded app-servercodex-cli 0.153.4 - Also reproduced with:
- Codex Desktop
26.901.2854.0/ embeddedcodex-cli 0.153.0 - Codex Desktop
26.901.4073.0/ embeddedcodex-cli 0.153.1 - Codex Desktop
26.901.5280.0/ embeddedcodex-cli 0.153.4
- Codex Desktop
- A separately installed
codex-cli 0.152.0is currently onPATH, but it is not the desktop-owned app-server process affected by these measurements. - Multiple chats and models were involved. The most recently selected model was displayed in Codex Desktop as
GPT 6 Astrawithxhighreasoning effort. The leak affects the shared desktop app-server across chats and does not appear specific to one model or conversation.
Issue
Codex Desktop repeatedly accumulates complete local MCP and app-tools process suites that are not terminated after the corresponding thread or tool activity has finished. After several hours, the desktop becomes slow or globally unresponsive across chats and requests eventually expire while queued.
Across repeated incidents, 22 to 33 near-identical MCP/app-tools start groups accumulated below the single desktop-owned Codex app-server process. The descendant tree reached 427 to 525 processes, approximately 72,000 to 106,000 handles, and approximately 4,500 to 5,400 Windows threads.
The persisted queue database was empty during the original incident, so the visible error appears to refer to an internal or transient app-server queue rather than the persisted queue.
Selectively terminating only older duplicated MCP/app-tools subtrees immediately reduced process, handle, thread, and memory counts. Codex Desktop and its app-server remained alive, and the UI continued working without a desktop restart. During the first confirmed recovery, all three concurrently running Codex sessions continued successfully afterwards.
The workaround is temporary. Complete suites accumulate again, including after a full desktop restart and a desktop version update. On 2026-09-06 the process tree grew back to 427 processes and 22 duplicated start groups within approximately 4 hours 24 minutes of a fresh desktop app-server start.
Reproduction pattern
This has reproduced repeatedly on four consecutive days:
- Start Codex Desktop on Windows with several globally configured MCP servers and Codex plugins available.
- Work in multiple normal chats and scheduled-task chats. Start or resume threads and perform tool calls over several hours.
- Observe the process tree below the desktop-owned
codex.exeapp-server process. New activity starts a broad suite of local MCP/app-tools child processes. - Continue using the app. Older suites remain alive instead of being reaped, and near-identical groups accumulate over time.
- Once hundreds of descendants and tens of thousands of handles have accumulated, Codex Desktop becomes slow or hangs across chats. Requests eventually fail with
App server request expired while queued. - Without stopping Codex Desktop or its app-server, terminate only the older duplicated MCP/app-tools subtrees while protecting the newest group, the desktop main process, the shared app-server, and the currently executing diagnostic process tree.
- Observe an immediate large reduction in descendants, handles, threads, and summed working set. Codex Desktop and active sessions continue without a restart.
- Continue using Codex Desktop. The duplicated process suites eventually accumulate again.
The exact accumulation rate depends on thread and tool activity. The consistently reproduced property is that old complete MCP/app-tools suites remain alive and accumulate below one long-running desktop app-server.
Expected behavior
Codex Desktop should reap MCP and plugin/app-tools child processes when their owning initialization, tool call, turn, or thread lifecycle no longer needs them. Starting or resuming additional chats must not leave complete older tool suites running indefinitely.
If an MCP startup fails, times out, or a child process does not exit normally, the app-server should terminate the abandoned subtree and release its handles. A problem in one MCP should not cause the shared desktop app-server to queue and expire unrelated requests across all chats.
Long-running Codex Desktop sessions should remain responsive without requiring periodic external process cleanup or a complete desktop restart.
Observed incident data
2026-09-03 — Desktop 26.901.2854.0 / embedded CLI 0.153.0
- 24 complete MCP process sets accumulated.
- The app-server descendant tree used approximately 17.5 GiB summed working set.
- 131 old Chrome DevTools MCP-related processes used approximately 4.4 GiB and 26,889 handles.
- After Chrome-only cleanup was insufficient, 406 additional old MCP-suite processes were targeted; 395 were explicitly stopped and the remainder exited with their parents.
- Codex Desktop recovered without a restart, and all three active sessions continued successfully.
2026-09-04 — Desktop 26.901.4073.0 / embedded CLI 0.153.1
- Approximately 30 to 32 repeated MCP/app-tools groups accumulated.
- Initial tree: 509 processes, approximately 14.7 GiB summed working set, 94,732 handles, and 5,126 threads.
- Repeated cleanup was partially neutralized by immediate respawning; 687 old processes were explicitly stopped during the incident while new suites continued to appear.
2026-09-05 — Desktop 26.901.5280.0 / embedded CLI 0.153.4
- First measurement: 25 start groups; 515 processes, approximately 17.0 GiB summed working set, 101,924 handles, and 5,366 threads.
- 487 old processes were stopped with zero stop failures. The same reporting thread stayed functional.
- Later the same day, the same app-server had accumulated 28 groups and 507 processes again.
- A second cleanup stopped another 487 old processes and reduced the tree from 507 to 20 processes.
2026-09-06 — Desktop 26.901.5280.0 / embedded CLI 0.153.4
- 33 start groups; 525 processes, approximately 15.6 GiB summed working set, 106,101 handles, and 5,373 threads.
- 500 old processes were stopped with zero stop failures.
- The tree dropped to 33 processes, approximately 2.6 GiB summed working set, 10,035 handles, and 478 threads.
2026-09-06 after desktop restart/update — Desktop 26.901.6511.0 / embedded CLI 0.153.4
- The fresh app-server had been running for approximately 4 hours 24 minutes.
- 22 duplicated start groups; 427 processes, approximately 13.5 GiB summed working set, 85,320 handles, and 4,531 threads.
- 389 old processes were stopped with zero stop failures.
- The tree dropped from 427 to 38 processes, approximately 3.7 GiB summed working set, 12,964 handles, and 557 threads.
- The app-server itself stayed alive and the reporting thread remained functional.
MCP configuration inventory at report preparation
- 20 MCP server definitions: 14 enabled and 6 disabled.
- Transport totals: 7 STDIO definitions and 13 HTTP definitions.
- Enabled STDIO categories: analytics, GitLab, Microsoft 365 mail, Node REPL, and one organization-specific automation server.
- Enabled HTTP categories: OpenAI developer documentation, notes, YouTrack, and six organization/customer-specific business tools whose names are redacted.
- Disabled definitions:
chrome-devtools,codex_data_exchanger,devexpress,gmail_mail,net, andquick_uploader. - The leak was observed across multiple MCP types and was not limited to Chrome DevTools. Disabling Chrome DevTools reduced one large subtree but did not resolve the repeated complete-suite accumulation.
- Full commands, arguments, URLs, HTTP headers, environment variables, and credentials are intentionally omitted.
Plugin inventory
The following 22 plugin package manifests were present in the local Codex plugin cache when this report was prepared. Cache presence does not prove that every package was enabled or invoked during an incident:
browser 26.901.51231chrome 26.901.51231codex-app-tools 0.1.3codex-security 0.1.23computer-use 26.901.51231deep-research-work 0.1.14documents 26.904.11930github 0.1.12-5f7cd798dc99gmail 0.1.10google-calendar 1.2.7openai-templates 0.1.1outlook-calendar 0.1.9outlook-email 0.1.8pdf 26.904.11930plugin-management 0.1.0presentations 26.904.11930sites 0.1.57spreadsheets 26.904.11930teams 0.1.9template-creator 26.904.11930unified-computer-use 26.901.51231visualize 1.0.29
The duplicated process groups contained Codex app-tools/plugin runtimes in addition to user-configured MCP processes. This is why I am including the cache inventory, while explicitly not claiming that every cached plugin was active.
Skill inventory
- Seven top-level personal/system skill directories were present.
- One personal skill was explicitly configured as disabled.
- Public/non-sensitive personal skill names include
chrome-devtools(disabled),frontend-design,m365-reply-defaults,playwright, andswitch-codex-account. One private workflow skill name is redacted. - Additional system and plugin-provided skills were available through the installed plugin packages.
- Skills appear to be passive instruction files and no standalone skill process was observed. They are included for completeness but are less likely to be the direct cause than the repeatedly orphaned MCP/app-tools process suites.
Other diagnostic observations
- The original investigation found 11 stale turns marked
inProgress, eight of them approximately 13 hours to 13 days old, and 63 open spawn edges. - A later incident found 12
inProgressturns and the same 63 open spawn edges. - The persistent queue contained zero entries during the measured incident.
- Active session files were 226.2 MiB initially and later 471.5 MiB; no active unpinned session exceeded the local 100 MiB recovery threshold.
- Archived sessions totalled approximately 36.3 GiB. This may be a secondary load factor but does not explain 22 to 33 near-identical live process suites.
- Sanitized logs contained MCP startup failures and repeated
timeout waiting for child process to exitevents near the visible queue timeout. - The machine still had tens of GiB of free physical memory, so complete system memory exhaustion was not required for the failure.
- No SQLite database, session file, archive, or global thread metadata was changed by the workaround.
- The guarded cleanup protected the Codex Desktop main process, the shared app-server, the newest recognized MCP start group, console hosts, and the currently executing diagnostic process tree.
Working hypothesis
This is an inference from the repeated local measurements: starting or resuming threads appears to initialize a broad MCP/plugin suite, and completed, failed, or timed-out suites are not consistently reaped. The resulting process and handle accumulation eventually blocks the shared desktop app-server. The empty persisted queue suggests that the visible queue timeout concerns a transient internal queue.
This looks like the same underlying lifecycle problem described in this issue, now confirmed across newer Desktop and embedded CLI versions, with both user MCP and Codex app-tools/plugin processes present in the leaked suites. It may also be related to #28361, but I am adding the evidence here instead of opening or cross-posting duplicate reports.
用途:作为现有 GitHub issue #40579 的补充评论,或通过 Codex / 反馈提交
相关问题:https://github.com/openai/codex/issues/40579
标题:Windows Codex Desktop 26.901.6511.0 still launches MCP stdio servers in visible cmd.exe windows
环境:
- Windows
- OpenAI.Codex 26.901.6511.0
- Native Windows sandbox: unelevated
- windows.sandbox_private_desktop = true
问题描述: 使用 Codex 桌面应用运行多个本地任务时,黑色控制台窗口会频繁闪现,有时连续出现两个。任务本身不应停止;期望 MCP 和工具继续正常运行但完全不显示控制台窗口。
已验证:
- sandbox_private_desktop 已生效,普通沙盒命令运行在 CodexSandboxDesktop-* 私有桌面。
- 弹窗附近捕获到由桌面应用直接创建的进程链: cmd.exe <- codex.exe <- ChatGPT.exe <- explorer.exe
- 对应命令行: cmd.exe /d /s /c call ./scripts/launch_codex_app_tools_mcp.cmd ./server.mjs
- 同期还存在本地 stdio MCP 的 python.exe 启动进程(aliyun-drive-mcp/run_pds_stdio.py),与偶发双窗口现象相符。
- 外部窗口隐藏器日志多次记录 transparent=False;事后隐藏也无法防止第一帧闪现。
期望行为: Codex 桌面应用启动、重启或重连所有 MCP stdio 服务器时不创建可见控制台窗口,同时保持 MCP 功能不变。
建议修复: Windows 客户端创建 MCP 子进程时使用 CREATE_NO_WINDOW 或等效的隐藏 STARTUPINFO;必须通过 .cmd 启动时,也请无窗口启动 cmd.exe。请同时覆盖内置 codex-app-tools MCP、用户配置的本地 stdio MCP,以及自动重连/重启路径。
补充说明: 用户不希望通过禁用 MCP、关闭插件或停止任务来规避该问题。
该问题在较新的 OpenAI.Codex 26.901.6511.0 上仍可复现;本机捕获到内置 codex-app-tools 通过 launch_codex_app_tools_mcp.cmd 启动,因此不仅影响手工配置的第三方 npx MCP。
Current Windows measurements for the process-batch / per-thread MCP footprint reported here, collected 2026-10-05. This adds evidence rather than opening a duplicate report.
Environment: desktop package OpenAI.Codex_26.930.3930.0_x64, desktop-bundled codex-cli 0.160.0, native Windows x64. The bundled executable was queried directly; the separate daemon binary is 0.157.1 and was excluded from the desktop process tree.
The first desktop-root snapshot contained 381 processes:
| Component | Count | Summed working sets, GiB |
|---|---|---|
| Node runtimes, including MCPs and npm launch wrappers | 128 | 9.10 |
| Desktop UI/browser processes | 11 | 1.95 |
| Console hosts | 133 | 0.98 |
| Desktop agent / execution servers | 2 | 0.98 |
| Command wrappers | 71 | 0.55 |
| Node REPL processes | 30 | 0.30 |
Repeated command families included 16 Playwright MCP workers plus 16 retained npx runtimes, 17 Hindsight coding-agent MCP workers, 16 Jerv MCP workers, and 14 computer-use REPL runtimes. Most directly or indirectly descended from the same live desktop app-server. Start-time batches extended from 08:59 through 13:25 local time.
Memory definitions matter: the first tree totaled 14.22 GiB summed working sets and 10.76 GiB private commit. A later sample had 350 processes, 11.97 GiB summed working sets, and 3.87 GiB exclusive resident working set. Summed working sets double-count shared pages. These measurements do not establish 15 GiB of exclusively occupied physical RAM or a monotonic leak.
App inventory initially showed five active chats and sixteen idle chats, plus four not-loaded chats. This is not a one-to-one process ownership map. Idle status alone is insufficient to identify a safe shutdown candidate.
Source inspection at rust-v0.160.0 found:
codex-rs/codex-mcp/src/connection_manager.rs:279-280,312-315: initialization iterates enabled MCP registrations; deferred startup depends onLazyWhenCachedand a previous manager.codex-rs/app-server/src/request_processors/thread_lifecycle.rs:56-61: unload eligibility requires both no subscribers and inactivity, then the grace delay. The official app-server documentation describes a 30-minute no-subscriber inactivity grace period.
The standalone Jerv MCP exits cleanly on idle stdin EOF in a controlled installed-binary probe. Hindsight's two parentless ingestion workers were intentionally detached, had live bank leases and operation polling, and were preserved. These checks do not support attributing this footprint to a Hindsight or Jerv idle-EOF leak.
The confirmed issue here is the large multiplied local-tool footprint. Whether any specific retained desktop-owned pool is abandoned remains unverified because the observed process inventory does not expose connection/subscriber ownership. A supported idle-pool release control and process-to-thread ownership diagnostics would enable safe cleanup without restarting live work. Lazy startup or safe shared runtimes could reduce the baseline footprint.
Related integration improvement filed separately: https://github.com/mutmutco/Jerv-Hub/issues/1912 (Windows direct launcher to avoid a retained shell per Jerv MCP worker). Grace-period reference: https://learn.chatgpt.com/docs/app-server#unsubscribe-from-a-loaded-thread.
No conversations were deleted or archived, and no active agent or MCP process was terminated during collection.
Are there any updates on this issue, or could someone from the team at least confirm that this is a known bug?
Every 4–6 hours, Codex Desktop becomes unresponsive. I then have to take a screenshot of my active threads, quit the app with Ctrl+Q, restart it, and use the screenshot to find and reopen each thread. In every thread, I have to manually ask: "Codex became unresponsive and had to be restarted. Please continue working."
Having to repeat this several times a day is very frustrating and keeps interrupting my work.
Still happening on Windows after updating to Codex 26.1013.4894.0 (Microsoft Store). About an hour of normal use led to 243 Codex-related processes: 211 node.exe (about 15 GB), 27 ChatGPT.exe (about 5 GB) and 4 codex.exe (about 2 GB). That's roughly 23 duplicate copies of each MCP server, plus 92 cua-repl/computer-use helpers, and they're never cleaned up when threads or subagents finish. Free RAM dropped to 2 GB of 32 GB. A full quit is the only thing that clears them. This didn't happen before the recent updates, even with many threads open. Settings: max_threads 16, computer use on.
Seeing the same on Windows 11 Pro, Codex Desktop 26.1013.3656.0 (bundled codex-cli 0.163.0-alpha.10.2).
After extended use across chats and subagents, repeated sets of code-review, codex-app-tools and cua-repl processes remained under the same app-server.
Measured on 2026-10-17, before and after restarting only Codex:
| Measurement | Before | After |
|---|---|---|
| Node.js processes | 113 | 4 |
| Node.js private commit | 6.12 GiB | 0.29 GiB |
| System committed memory | 43.74 GiB | 33.68 GiB |
| Available physical memory | 4.39 GiB | 10.90 GiB |
Follow-up: on my PC, restarting Codex does not clear this. Even after fully quitting and reopening, the duplicate helper processes come back right away. After one restart it relaunched about 177 helper processes using about 13 GB, with the CPU at 100%. It comes back after every restart, so I don't have a workaround. Windows 11, Codex 26.1013.4894.0 (Microsoft Store), 32 GB RAM.
Additional measurements on October 17, 2026, with Codex Desktop 26.1013.4894.0 / core 0.163.0-alpha.10.2: • 2:58 p.m. EDT: 177 Codex-related processes; 10.771 GiB private memory; 13.504 GiB summed working sets. • 4:01 p.m. EDT: 306 processes; 18.015 GiB private memory; 18.432 GiB summed working sets.
These were normal-use snapshots, not a controlled idle test, so they don’t establish the cause or prove every helper is abandoned. No configuration changes were made between these measurements by the monitoring task. Please advise on a supported diagnostic or workaround.
Windows desktop: growing stdio MCP process sets and memory exhaustion
Environment: Windows, 16 GB physical RAM. Desktop 26.1013.40934 build 20770, production channel; its updater returned up_to_date on 2026-10-18. Bundled Codex CLI reported 0.163.0-alpha.10.2.
Observed independently:
- Multiple launch groups of Python/Node stdio MCP processes under a live desktop app-server while working across conversations.
- 2026-10-18 00:04:47 Europe/Madrid: 2298 MB free RAM, 66 python.exe and 43 node.exe.
- 00:11:31: 674 MB free RAM, 86 python.exe and 58 node.exe, plus 24 node_repl.exe. These are machine-wide executable counts, not proof all are Codex-owned or orphaned; do not sum working sets as unique RAM.
- Earlier tree checks found matched MCP processes with live, older parents, so stale-parent orphan status was NOT established.
- A previous severe episode was reported by a separate local investigator as 762 descendants and about 20 GB, with 210 MB free RAM and commit 47.7/49.5 GB. Those historical numbers and attribution were NOT independently reproduced.
- The local workstation became difficult to use. The remote service was reported healthy; no remote restart is requested.
Narrow qualification:
- Our custom fixed-scope stdio bridge was started, initialized, then given EOF twice sequentially, without any business tool calls. Both tests exited 0 within 12 seconds, and both tested process trees were absent afterwards.
- This tests the adapter's EOF behavior, NOT whether the desktop closes its pipes or disposes loaded thread resources.
- No artificial high-concurrency reproduction was attempted because of memory pressure and active work.
Mitigation already applied, NOT claimed as a fix:
- Disabled optional eagerly-started local Windows, WhatsApp, legacy manual REPL and direct Odoo MCP configurations.
- Kept the two required fixed-scope remote bridges intact.
- Limited child-agent concurrency per session to one (not a global cap on primary conversations).
- Did not kill processes based on name, age, or inactivity, and did not cancel active work.
- No memory dumps, session transcripts, credentials, customer data, command lines, hostnames or raw logs are included.
Please investigate desktop/app-server ownership and disposal of per-thread MCP connections and Code Mode processes. Is retaining these sets after a completed turn expected while the desktop remains subscribed? Is there a supported bounded lifecycle/unload setting or a released fix? Completion of a turn may differ from thread unload; we need guidance that prevents unbounded accumulation without losing active work or adding a periodic process killer.
Expected: ordinary conversation reuse remains bounded and owned resources are released at the appropriate lifecycle boundary; active work remains intact. Actual: repeated launch groups and worsening memory pressure; precise leak site and causal attribution remain unproven.
Windows Desktop: repeated status requests eagerly launch independent MCP sets; scoped status reuses a live connection
Environment: Windows x64. Desktop package OpenAI.Codex 26.1021.2667.0, embedded codex-cli 0.164.0-alpha.11.1. Also reproduced using the signed executable from official package 26.1021.3705.0, which reports the same CLI version.
Minimal reproduction
Run the embedded app-server with a fresh, isolated CODEX_HOME containing a single installed local Pencil MCP registration. No plugins, chat messages, model requests, business-tool calls, third-party credentials, or deliberately failing servers are needed.
- Initialize the JSON-RPC app-server client.
- Send three mcpServerStatus/list requests with detail=toolsAndAuthOnly and serverName=pencil, without threadId.
- Observe three distinct Pencil process creations under that temporary app-server. All three replies successfully return five tools.
- In a separate identical run, create one ephemeral thread and include its threadId plus serverName=pencil in the same three status requests.
- Observe one Pencil process, reused for all three successful five-tool replies.
A 10 ms native Toolhelp32 observer was necessary because the unscoped temporary processes often exit before a 1-second WMI snapshot. This proves repeated creation, not indefinite leakage in this minimal case.
| Binary | Global/without threadId, 3 requests | Scoped with threadId + serverName, 3 requests |
|---|---|---|
| Desktop 26.1021.2667.0 executable | 3 process creations, 5 tools in each reply | 1 process, 5 tools in each reply |
| Official 26.1021.3705.0 executable | 3 process creations, 5 tools in each reply | 1 process, 5 tools in each reply |
Desktop caller inspection
The installed bundle contains multiple status-discovery paths:
- searchMcpContext sends a broad toolsAndAuthOnly request, then looks for codex_apps; it omits serverName=codex_apps.
- Both the main process and the webview contain this path.
- Catalog queries explicitly pass coalesce:false.
- The shared request helper keys in-flight coalescing by both options and params.
The candidate 26.1021.3705.0 bundle retains the same relevant call patterns.
Suggested correction
- Restrict Apps-only discovery to serverName=codex_apps.
- Use an existing thread's scoped status API for an individual server.
- Coalesce equivalent automatic catalog requests within the same account, connection, configuration and permission generation; preserve an explicit fresh refresh after configuration/authentication changes.
- Verify ownership and cleanup of temporary snapshots and loaded sessions separately. Do not indiscriminately pool stateful REPL or browser sessions with different permissions.
The current public app-server source has a dedicated scoped branch for threadId + serverName. The global branch calls collect_mcp_server_status_snapshot_with_detail, which creates a new eager connection set with previous=None and cancels it after collecting the snapshot.
This is related to #40579, but the minimal probe here does not claim every old Desktop-owned process is orphaned. On the affected 8 GB workstation, earlier broad discovery waves coincided with approximately 91–100% CPU and low available RAM. Those full-workstation measurements are not part of this isolated one-server test.
This comment intentionally omits private transcripts, local usernames and paths, tokens, environment values, complete command lines and account identifiers. The local reproduction harness can be sanitized before attachment.
Additional Windows reproduction observed on 2026-10-27 (Europe/Paris), with a newer desktop build.
Environment
- App-reported version: 26.1023.50603, build 22391, production channel.
- The app's built-in update check returned
up_to_dateduring the investigation. - The Windows package path of the running desktop executable contained
OpenAI.Codex_26.1023.6123.0_x64. - Multiple local chats/jobs were running. The investigation deliberately avoided restarting the app or interrupting those jobs.
- Both configured and plugin-provided stdio MCP servers were present, including Node-based helpers, VibePulse, and Codex Usage Pulse.
Direct observations
- The desktop-owned
codex.exe app-serverreceived repeatedthread/forkrequests. One attached client identified itself in the log as Codex Desktop 26.1013.40934; this differs from the app-reported version above. - The fork requests were followed by
session_init.mcp_manager_init/mcp.runtime.refresh/start_server_taskentries and distinct start-time batches of MCP subprocesses. - The process batches included
node.exe,node_repl.exe,python.exe,cmd.exelaunchers, andconhost.exe. Some plugin launchers add a second Python process. - Several ephemeral sessions subsequently logged all three completion indicators:
MCP processes from those batches remained alive after sampling finished.model_needs_follow_up=false has_pending_input=false needs_follow_up=false - Disabling the optional Codex Usage Pulse plugin in
config.tomlwas accepted by the CLI config reader. Already-loaded sessions continued starting the same helpers afterward. This change did not stop total process growth.
Measurements and intervention disclosure
These figures cover the desktop app's descendant process tree, rather than all Python/Node processes on the computer.
| Local time, 2026-10-27 | Processes | Summed working set (MiB) | Private committed memory (MiB) |
|---|---|---|---|
| 23:34 | 264 | 7652.3 | 5587.2 |
| 23:47, after temporary cleanup | 170 | 5900.6 | 5089.2 |
| Approximately 23:54 | 288 | approximately 8702 | approximately 6378 |
These are different memory metrics: summed working sets can count shared physical pages more than once, and private committed memory can include paged-out memory. They are not equivalent to Task Manager's private resident working-set figure.
A temporary local cleanup terminated 219 helper processes selected from completed, nonpersistent fork batches. Running local jobs continued reporting inProgress without reported errors afterward. A small, app-lifetime cleanup helper was also used. This is an intervention, not a clean minimal reproduction, and it did not provide a durable fix: process growth returned. The post-cleanup measurements should be interpreted with that intervention in mind.
What is established versus still uncertain
The repeated fork requests, per-fork MCP startup, process-batch start times, sampling completion flags, and subsequent process growth were directly observed.
The precise client-side reason for the repeated forks is not established. We also have not proved that every retained MCP manager is leaked rather than cached or waiting for its documented unload grace period. We understand that an unsubscribed thread can remain loaded for 30 minutes; the concern is the amount of subprocess and memory accumulation during repeated short-lived forks.
No packaged application files were changed, and no app restart was performed while the jobs were running.
Requested investigation
Please investigate whether temporary forks unnecessarily initialize full independent MCP server sets, whether those sets can be shared or started only when needed, and whether finished ephemeral forks can release their unused MCP subprocess trees promptly.
Any correction should preserve live tool calls, background terminals/builds, pending approvals, user-input requests, and ordinary active chat sessions.
This report contains the sanitized collected evidence. Full chat transcripts, credentials, full configuration files, and raw logs have intentionally been excluded.
Classic Windows cmd.exe -> npx -> node.exe orphan chain. When Codex reloads or disables an MCP entry, it drops the parent reference without killing the OS process tree, so every config reload adds another batch of processes to RAM.
As a practical workaround while this bug is open: instead of giving Codex raw stdio commands to spawn directly, throw your stdio servers into MCP-Bridge and point Codex at its single local HTTP endpoint. Bridge keeps each server inside a Windows Job Object, so disabling a server or switching presets kills the whole cmd.exe and node.exe tree at the OS level right away. Saved me a few gigabytes of leaked RAM on my machine.
I am seeing the same process-batch accumulation on Windows 10 22H2 (build 19045) on November 20, 2026. The installed Codex desktop package reports 26.1111.71704, and its running codex.exe app-server reports Codex CLI 0.169.1.
Process evidence. A PowerShell/CIM snapshot showed 87 direct children under one app-server after stopping the VRChat OSC processes. Identical command lines included 8 WPS Office MCP launchers, 7 Playwright MCP workers, 7 After Effects MCP workers, 6 ComfyUI MCP workers, and 6 OBS MCP workers. Across several tools, the same start-time batches recur around 11:17:38–39, 11:36:10–16, 11:36:24, and 11:36:43–44 local time. The local logs contain thread/resume shell-snapshot entries within a second of several batches. This is a timestamp correlation. I have yet to map individual workers to threads or isolate the exact trigger.
Memory after cleanup. With all VRChat OSC workers gone, the ChatGPT process tree still had 235 processes and 4,354 MiB of private working set. That includes about 1,330 MiB in 50 Python processes, 854 MiB in 40 Node processes, 493 MiB in 86 console hosts, 1,144 MiB in the Desktop UI processes, and 387 MiB in the Codex app-server. The same sample summed to 7,794 MiB of total working sets, which can count shared pages multiple times.
Impact. One configured VRChat OSC MCP entry had eight parent instances by the time I intervened. Three of their relay children together reached about 11.1 GiB of summed working set in an earlier snapshot. After terminating those MCP parents and relay children, the multi-GiB Node processes disappeared. The other duplicate MCP batches were still present. The relay's memory growth is an additional symptom with a root cause still under investigation.
Could the Windows app-server team check the lifetime of stdio MCP workers across thread resumes and whether a resumed thread reuses or releases its earlier workers?
👆its from codex btw