[Bug] Interactive mode activates 0 plugin custom agents while --prompt activates 4
Nobody has claimed this yet.
- Dominant language
- Shell
- Stars
- 11.2k
- Forks
- 1.9k
- Avg merge
- 14h 16m
- Merged PRs (30d)
- 6
Description
Describe the bug
Copilot CLI interactive mode discovers installed plugins but activates zero plugin-contributed custom agents. The same installation and working directory successfully activate four custom agents in non-interactive --prompt mode.
When started interactively with a selected plugin agent, the UI briefly shows the selected agent, then clears it and reports:
Custom agent "<plugin>:<agent>" not found. Available agents: none
/agent then displays:
No custom agents found in this workspace yet.
The session continues as the default agent.
This has a secondary MCP impact: because the selected agent never loads, its mcp-servers: scoping block never applies. All user-global MCP servers start instead of the two bundled by the agent. In the reproduced environment this changed startup from 2 scoped servers to 20 enabled servers, producing authentication prompts and unrelated server failures.
Affected version
Reproduced on:
1.0.81-61.0.81-71.0.81-81.0.81-9
Primary evidence below is from 1.0.81-9 on Windows 11, x86_64, Windows Terminal, PowerShell 7.
Steps to reproduce the behavior
-
Install or load a Copilot CLI plugin that contributes a custom agent.
-
Confirm the agent works in prompt mode:
copilot --allow-all --agent <plugin>:<agent> --model claude-opus-5 --prompt "Reply OK" -
Start the same agent interactively from the same working directory:
copilot --allow-all --agent <plugin>:<agent> --model claude-opus-5 -
Observe that the agent is initially shown as selected, then clears within about one second.
-
Run
/agent. It reports no custom agents. -
Run
/mcp. User-global MCP servers are active rather than the selected agent's scoped MCP bundle.
Deterministic A/B from debug logs
Successful non-interactive process:
20:09:45.892 [INFO] Starting Copilot CLI: 1.0.81-9
20:09:46.658 [DEBUG] Plugin activation [agents]: ... plugins=6, loaded=4
Failed interactive process:
20:15:53.416 [INFO] Starting Copilot CLI: 1.0.81-9
20:15:53.628 [DEBUG] ... cli_ready
20:15:53.633 [INFO] Login status unknown
20:15:53.827 [DEBUG] Plugin activation [agents]: ... plugins=6, loaded=0
The interactive process declares ready and activates agents about 0.4 seconds after process start. The prompt process activates agents about 0.8 seconds after process start and loads all four.
Repeated interactive launches consistently produced:
Plugin activation [agents]: ... plugins=6, loaded=0
Repeated --prompt launches consistently produced:
Plugin activation [agents]: ... plugins=6, loaded=4
Expected behavior
Interactive and --prompt modes should activate the same installed plugin custom agents. --agent <plugin>:<agent> should remain selected in interactive mode, and the agent's mcp-servers: scoping should apply before MCP startup.
If agent activation must wait for model/backend initialization, interactive mode should delay activation or retry after initialization rather than permanently caching an empty agent list.
Additional context
The following variables were tested and did not change interactive loaded=0:
- Trusted versus untrusted working directory
- Main repository versus linked Git worktree
- Existing credential versus
copilot login --with-tokenrefresh COPILOT_GITHUB_TOKENpresent before child-process launch--plugin-dir <plugin-root>- Repository-local
.github/agents/<agent>.agent.md --add-dir <repository>- Removing the
enabledPluginssetting - CLI versions
1.0.81-6through1.0.81-9
A repository-local agent and --add-dir still hit the same early log line and then loaded no agents:
No model backend (auth, legacy provider, or BYOK registry) available, skipping custom agents load
Plugin activation [agents]: ... plugins=6, loaded=0
Refreshing the supported Copilot credential succeeded:
Signed in successfully as <user>
but the next interactive launch still emitted Login status unknown and loaded=0.
This does not appear to be the filename/frontmatter mismatch described in #2475. In this case the filename and frontmatter name match, and /agent lists zero custom agents rather than retaining filename-based entries.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing the interactive and --prompt startup paths around the logged “No model backend...” message and “Plugin activation [agents]” entries, comparing when custom agents load. Done means both modes activate the same installed agents, preserve --agent selection, and apply the selected agent’s MCP scoping before MCP startup.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- shell
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100