copilot-cli icon indicating copy to clipboard operation
copilot-cli copied to clipboard

Repository-level enabledPlugins in .github/copilot/settings.json is ignored in non-interactive (copilot -p) mode

Open RezaJooyandeh opened this issue 3 months ago • 3 comments

Describe the bug

Repository-level enabledPlugins in .github/copilot/settings.json is not applied in non-interactive prompt mode (copilot -p). The same override is applied correctly in interactive mode and by copilot plugins list, so the surfaces disagree.

Concretely: a marketplace plugin set to false at user level and true in a trusted repo's .github/copilot/settings.json is reported as enabled by copilot plugins list for that directory, loads in an interactive session started in that directory, but is silently absent from a copilot -p run in the same directory. There is no warning.

This is the same class of bug as #3345 (.github/hooks/*.json not loaded in -p) and #3088 (copilot plugin marketplace list ignoring repo-level overrides), both of which were fixed.

Affected version

1.0.81-0 (Windows, x86_64)

Steps to reproduce the behavior

Given two marketplace-backed plugins — example-plugin@example-marketplace and other-plugin@other-marketplace — and a trusted folder C:\repos\myrepo (present in trustedFolders in ~/.copilot/config.json):

  1. ~/.copilot/settings.json:

    {
      "enabledPlugins": {
        "other-plugin@other-marketplace": true,
        "example-plugin@example-marketplace": false
      }
    }
    
  2. C:\repos\myrepo\.github\copilot\settings.json:

    {
      "enabledPlugins": {
        "example-plugin@example-marketplace": true
      }
    }
    
  3. From C:\repos\myrepo, run copilot plugins list:

    example-plugin@example-marketplace is shown as enabled (✓) for this directory, and disabled for other directories. Correct.

  4. From C:\repos\myrepo, start an interactive session:

    Startup banner reads Loading: X instructions, 2 plugins, Y skills. The plugin is loaded. Correct.

  5. From C:\repos\myrepo, run copilot -p "Reply with exactly: PONG" with --log-level all:

    Plugin activation [skills]: fingerprint=legacy, plugins=1, loaded=Y
    

    Only other-plugin is loaded. example-plugin does not appear anywhere in the log, and its skills are absent from <available_skills>. This is the bug.

Note that the same -p run does log:

Loading repo hooks in prompt mode (folder is trusted or opt-in set)
Loading workspace MCP sources in prompt mode (folder is trusted or opt-in set)

so repo hooks and workspace MCP sources correctly honour folder trust in prompt mode — only enabledPlugins does not.

Expected behavior

In a trusted folder, copilot -p should apply repository-scoped enabledPlugins from .github/copilot/settings.json, consistent with interactive mode and with copilot plugins list.

At minimum, the two surfaces should agree: copilot plugins list should not report a plugin as enabled for a directory in which copilot -p will silently decline to load it.

Additional context

Root cause (from the 1.0.81-0 bundle). The two modes resolve the plugin set through different code paths:

  • Interactive builds a repository overlay in the UI layer and resolves with repositoryOverlay: { mode: "provided", enabledPlugins, trusted }.

  • Prompt mode computes its plugin list as, in effect:

    const installed = [...getEnabledInstalledPlugins(config.installedPlugins || [], settings.enabledPlugins), ...explicitPlugins];
    

    which calls the native configLoaderGetEnabledInstalledPlugins(installedPlugins, enabledPlugins, pluginDirOnly). That function receives no working directory, no repository overlay, and no trust parameter, so repository-scoped settings cannot reach it.

The session manager's own resolveSessionPluginActivation does use repositoryOverlay: { mode: "load", trust: { mode: "persisted" } }, but in prompt mode the plugin list has already been filtered before it is consulted.

Confirmation. Driving the native resolver (configResolveEffectivePlugins) directly with the two overlay modes, with everything else held constant:

repositoryOverlay resolved plugins in the repo directory
{ mode: "load", trust: { mode: "persisted" } } other-plugin@other-marketplace, example-plugin@example-marketplace
{ mode: "none" } other-plugin@other-marketplace

The observed -p behaviour (plugins=1) matches mode: "none" exactly.

