[Bug] Interactive mode activates 0 plugin custom agents while --prompt activates 4
还没有人认领这个 Issue。
- 主要语言
- Shell
- 星标
- 11.2k
- 派生
- 1.9k
- 平均合并
- 14 小时 16 分钟
- 30 天内合并 PR
- 6
描述
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.
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
首先,跟踪记录的 “No model backend...” 消息和 “Plugin activation [agents]” 条目附近的交互式和 --prompt 启动路径,并比较自定义 agent 的加载时机。完成的标准是两种模式都激活相同的已安装 agent,保留 --agent 选择,并在 MCP 启动前应用所选 agent 的 MCP 作用域。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- shell
- 领域
- cli
- Issue 类型
- 缺陷
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 活跃度
- 活跃
- 描述清晰度
- 基本清楚
- 新手友好度
- 48/100