Skip to content

Keep in-session /model and /mcp enable changes across /clear (per CLI process, not global) #5629

Backlog

Description

@saml

Describe the feature or problem you'd like to solve

/clear starts a completely new session, so in-session /model and /mcp enable changes are lost. The only way to keep them is to write global settings, which affects every other running Copilot process.

Current behavior (Copilot CLI 1.0.118, macOS):

  • /model <id> changes only the current session. After /clear, the model goes back to the settings, org or launch default.
  • /mcp enable <name> changes only the current session. It does not write ~/.copilot/settings.json, although the docs say it saves the choice in disabledMcpServers. After /clear, the server is disabled again.
  • --disable-mcp-server launch flags are re-applied on /clear, overriding an in-session /mcp enable.
  • The workarounds, /model --global and copilot mcp enable <name>, change the global settings. Every other running CLI process picks that up on its next /clear or launch.

Proposed solution

Treat model and MCP selection as state of the CLI process, separate from the conversation:

  1. On launch, use settings, policy and launch flags, as today.
  2. Within one CLI process, keep /model and /mcp enable/disable changes across /clear (and /new). /clear should reset the conversation, not the user's in-process choices.
  3. On exit and relaunch, go back to settings.
  4. Keep the explicit persistence paths, such as /model --global and a --global option for /mcp enable, for users who want a global change.

Example prompts or workflows

  1. Launch with all MCP servers disabled in settings. Run /mcp enable confluence, do some work, then /clear. confluence stays enabled in this window only. Restarting gives a clean slate.
  2. Launch with the org default model. Run /model claude-opus-5.5, then /clear. The new conversation still uses claude-opus-5.5. Other windows keep their own models.

Additional context

Repro for the MCP part:

  1. copilot mcp disable confluence
  2. Start copilot, then run /mcp enable confluence. /mcp shows it connected.
  3. ~/.copilot/settings.json is unchanged, and confluence is still in disabledMcpServers.
  4. Run /clear, then /mcp. confluence is disabled again.

Related: #5336

Activity

  1. added
    area:mcp
    area:models
    area:sessions
    on Dec 2, 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:mcparea:modelsarea:sessions

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions