You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Stop/cancel becomes unresponsive when subagent MCP processes exhaust memory — Codex unrecoverable without killing processes externally #29057
Primary bug: When a fleet of subagents accumulates enough MCP server processes to exhaust memory, the Stop control no longer interrupts the run. The app becomes unresponsive and the only recovery is killing processes from a terminal (kill -9 on the MCP children / the app-server). There is no in-app escape once the machine is under that memory/CPU pressure — which makes Codex effectively unusable for high-fan-out subagent work.
Root cause (what builds the pressure)
The built-in default subagent inherits the parent's full mcp_servers roster with no way to restrict it. The [agents] section only exposes max_threads, max_depth, job_max_runtime_seconds — no MCP scoping. Only user-defined custom agent files support an mcp_servers override.
One long-running session, on a single app-server process, accumulated:
212 × SkyComputerUseClient (built-in Computer Use — not an [mcp_servers] entry, so config can't disable it)
113 × npm exec @playwright/mcp@latest
93 × previewsmcp serve
78 × railway mcp
~13 each of ios-simulator-mcp, xcodebuildmcp, node_repl, bundled .server.{mjs,cjs,bundle}
Total: ~800+ node processes, ~16–27 GB RSS, with syspolicyd/trustd pegged from the trust-check churn of constant process spawns. Killing the children frees the RAM, but they rebuild to ~500 procs / ~16 GB in ~15 minutes as long as the app-server stays alive. The only reliable recovery was quitting Codex entirely.
Requests (priority order)
Stop/cancel must stay responsive under memory pressure. Interrupting a run should forcibly tear down spawned subagents and their MCP processes even when the system is starved — give the user an in-app recovery path. (Critical — this is what makes it unusable rather than merely wasteful.)
Reap dead MCP server processes when a subagent exits; cap or pool per-server instances.
Allow mcp_servers scoping on the built-in default agent (e.g. honor agents.default.config_file, or an [agents.default] mcp_servers key) so high-fan-out fleets don't each inherit the full roster.
Document whether spawned subagents inherit the cwd/global AGENTS.md instruction chain, and consider allowing a per-agent external instructions file.
Activity
github-actions commentedon Jun 19, 2026
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action