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):
- 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.
- Custom agents override builtins — Let users intentionally replace builtin agents with their own. This gives power users more control.
- Block conflicting names — Reject custom agents that collide with builtin names, with a clear error message suggesting a rename.
Context
Discovered via internal feedback.
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 viaisYamlBasedAgent(), so the builtin always takes precedence. No warning or error is surfaced — the conflict is silently ignored.Relevant code
src/agents/customAgents/builtinAgents.ts—CORE_YAML_AGENT_NAMESsrc/tools/taskTool.ts—isYamlBasedAgent()is checked beforeisUserAgent(), so builtin always winssrc/cli/hooks/useCustomAgents.ts— no conflict detection against builtin namesSuggested behavior
A few options (not mutually exclusive):
Context
Discovered via internal feedback.