github / github/copilot-cli

/clear  does not terminate previous stdio MCP server child processes (unlike  /mcp reload )

未关闭
#4,697 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

area:mcp area:sessions
主要语言
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

  1. Start a session with a stdio-based MCP server configured (e.g. a custom *.exe MCP server).
  2. Confirm the server process is running (e.g. via Task Manager / Get-Process).
  3. Run /clear.
  4. Observe: a new instance of the MCP server process starts, but the previous one is still running.
  5. Repeat /clear multiple times — orphaned process count grows unbounded.
  6. 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

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 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

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。