github / github/copilot-cli

Custom agent `target` frontmatter property is documented for the CLI but has no effect

Đang mở
#4,806 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.

triage
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

The custom agents configuration reference documents a target property: "Target environment or context for the custom agent (vscode or github-copilot). If unset, defaults to both environments." That property table is scoped to "GitHub.com, the Copilot CLI, and supported IDEs (unless otherwise noted)," with no CLI exception noted for target.

In practice it has no effect. An agent declaring target: vscode is still loaded, still offered in the picker, and still runs.

This matters most for plugin-supplied agents, where a VS Code-only agent installed via a plugin appears in the picker with no way for the author to scope it out.

Affected version

GitHub Copilot CLI 1.0.84-4 (also reproduced on 1.0.84-3 and 1.0.83)

Steps to reproduce the behavior

No agent I could find in the wild sets target yet, so this needs a hand-written file to exercise the property.

  1. Create ~/.copilot/agents/vscode-only.agent.md:
---
name: vscode-only
description: Only intended for VS Code
target: vscode
---
You are a VS Code-only agent.
  1. Run copilot and open /agent. "vscode-only" is listed, with origin user.

  2. Select it, or run copilot --agent vscode-only. It loads and responds normally.

Removing the target line changes nothing about steps 2 and 3, so the property has no observable effect either way.

Expected behavior

An agent declaring target: vscode should not be offered or runnable in the CLI, since vscode and github-copilot are documented as distinct environments and omitting the property is what defaults to both.

If target is not intended to apply to the CLI, the reference should say so, since as written it reads as supported.

Additional context
  • Operating system: macOS 26.6.2
  • CPU architecture: arm64 (Apple silicon)
  • Shell: zsh

The same agent also appears in the GitHub Copilot desktop app's agent picker, so this is not CLI-only. The app caches its agent list, so a newly added agent file only appeared there after restarting the app — worth knowing when reproducing.

The case that prompted this: the awesome-copilot plugin ships meta-agentic-project-scaffold, a VS Code-specific agent, selectable in both the CLI and the desktop app. Filed on the content side as github/awesome-copilot#3017, but that fix depends on target taking effect here.

Related, though not duplicates — #1377 and #2133 both cover frontmatter fields that VS Code accepts but the CLI rejects. This one is the inverse: the field is accepted without complaint and simply does nothing.

Reference: https://docs.github.com/en/enterprise-cloud@latest/copilot/reference/custom-agents-configuration

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 vấn đề với tệp agent chỉ dành cho vscode đã được tài liệu hóa, sau đó lần theo quá trình phát hiện và tải agent tùy chỉnh xung quanh bộ chọn /agent và đường dẫn --agent. Được xem là hoàn tất khi một đích vscode bị loại khỏi bộ chọn CLI và không thể chạy ở đó, hoặc tài liệu tham chiếu nêu rõ rằng đích đó không được CLI hỗ trợ.

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

Đánh giá

Công nghệ
shell
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
Khá rõ ràng
Mức phù hợp với người mới
55/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.