Agent tool: plugin-namespaced subagent_type silently ignored when a name is passed (agent teams)

Status Open
Reported on v2.1.220
Maintainer reply None cached
Activity 1 comment · opened Jul 27, 2026

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", ...} — no customAgentType, 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

  1. Enable agent teams; install any plugin that provides an agent type.
  2. Agent tool: {subagent_type: "plugin:agent", prompt: "..."} → works.
  3. Agent tool: {subagent_type: "plugin:agent", name: "probe", prompt: "..."} → generic teammate, no customAgentType in its meta.json.

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