Skip to content

Stop/cancel becomes unresponsive when subagent MCP processes exhaust memory — Codex unrecoverable without killing processes externally #29057

Open

Description

@alanxchen85

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)

Observed

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)

  1. 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.)
  2. Reap dead MCP server processes when a subagent exits; cap or pool per-server instances.
  3. 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.
  4. Document whether spawned subagents inherit the cwd/global AGENTS.md instruction chain, and consider allowing a per-agent external instructions file.

Environment

  • Codex.app, macOS (Apple Silicon), 64 GB RAM.

Metadata

Metadata

Assignees

No one assigned

    Labels

    appIssues related to the Codex desktop appbugSomething isn't workingmcpIssues related to the use of model context protocol (MCP) serversperformancesubagentIssues involving subagents or multi-agent features

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions