github / github/copilot-cli

/clear and /restart breaks mcp integration

オープン
#4,772 コメント 0 件 リアクション 1 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

area:mcp area:sessions
主要言語
Shell
スター
11.2k
フォーク
1.9k
平均マージ
14時間 16分
マージ済み PR(30日)
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
  1. Start a session with MCP servers configured and working.
  2. Use MCP tools normally — confirm they work.
  3. Run /clear.
  4. Try to use an MCP tool — it fails / tools are unavailable.
  5. Run /restart — issue persists.
  6. Run /mcp reload — MCP tools work again.
  7. 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)

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

まず、ここで説明されている /clear、/restart、/mcp reload コマンドの処理と、プロセス内の MCP セッション/状態のライフサイクルを追跡します。これらの経路を新しい CLI の起動および関連する issue #4697 と比較します。/mcp reload を必要とせず、/clear と /restart の後も MCP ツールを利用できれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
shell
領域
cli
issue の種類
バグ
難易度
3/5
見積もり時間
1〜2日
活発さ
活発
明瞭さ
おおむね明確
初心者へのやさしさ
55/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。