github / github/copilot-cli

Custom agent frontmatter: accept array for `model:` field

未关闭
#3,070 0 条评论 1 个 reaction 已指派 0 人 在 GitHub 查看
area:agents area:configuration area:models
主要语言
Shell
星标
11.2k
派生
1.9k
平均合并
14 小时 16 分钟
30 天内合并 PR
6

描述

### Feature request

Allow custom agent markdown frontmatter to accept an **array** of strings for the `model:` field, in addition to a single string.

### Motivation

VS Code chat modes already support `model:` as a list — it's used to present a model picker for the chat mode. This means the same agent definition file can't currently be shared cleanly between VS Code and Copilot CLI: the CLI rejects the file with:

`custom agent markdown frontmatter is malformed: model: Expected string, received array`

This forces plugin authors to either:

- Maintain two copies of every agent file (one for VS Code, one for CLI), or
- Pick one tool and accept that the agent won't load in the other.

### Proposed behavior

When `model:` is an array, the CLI uses the **first** entry as the default model for that agent (and ideally treats the rest as acceptable alternates the user can switch to with `/model` while invoking the agent). When `model:` is a string, behavior is unchanged.

### Alternatives considered

- Authors flatten `model:` to a single string — works in both, but loses the picker UX in VS Code.
- A local post-install patch script — fragile, breaks after every `plugin update`.

Accepting an array in the CLI parser is the only change that lets the same plugin work unmodified in both surfaces.

贡献指南

打开贡献指南

调研方向

首先定位 custom-agent 的 Markdown frontmatter 解析器以及对其 model 字段的验证。确认字符串行为保持不变,数组使用第一项作为默认值,并且格式错误的值仍然会失败;如果已有解析器测试,则添加或更新这些测试。

由索引模型根据 Issue 内容生成。

评估

技术栈
markdown, shell
领域
cli, tooling
Issue 类型
功能
难度
3/5
预计耗时
1-2 天
活跃度
冷清
描述清晰度
基本清楚
新手友好度
68/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。