/clear and /restart breaks mcp integration
还没有人认领这个 Issue。
- 主要语言
- Shell
- 星标
- 11.2k
- 派生
- 1.9k
- 平均合并
- 14 小时 16 分钟
- 30 天内合并 PR
- 6
描述
/clear and /restart leave MCP tools broken; only /mcp reload recovers them
Description
After running /clear (and also /restart), MCP tools stop working correctly in the new session. Restarting the CLI process from scratch (full exit + relaunch) works fine, so the issue is isolated to in-process session/state carryover — not the MCP server config itself. Running /mcp reload after /clear or /restart fixes it without needing a full process exit.
Steps to reproduce
- Start a session with MCP servers configured and working.
- Use MCP tools normally — confirm they work.
- Run /clear.
- Try to use an MCP tool — it fails / tools are unavailable.
- Run /restart — issue persists.
- Run /mcp reload — MCP tools work again.
- Alternatively, fully exit and relaunch the CLI — works fine on first try.
Expected behavior
/clear and /restart should leave MCP tools in the same working state as a fresh CLI launch, without requiring a manual /mcp reload.
Environment
- Copilot CLI version: 1.0.83
- OS: Linux
- Related: possibly same root cause as #4697 (/clear doesn't terminate previous stdio MCP server child processes)
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
首先,跟踪此处描述的 /clear、/restart 和 /mcp reload 命令处理流程,以及进程内 MCP 会话/状态的生命周期。将这些路径与全新的 CLI 启动以及相关的 issue #4697 进行比较;完成标准是:在 /clear 和 /restart 之后,MCP 工具仍然可用,且不需要 /mcp reload。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- shell
- 领域
- cli
- Issue 类型
- 缺陷
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 活跃度
- 活跃
- 描述清晰度
- 基本清楚
- 新手友好度
- 55/100