github / github/copilot-cli

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

Abierto
#4,697 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

area:mcp area:sessions
Lenguaje dominante
Shell
Estrellas
11.2k
Forks
1.9k
Merge medio
14 h 16 min
PR fusionados (30 d)
6

Descripción

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

Guía de contribución

Abrir la guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Línea de trabajo

No se nombran archivos ni pruebas. Reproduce el problema en Windows con un stdio MCP server y, después, rastrea el restablecimiento de sesión de /clear junto con la ruta de limpieza de recarga existente de /mcp. Se considera terminado cuando los comandos /clear repetidos no dejan ejecutándose procesos hijo de MCP anteriores y el comportamiento de recarga existente permanece intacto.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
shell
Área
cli, operating-systems
Tipo de issue
Error
Dificultad
3/5
Tiempo estimado
1-2 días
Estado de actividad
Activo
Claridad
Bastante claro
Aptitud para principiantes
55/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.