Skip to content

A session created with create_session can't be resumed after close_session if the user had switched to it #5386

Open

Description

@nima-ap

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

  1. Turn on session management tools (sessionManagementTools in ~/.copilot/settings.json). Our setup also had user extensions and one remote MCP server; we haven't tried without them.
  2. In session A, call create_session twice to make sessions B and C.
  3. Switch to B, then back to A. Don't switch to C.
  4. In A, call close_session for B and for C.
  5. Run /resume and pick B. It fails with the error above.
  6. Run /resume and 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

Activity

  1. added
    area:mcpMCP server configuration, discovery, connectivity, OAuth, policy, and registry
    area:sessionsSession management, resume, history, session picker, and session state
    on Nov 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:mcpMCP server configuration, discovery, connectivity, OAuth, policy, and registryarea:sessionsSession management, resume, history, session picker, and session state

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions