Org-level custom agents ignore `model`; a model list drops the agent

未關閉
#5,585 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

評估

難度
3/5
預估耗時
1-2 天
新手友好度
67/100
Issue 類型
缺陷
描述清晰度
描述清楚
活躍度
活躍
技術堆疊
python
領域
ai, cli

研究方向

Start by tracing how the CLI reads custom agent frontmatter from org .github-private/agents/*.md and passes the API response into agent configuration; compare that path with repo .github/agents/. Check how model lists and model-policy are handled locally, including the behavior reported in #2133. Done means org agents use the configured model and policy, and a model list no longer causes the agent to disappear.

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

描述

area:agents area:models
Describe the bug

Org-level custom agents (agents/*.md in <org>/.github-private) ignore the model frontmatter field. The same file honours model when placed in .github/agents/ of the repo.

The API returns the model correctly, so it is dropped client-side:

GET https://api.githubcopilot.com/agents/swe/custom-agents/<org>/<repo>?exclude_invalid_config=true&include_sources=org,enterprise
→ { "name": "test-writer", ..., "model": "claude-haiku-5.5" }

Related: a model list (supported locally since v1.0.83, #2133) makes the server exclude the org agent as invalid, so it silently disappears (No such agent).

Reproduce
  1. Add to <org>/.github-private/agents/test-writer.md:
    ---
    name: test-writer
    description: Writes unit tests.
    model: claude-haiku-5.5
    model-policy: required
    ---
    
  2. In a clone of any repo in <org>, without a local copy of the agent:
    copilot -p "Reply: ready" --agent test-writer --output-format json
Agent source model used
.github/agents/ in the repo claude-haiku-5.5 ✅
org .github-private claude-sonnet-5.5 (session default) ❌
org, with model: [claude-haiku-5.5, gpt-6-luna] agent not loaded ❌

model-policy: required makes no difference for org agents.

Expected

Org agents honour model and model-policy like repo-level agents, and accept a model list.

Environment

Copilot CLI 1.0.116, Linux (Docker, node:24-slim), github.com

主要語言
Python
星號
11.5k
分支
2k
平均合併
6 小時 34 分鐘
30 天內合併 PR
3

環境準備

  • 沒有 Dockerfile 或 Docker Compose 檔案
  • 沒有 Pull Request 範本
  • 閱讀貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

github/copilot-cli 的其他 Issue

查看 github/copilot-cli 的全部 Issue

相似的 Issue

更多 Python Issue

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

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