github / github/copilot-cli

Custom agents with builtin agent names are silently ignored

Ouverte
#1,528 1 commentaire 0 réactions 0 personnes assignées Voir sur GitHub
area:agents
Langage dominant
Shell
Étoiles
11.2k
Forks
1.9k
Merge moyen
14 h 16 min
PR mergées (30 j)
6

Description

## Problem

If a user creates a custom agent (e.g., `.github/agents/explore.md`) that shares a name with a builtin agent (`explore`, `task`, `code-review`, `general-purpose`), the custom agent loads successfully but **can never be invoked**. The task tool dispatch logic checks builtin agents first via `isYamlBasedAgent()`, so the builtin always takes precedence. No warning or error is surfaced — the conflict is silently ignored.

## Relevant code

- **Builtin agent names:** `src/agents/customAgents/builtinAgents.ts` — `CORE_YAML_AGENT_NAMES`
- **Agent dispatch:** `src/tools/taskTool.ts` — `isYamlBasedAgent()` is checked before `isUserAgent()`, so builtin always wins
- **Custom agent loading:** `src/cli/hooks/useCustomAgents.ts` — no conflict detection against builtin names

## Suggested behavior

A few options (not mutually exclusive):

1. **Warn at load time** — When a custom agent name collides with a builtin, log a warning so the user knows their agent will not be used.
2. **Custom agents override builtins** — Let users intentionally replace builtin agents with their own. This gives power users more control.
3. **Block conflicting names** — Reject custom agents that collide with builtin names, with a clear error message suggesting a rename.

## Context

Discovered via [internal feedback](https://teams.microsoft.com/l/message/19:3a10724f969043c3aab0d68a939500d1@thread.tacv2/1771437566145?tenantId=72f988bf-86f1-41af-91ab-2d7cd011db47&groupId=5f134ecd-5789-499a-b782-1f6f2dec34de&parentMessageId=1771198577918&teamName=GitHub%20Copilot%20at%20Microsoft&channelName=Copilot%20CLI&createdTime=1771437566145).

Guide de contribution

Ouvrir le guide de contribution

Piste de recherche

Read src/agents/customAgents/builtinAgents.ts, src/tools/taskTool.ts, and src/cli/hooks/useCustomAgents.ts to trace builtin-name registration, custom-agent loading, and dispatch precedence. Decide which collision behavior the project should adopt, then ensure a custom agent sharing a builtin name is no longer silently ignored and verify the relevant agent-loading and dispatch paths.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
typescript
Domaine
cli, developer-experience
Type d'issue
Bug
Difficulté
4/5
Temps estimé
3-5 jours
Activité
À l'abandon
Clarté
Plutôt claire
Accessibilité débutants
35/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.