Opt-in env vars. Prompt mode has GITHUB_COPILOT_PROMPT_MODE_REPO_HOOKS, GITHUB_COPILOT_PROMPT_MODE_WORKSPACE_MCP and GITHUB_COPILOT_PROMPT_MODE_EXTENSIONS, but there is no equivalent for plugins/settings, and COPILOT_ALLOW_ALL=true does not cover this path either. So there is no supported way to opt in.

Workaround. Passing the plugin explicitly bypasses the filter, since explicit plugins are appended after it:

copilot -p "..." --plugin-dir "C:\repos\myrepo\skills\example-plugin"

This raises the log line to plugins=2, loaded=Y. It requires hard-coding an absolute path per invocation, so it does not substitute for repo-scoped configuration.

Environment. Windows 11, x86_64, Windows Terminal, PowerShell 7. Reproduced with --log-level all. Not tested on macOS or Linux.

Related: #3345 (fixed, same pattern for repo hooks), #3088 / #3087 (fixed, same interactive-vs-CLI inconsistency), #3742 (repo enabledPlugins override not honoured from nested cwd), #3637 (per-session enabledPlugins overlay).

RezaJooyandeh avatar Aug 16 '26 08:08 RezaJooyandeh

هیچ کدوم حل نشده و تاوالان من نتونستم پول برداشت کنم تورو خدا کمکم کنید خیلی وضع مالیم خرابه

در تاریخ یکشنبه ۱۶ اوت ۲۰۲۶، ۱۱:۳۹ Reza Jooyandeh @.***> نوشت:

