Agent tool: plugin-namespaced subagent_type silently ignored when a name is passed (agent teams)
Environment
- Claude Code 2.1.220, Linux (Fedora 44)
CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1,teammateMode: auto- Plugin: codex@openai-codex (repro'd on 1.0.1 and after updating to 1.0.6), which provides agent type
codex:codex-rescue
Bug
Calling the Agent tool with subagent_type: "codex:codex-rescue" works correctly without a name parameter, but when a name is passed (spawning a named teammate), the plugin agent definition is silently dropped: the harness spawns a generic teammate on the session model that has none of the plugin agent's system prompt, tool restrictions, or model setting, and simply receives the task prompt.
Side-by-side subagents/*.meta.json from the same session, same subagent_type:
- plain spawn:
{"agentType":"codex:codex-rescue", "spawnDepth":1}→ correct behavior (agent forwarded to the codex CLI as its definition instructs) - named spawn:
{"agentType":"<the name I passed>", "model":"claude-opus-5", "taskKind":"in_process_teammate", ...}— nocustomAgentType, plugin definition not applied
User-level agents from ~/.claude/agents/*.md resolve fine as named teammates (customAgentType is set). Only plugin-namespaced types are affected; across all sessions on this machine a plugin type has never resolved as a named teammate (0/N) while resolving 15/15 as plain spawns.
Impact
The failure is silent: the orchestrator believes the plugin agent ran. In our case a multi-model code-review pipeline dispatched review angles to codex:codex-rescue as named teammates; a generic Claude teammate performed the review itself, and the external-model attribution in the resulting report was wrong. A silent no-op here is indistinguishable from a clean run.
Expected
Either resolve plugin-namespaced agent types when a name is passed (as user-level agents are), or fail the Agent tool call loudly with an error — never silently substitute a generic agent.
Repro
- Enable agent teams; install any plugin that provides an agent type.
- Agent tool:
{subagent_type: "plugin:agent", prompt: "..."}→ works. - Agent tool:
{subagent_type: "plugin:agent", name: "probe", prompt: "..."}→ generic teammate, nocustomAgentTypein its meta.json.
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