--agent <name> doesn't recognize custom agents loaded via --add-dir
まだ誰も着手していません。
- 主要言語
- Shell
- スター
- 11.2k
- フォーク
- 1.9k
- 平均マージ
- 14時間 16分
- マージ済み PR(30日)
- 6
説明
Describe the bug
Custom agents loaded from a directory passed via --add-dir are correctly discovered for task-tool delegation (they appear in the model's list of available sub-agents, and can be invoked by mentioning them by name in a prompt), but the top-level --agent flag does not recognize them. Passing --agent for an agent that only exists under an --add-dir -added directory's .github/agents/ fails with "No such agent", even when that agent's frontmatter sets user-invocable: true .
Affected version
GitHub Copilot CLI 1.0.83
Steps to reproduce the behavior
- Create a custom agent at /.github/agents/my-agent.agent.md with user-invocable: true in its frontmatter.
- Run:
copilot --add-dir <some-dir> -p "List every custom agent name available to you via the task tool." --allow-all-tools
→my-agentappears in the list, confirming--add-dirloaded it correctly. - Run:
copilot --add-dir <some-dir> --agent my-agent -p "hello" --allow-all-tools
→ Fails with:
No such agent: my-agent, available: <only agents registered through other mechanisms, e.g. plugins>
Expected behavior
--agent should be able to select any agent discovered via --add-dir 's .github/agents/ directory — the same set of agents already visible to/usable by the task tool in that same session — especially when the agent explicitly sets user-invocable: true .
Additional context
• Workaround: instead of --agent , invoke the agent by mentioning its name directly in the prompt, e.g. -p "use the my-agent agent to ..." . This reliably delegates to the correct agent via the task tool.
• OS: macOS
• Shell: bash
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
まず、frontmatter で user-invocable: true を設定した .github/agents/my-agent.agent.md ファイルを使い、--add-dir と --agent で動作を再現します。task tool がその agent を検出する方法と、トップレベルの --agent オプションが名前を検証する方法を比較します。--agent my-agent が「No such agent」エラーなしで同じカスタム agent を選択できれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 領域
- cli
- issue の種類
- バグ
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 活発さ
- 活発
- 明瞭さ
- 明確に書かれている
- 初心者へのやさしさ
- 68/100