Custom agent `target` frontmatter property is documented for the CLI but has no effect
还没有人认领这个 Issue。
- 主要语言
- Shell
- 星标
- 11.2k
- 派生
- 1.9k
- 平均合并
- 14 小时 16 分钟
- 30 天内合并 PR
- 6
描述
Describe the bug
The custom agents configuration reference documents a target property: "Target environment or context for the custom agent (vscode or github-copilot). If unset, defaults to both environments." That property table is scoped to "GitHub.com, the Copilot CLI, and supported IDEs (unless otherwise noted)," with no CLI exception noted for target.
In practice it has no effect. An agent declaring target: vscode is still loaded, still offered in the picker, and still runs.
This matters most for plugin-supplied agents, where a VS Code-only agent installed via a plugin appears in the picker with no way for the author to scope it out.
Affected version
GitHub Copilot CLI 1.0.84-4 (also reproduced on 1.0.84-3 and 1.0.83)
Steps to reproduce the behavior
No agent I could find in the wild sets target yet, so this needs a hand-written file to exercise the property.
- Create
~/.copilot/agents/vscode-only.agent.md:
---
name: vscode-only
description: Only intended for VS Code
target: vscode
---
You are a VS Code-only agent.
-
Run
copilotand open/agent. "vscode-only" is listed, with originuser. -
Select it, or run
copilot --agent vscode-only. It loads and responds normally.
Removing the target line changes nothing about steps 2 and 3, so the property has no observable effect either way.
Expected behavior
An agent declaring target: vscode should not be offered or runnable in the CLI, since vscode and github-copilot are documented as distinct environments and omitting the property is what defaults to both.
If target is not intended to apply to the CLI, the reference should say so, since as written it reads as supported.
Additional context
- Operating system: macOS 26.6.2
- CPU architecture: arm64 (Apple silicon)
- Shell: zsh
The same agent also appears in the GitHub Copilot desktop app's agent picker, so this is not CLI-only. The app caches its agent list, so a newly added agent file only appeared there after restarting the app — worth knowing when reproducing.
The case that prompted this: the awesome-copilot plugin ships meta-agentic-project-scaffold, a VS Code-specific agent, selectable in both the CLI and the desktop app. Filed on the content side as github/awesome-copilot#3017, but that fix depends on target taking effect here.
Related, though not duplicates — #1377 and #2133 both cover frontmatter fields that VS Code accepts but the CLI rejects. This one is the inverse: the field is accepted without complaint and simply does nothing.
Reference: https://docs.github.com/en/enterprise-cloud@latest/copilot/reference/custom-agents-configuration
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
首先使用文档中说明的仅适用于 vscode 的 agent 文件重现该问题,然后跟踪 /agent 选择器和 --agent 路径周围的自定义 agent 发现与加载过程。完成的标准是:vscode 目标被排除在 CLI 选择器之外,无法在那里运行;或者参考文档明确说明该目标不受 CLI 支持。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- shell
- 领域
- cli
- Issue 类型
- 缺陷
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 活跃度
- 活跃
- 描述清晰度
- 基本清楚
- 新手友好度
- 55/100