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.

貢獻指南

開啟貢獻指南

研究方向

Start by locating the custom-agent Markdown frontmatter parser and the validation for its model field. Verify that string behavior is unchanged, arrays use the first entry as the default, and malformed values still fail; add or update parser tests if present.

由索引模型根據 Issue 內容生成。

評估

技術堆疊
markdown, shell
領域
cli, tooling
Issue 類型
功能
難度
3/5
預估耗時
1-2 天
活躍度
冷清
描述清晰度
基本清楚
新手友好度
68/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。