/clear and /restart breaks mcp integration
还没有人认领这个 Issue。
评估
调研方向
首先,跟踪此处描述的 /clear、/restart 和 /mcp reload 命令处理流程,以及进程内 MCP 会话/状态的生命周期。将这些路径与全新的 CLI 启动以及相关的 issue #4697 进行比较;完成标准是:在 /clear 和 /restart 之后,MCP 工具仍然可用,且不需要 /mcp reload。
由索引模型根据 Issue 内容生成。
描述
/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)
- 主要语言
- Shell
- 星标
- 11.2k
- 派生
- 1.9k
- 平均合并
- 14 小时 16 分钟
- 30 天内合并 PR
- 6
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
github/copilot-cli 的其他 Issue
-
triage
难度 2/5 1-3 小时 新手友好度 78/100
github/copilot-cli#4909 ·
-
triage
难度 2/5 1-3 小时 新手友好度 76/100
github/copilot-cli#4906 ·
-
triage
难度 2/5 1-3 小时 新手友好度 72/100
github/copilot-cli#4848 ·
-
area:agents area:mcp
难度 2/5 1-3 小时 新手友好度 72/100
github/copilot-cli#4729 ·
-
area:sessions
难度 2/5 1-3 小时 新手友好度 72/100
github/copilot-cli#4712 ·
查看 github/copilot-cli 的全部 Issue
相似的 Issue
-
难度 1/5 1 小时以内 新手友好度 92/100
-
难度 2/5 1-3 小时 新手友好度 78/100
community-scripts/ProxmoxVE#17425 · 1 条评论 ·
-
难度 2/5 1-3 小时 新手友好度 90/100
danielmiessler/LifeOS#2218 ·
-
agent-research-recommend agent-review-finding
难度 2/5 1-3 小时 新手友好度 82/100
jordansmall/spindrift#3714 · 1 条评论 ·
-
难度 2/5 1-3 小时 新手友好度 88/100
conda-forge/python-feedstock#934 ·