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
MCP servers started for Codex subagents remain running after the subagent completes and close_agent succeeds #19092
What terminal emulator and version are you using (if applicable)?
No response
What issue are you seeing?
In Codex multi-agent mode, MCP server processes started for a subagent appear to remain alive after the subagent has completed and close_agent has successfully returned.
Observed behavior:
A subagent is spawned and initializes configured MCP servers, such as chrome-devtools-mcp, @playwright/mcp, tavily-mcp, etc.
The subagent finishes its task.
close_agent is called and returns a completed status.
The MCP server processes started around the subagent launch time are still running in the background.
These processes remain children of the parent Codex process rather than being cleaned up with the closed subagent.
This causes MCP processes to accumulate when multiple subagents are spawned concurrently. Over time, this can lead to unnecessary memory and process usage, browser/tooling contention, and confusing background state until the parent Codex process exits or the MCP processes are manually terminated.
What steps can reproduce the bug?
After a subagent is closed, its associated MCP servers and related configured resources should not remain as background residual processes.
What is the expected behavior?
When a subagent completes and is closed, any MCP servers or related resources that were started specifically for that subagent should be terminated or released, unless they are still actively shared by another live thread.
Activity
github-actions commentedon Apr 23, 2026
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action