Repository navigation
Description
Describe the bug
A session made with create_session, which the user has switched to and which another session then closes with close_session, can't be reopened in the same CLI process. /resume fails with:
Failed to switch session: Error: Failed to associate local session <id> with its built-in plugin host
Relaunching the CLI, or opening the session from a new CLI process, lets it reopen normally.
A created session that the user never switched to reopens normally after the same close. After the failed attempt, at a later switch between sessions, the CLI starts an MCP server process for the session that didn't open and leaves it running.
Affected version
GitHub Copilot CLI 1.0.108-1
Steps to reproduce the behavior
- Turn on session management tools (
sessionManagementToolsin~/.copilot/settings.json). Our setup also had user extensions and one remote MCP server; we haven't tried without them. - In session A, call
create_sessiontwice to make sessions B and C. - Switch to B, then back to A. Don't switch to C.
- In A, call
close_sessionfor B and for C. - Run
/resumeand pick B. It fails with the error above. - Run
/resumeand pick C. It opens.
When A closes B, the log shows Cleaning up session <B>: Session closed via sessions.close, then Failed to apply session management settings: Error: the Copilot SDK reported a failure: RPC error -32603: Request session.management.configure failed with message: The destination session is not available. Closing C logs only Closing session <C>.
Expected behavior
A session closed with close_session can be reopened with /resume whether or not the user had switched to it.
Additional context
- macOS on Apple silicon (arm64).
- Seen twice on 2026-11-08 with different sessions. Both times an MCP server process for the session that failed to reopen was still running afterward.
- Related: Extensions don't start for sessions created with
create_sessionuntil the user switches to them #5380 (created sessions start extensions only when the user switches to them) and Switching sessions in the Sessions sidebar leaks plugin MCP servers and extension hosts (OOM) #5164 (switching sessions leaks MCP servers and extension hosts).
Activity