/clear does not terminate previous stdio MCP server child processes (unlike /mcp reload )
Nessuno ha ancora preso questa issue.
- Lingua principale
- Shell
- Stelle
- 11.2k
- Fork
- 1.9k
- Merge medio
- 14h 16m
- PR unite (30g)
- 6
Descrizione
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
- Start a session with a stdio-based MCP server configured (e.g. a custom
*.exeMCP server). - Confirm the server process is running (e.g. via Task Manager /
Get-Process). - Run
/clear. - Observe: a new instance of the MCP server process starts, but the previous one is still running.
- Repeat
/clearmultiple times — orphaned process count grows unbounded. - 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
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Non vengono indicati file o test. Riproduci il problema su Windows con uno stdio MCP server, quindi traccia il reset della sessione di /clear insieme al percorso di pulizia del reload esistente di /mcp. Il lavoro è completato quando comandi /clear ripetuti non lasciano in esecuzione processi figlio MCP precedenti e il comportamento di reload esistente rimane invariato.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- shell
- Ambito
- cli, operating-systems
- Tipo di issue
- Bug
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Stato di attività
- Attiva
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 55/100