github / github/copilot-cli

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

Đang mở
#4,697 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

area:mcp area:sessions
Ngôn ngữ chính
Shell
Star
11.2k
Fork
1.9k
Merge trung bình
14 giờ 16 phút
Pull request đã merge (30 ngày)
6

Mô tả

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

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Hướng nghiên cứu

Không có tệp hoặc test nào được nêu. Hãy tái hiện trên Windows với một stdio MCP server, sau đó lần theo việc reset session của /clear cùng với đường dẫn dọn dẹp reload hiện có của /mcp. Hoàn tất khi các lệnh /clear lặp lại không để các tiến trình con MCP trước đó tiếp tục chạy và hành vi reload hiện có vẫn được giữ nguyên.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
shell
Lĩnh vực
cli, operating-systems
Loại issue
Lỗi
Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức độ hoạt động
Sôi nổi
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
55/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.