Codex Subagents spawn tons of MCP instances - eating all the RAM

Yesterday I started using subagents in codex and then I saw multiple orpahned node processes (the chrome debugging mcp - forgot the name) and the gitea MCP (Gitea MCP - how to run codex like a pro - with local private code repo).

When killing them got the error from the running codex instance… (which makes sense I suppose)…

Even after changing the codex config toml in another vscode instance the other codex instance still seemed to have the config file cached…

So if you experience high RAM usage with subagents I guess a good workaround for now would be to add something like adding a prompt that tells the agents to remove orphaned mcp nodes after each run…

2 Likes

Another thing.. after an error message like this even when the codex agent run seems to start it doesn’t really start. You have to restart the IDE (on Ubuntu that is).