/clear does not terminate previous stdio MCP server child processes (unlike /mcp reload )
还没有人认领这个 Issue。
- 主要语言
- Shell
- 星标
- 11.2k
- 派生
- 1.9k
- 平均合并
- 14 小时 16 分钟
- 30 天内合并 PR
- 6
描述
Description
When reloading MCP servers with /mcp reload, the CLI correctly terminates the existing stdio MCP server child process before starting a new one. However, running /clear (start fresh session) spawns a new stdio MCP server process without terminating the previous session's MCP server process, leaking orphaned processes over time.
Steps to reproduce
- Start a session with a stdio-based MCP server configured (e.g. a custom
*.exeMCP server). - Confirm the server process is running (e.g. via Task Manager /
Get-Process). - Run
/clear. - Observe: a new instance of the MCP server process starts, but the previous one is still running.
- Repeat
/clearmultiple times — orphaned process count grows unbounded. - Contrast with
/mcp reload, which correctly stops the old process before starting the new one.
Expected behavior
/clear should terminate/clean up MCP server child processes from the previous session (or reuse them) before/while starting the new session's servers, matching the behavior of /mcp reload.
Actual behavior
Old MCP stdio server processes are left running indefinitely after /clear, accumulating over repeated use (observed 22+ orphaned exe instances in one session).
Environment
- Copilot CLI version: 1.0.82
- OS: Windows
- MCP server type: stdio-based custom MCP server
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
未指定任何文件或测试。在 Windows 上使用 stdio MCP server 重现问题,然后沿着现有的 /mcp reload 清理路径跟踪 /clear 的会话重置。完成标准是,重复执行 /clear 命令不会让之前的 MCP 子进程继续运行,并且现有的 reload 行为保持不变。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- shell
- 领域
- cli, operating-systems
- Issue 类型
- 缺陷
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 活跃度
- 活跃
- 描述清晰度
- 基本清楚
- 新手友好度
- 55/100