github / github/copilot-cli

--agent <name>  doesn't recognize custom agents loaded via  --add-dir

Đang mở
#4,752 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

area:agents area:configuration
Ngôn ngữ chính
Shell
Star
11.2k
Fork
1.9k
Merge trung bình
14 giờ 16 phút
Pull request đã merge (30 ngày)
6

Mô tả

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
  1. Create a custom agent at  /.github/agents/my-agent.agent.md  with  user-invocable: true  in its frontmatter.
  2. Run:
    copilot --add-dir <some-dir> -p "List every custom agent name available to you via the task tool." --allow-all-tools
    my-agent appears in the list, confirming --add-dir loaded it correctly.
  3. 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

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Hướng nghiên cứu

Bắt đầu bằng cách tái hiện hành vi với --add-dir và --agent, sử dụng tệp .github/agents/my-agent.agent.md có frontmatter đặt user-invocable: true. So sánh cách task tool phát hiện agent đó với cách tùy chọn --agent cấp cao nhất xác thực tên. Được xem là hoàn tất khi --agent my-agent chọn cùng custom agent đó mà không gặp lỗi “No such agent”.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Lĩnh vực
cli
Loại issue
Lỗi
Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức độ hoạt động
Sôi nổi
Độ rõ ràng
Đặc tả rõ ràng
Mức phù hợp với người mới
68/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.