RezaJooyandeh created an issue (github/copilot-cli#4507) https://github.com/github/copilot-cli/issues/4507 Describe the bug

Repository-level enabledPlugins in .github/copilot/settings.json is not applied in non-interactive prompt mode (copilot -p). The same override is applied correctly in interactive mode and by copilot plugins list, so the surfaces disagree.

Concretely: a marketplace plugin set to false at user level and true in a trusted repo's .github/copilot/settings.json is reported as enabled by copilot plugins list for that directory, loads in an interactive session started in that directory, but is silently absent from a copilot -p run in the same directory. There is no warning.

This is the same class of bug as #3345 https://github.com/github/copilot-cli/issues/3345 (.github/hooks/*.json not loaded in -p) and #3088 https://github.com/github/copilot-cli/issues/3088 (copilot plugin marketplace list ignoring repo-level overrides), both of which were fixed. Affected version

1.0.81-0 (Windows, x86_64) Steps to reproduce the behavior

Given two marketplace-backed plugins — @.*** and @.*** — and a trusted folder C:\repos\myrepo (present in trustedFolders in ~/.copilot/config.json):

1.

~/.copilot/settings.json:

{ "enabledPlugins": { @.": true, @.": false } }

2.

C:\repos\myrepo.github\copilot\settings.json:

{ "enabledPlugins": { @.***": true } }

3.

From C:\repos\myrepo, run copilot plugins list:

@.*** is shown as enabled (✓) for this directory, and disabled for other directories. Correct.

4.

From C:\repos\myrepo, start an interactive session:

Startup banner reads Loading: X instructions, 2 plugins, Y skills. The plugin is loaded. Correct.

5.

From C:\repos\myrepo, run copilot -p "Reply with exactly: PONG" with --log-level all:

Plugin activation [skills]: fingerprint=legacy, plugins=1, loaded=Y

Only other-plugin is loaded. example-plugin does not appear anywhere in the log, and its skills are absent from <available_skills>. This is the bug.

Note that the same -p run does log:

Loading repo hooks in prompt mode (folder is trusted or opt-in set) Loading workspace MCP sources in prompt mode (folder is trusted or opt-in set)

so repo hooks and workspace MCP sources correctly honour folder trust in prompt mode — only enabledPlugins does not. Expected behavior

In a trusted folder, copilot -p should apply repository-scoped enabledPlugins from .github/copilot/settings.json, consistent with interactive mode and with copilot plugins list.

At minimum, the two surfaces should agree: copilot plugins list should not report a plugin as enabled for a directory in which copilot -p will silently decline to load it. Additional context

Root cause (from the 1.0.81-0 bundle). The two modes resolve the plugin set through different code paths:

-

Interactive builds a repository overlay in the UI layer and resolves with repositoryOverlay: { mode: "provided", enabledPlugins, trusted }.

Prompt mode computes its plugin list as, in effect:

const installed = [...getEnabledInstalledPlugins(config.installedPlugins || [], settings.enabledPlugins), ...explicitPlugins];

which calls the native configLoaderGetEnabledInstalledPlugins(installedPlugins, enabledPlugins, pluginDirOnly). That function receives no working directory, no repository overlay, and no trust parameter, so repository-scoped settings cannot reach it.

The session manager's own resolveSessionPluginActivation does use repositoryOverlay: { mode: "load", trust: { mode: "persisted" } }, but in prompt mode the plugin list has already been filtered before it is consulted.

Confirmation. Driving the native resolver (configResolveEffectivePlugins) directly with the two overlay modes, with everything else held constant: repositoryOverlay resolved plugins in the repo directory { mode: "load", trust: { mode: "persisted" } } @., @. { mode: "none" } @.***

The observed -p behaviour (plugins=1) matches mode: "none" exactly.

Opt-in env vars. Prompt mode has GITHUB_COPILOT_PROMPT_MODE_REPO_HOOKS, GITHUB_COPILOT_PROMPT_MODE_WORKSPACE_MCP and GITHUB_COPILOT_PROMPT_MODE_EXTENSIONS, but there is no equivalent for plugins/settings, and COPILOT_ALLOW_ALL=true does not cover this path either. So there is no supported way to opt in.

Workaround. Passing the plugin explicitly bypasses the filter, since explicit plugins are appended after it:

copilot -p "..." --plugin-dir "C:\repos\myrepo\skills\example-plugin"

This raises the log line to plugins=2, loaded=Y. It requires hard-coding an absolute path per invocation, so it does not substitute for repo-scoped configuration.

Environment. Windows 11, x86_64, Windows Terminal, PowerShell 7. Reproduced with --log-level all. Not tested on macOS or Linux.

Related: #3345 https://github.com/github/copilot-cli/issues/3345 (fixed, same pattern for repo hooks), #3088 https://github.com/github/copilot-cli/issues/3088 / #3087 https://github.com/github/copilot-cli/issues/3087 (fixed, same interactive-vs-CLI inconsistency), #3742 https://github.com/github/copilot-cli/issues/3742 (repo enabledPlugins override not honoured from nested cwd), #3637 https://github.com/github/copilot-cli/issues/3637 (per-session enabledPlugins overlay).

— Reply to this email directly, view it on GitHub https://github.com/github/copilot-cli/issues/4507?email_source=notifications&email_token=BMBZYCXAZWFTZLALQAKC2OT5KFT3VA5CNFSL4Z3JMQ5C6L3HNF2C22DVMIXUS43TOVSS6NJRGYZTGOBRGUZDHJTSMVQXG33OVJZXKYTTMNZGSYTFMSSWK5TFNZ2KYZTPN52GK4S7MNWGSY3L, or unsubscribe https://github.com/notifications/unsubscribe-auth/BMBZYCTWVP6L4PKV6D3J26T5KFT3VAVCNFSNUABFKJSXA33TNF2G64TZHM2TQNJYGYYDMNRUHNEXG43VMU5TKMJWGMZTQMJVGIZ2C5QC . You are receiving this because you are subscribed to this thread.Message ID: @.***>

Tak2121 avatar Aug 17 '26 06:08 Tak2121

Thanks for the report. We've shipped fixes in this area since this was filed (most recently in Copilot CLI v1.0.100), and we believe this may now be resolved. Could you retest on the latest release (Copilot CLI v1.0.103) and let us know whether you still see it? If we don't hear back in a couple of weeks, we may close this issue — you can always reopen it.

Triaged as part of a Copilot SDK backlog review, with help from GitHub Copilot.

patniko avatar Oct 26 '26 21:10 patniko

This appears to be resolved as of GitHub Copilot CLI v1.0.114. Please update to that release or a newer stable version. We're closing this as completed. If it still happens, please comment with your version and reproduction steps.

copilot-cli-bot[bot] avatar Nov 18 '26 10:11 copilot-cli-bot[bot]