github / github/copilot-cli

Support agent discovery from current working directory (nested .github/agents/)

Đang mở
#1,859 0 bình luận 8 reaction 0 người được giao Xem trên GitHub
area:agents
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ả

### Problem

When running `copilot` from a subdirectory that has its own `.github/agents/` folder (e.g., a monorepo with team-specific agent configs), only agents from the **git repo root's** `.github/agents/` are discovered. Agents defined in the cwd's `.github/agents/` are invisible to `/agent`.

### Use Case

In large monorepos, teams maintain specialized agents in subdirectories:

```
repo-root/
├── .github/agents/ ← these show up in /agent
│ ├── Bvt.agent.md
│ └── FleetUpgrade.agent.md
└── src/team-subfolder/
└── .github/agents/ ← these do NOT show up
└── my-custom-agent.agent.md
```

The CLI already respects cwd for `copilot-instructions.md` and instruction files. Agent files should follow the same pattern.

### Expected Behavior

Running `/agent` while cwd is `src/team-subfolder/` should show agents from **both**:
1. The git repo root `.github/agents/`
2. The cwd's `.github/agents/` (if different)

### Proposed Solution

Discover `.agent.md` files from both the git root and the current working directory's `.github/agents/`, similar to how custom instructions are resolved. If there are name conflicts, cwd agents could take precedence (or be prefixed with a path indicator).

### Environment

- Copilot CLI version: 0.0.421
- OS: Windows 11
- Shell: PowerShell 7

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

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

Đánh giá

Issue này chưa được đánh giá.

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.