Skip to content

bug: --config-dir does not isolate plugins (always reads root config.json) #3000

Description

@ericchansen

Summary

--config-dir does not fully redirect config.json reads. Plugins are always loaded from the default ~/.copilot/config.json, even when --config-dir points to a different directory with its own config.json. This means --config-dir cannot isolate plugins (or plugin-bundled MCP servers, skills, and agents).

Similarly, the activeProfile mechanism ("activeProfile": "<name>" in root config.json) only isolates session state, logs, and permissions — it does not redirect plugin or MCP server resolution at all.

Only COPILOT_HOME provides full isolation.

Reproduction

# Create a test profile directory with its own config
mkdir /tmp/copilot-test-profile

# Empty config.json — no plugins
echo '{"installedPlugins": []}' > /tmp/copilot-test-profile/config.json

# --config-dir: STILL shows root plugins (unexpected)
copilot --config-dir /tmp/copilot-test-profile plugin list
# Output: shows all plugins from ~/.copilot/config.json

# COPILOT_HOME: correctly isolated (expected)
COPILOT_HOME=/tmp/copilot-test-profile copilot plugin list
# Output: "No plugins installed."

MCP servers ARE redirected by --config-dir (reads mcp-config.json from the specified directory), making the inconsistency more confusing:

# No mcp-config.json in the test dir
copilot --config-dir /tmp/copilot-test-profile mcp list
# Output: "No MCP servers configured." (correct — isolated)

copilot --config-dir /tmp/copilot-test-profile plugin list
# Output: shows root plugins (incorrect — NOT isolated)

Observed behavior matrix

Resource activeProfile --config-dir COPILOT_HOME
Plugins root (not isolated) root (not isolated) isolated
MCP servers root (not isolated) isolated isolated
Sessions isolated isolated isolated
Permissions isolated unknown isolated

Expected behavior

--config-dir should fully redirect all config file reads — including config.json (and therefore plugins) — to the specified directory. This would make it consistent with COPILOT_HOME and enable proper profile isolation.

Alternatively, the activeProfile mechanism could be enhanced to support per-profile mcp-config.json, lsp-config.json, and settings.json files, giving profiles the same isolation level as COPILOT_HOME.

Use case

Users want to maintain multiple profiles with different tool sets (e.g., a "work" profile with Outlook/Teams/SharePoint MCP servers vs. a "dev" profile with only Playwright/LSP/coding tools). Today this requires COPILOT_HOME wrapper scripts rather than the more ergonomic --config-dir flag or native profiles.

Environment

  • CLI version: 1.0.36
  • OS: Windows 11
  • Shell: PowerShell

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:configurationConfig files, instruction files, settings, and environment variablesarea:pluginsPlugin system, marketplace, hooks, skills, extensions, and custom agents

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions