[Bug] Plugin-scoped subagent definitions silently ignored in agent teams

Status Open
Reported on v2.1.211
Maintainer reply None cached
Activity 2 comments · opened Jul 16, 2026

Bug Description
Agent teams: plugin-scoped subagent definitions are silently ignored for teammates

The docs (Agent teams → "Use subagent definitions for teammates") say a teammate can spawn from a subagent definition in any scope — "project, user, plugin, or CLI-defined" — with the definition's body appended to its system prompt and its tools/model honored.

On v2.1.211, plugin-scoped definitions are silently dropped. The in-process teammate spawn resolves the type (activeAgents.find(H => H.agentType === s)) but then discards the result via a source filter (source !== "built-in" && source !== "plugin"). No error is surfaced — the teammate spawns as a vanilla session: tools ["*"], no appended body, no definition model. Project- and user-scoped definitions apply correctly.

Repro: spawn a teammate with subagent_type set to any plugin agent (myplugin:my-agent) → the teammate's subagents/agent-a<name>-*.meta.json has no customAgentType field, and with --debug the log shows [handleSpawnInProcess] agent_type=<type>, found=false. Repeat with a .claude/agents/ agent → customAgentType present, body/tools/model applied.

Expected: plugin scope works as documented — or the spawn fails loudly and the docs drop "plugin" from the supported scopes. The silent degradation is the damaging part: orchestration setups that keep worker procedures in plugin agent definitions break invisibly, and the workers improvise instead.

Environment Info

  • Platform: darwin
  • Terminal: tmux
  • Version: 2.1.211
  • Feedback ID: 96d7f07a-3b83-4f7c-97f0-d8a235b616d9

Errors

[{"error":"Error: 500 {\"type\":\"error\",\"error\":{\"type\":\"api_error\",\"message\":\"Internal server error\"},\"request_id\":\"req_011Cd6DfKiHpLWhhdVugEMzZ\"}\n    at generate (/$bunfs/root/src/entrypoints/cli.js:40:48330)\n    at makeRequest (/$bunfs/root/src/entrypoints/cli.js:80:7690)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-07-16T18:36:01.089Z"},{"error":"Error: 500 {\"type\":\"error\",\"error\":{\"type\":\"api_error\",\"message\":\"Internal server error\"},\"request_id\":\"req_011Cd6DfKHFLyTXUQaUBWSLv\"}\n    at generate (/$bunfs/root/src/entrypoints/cli.js:40:48330)\n    at makeRequest (/$bunfs/root/src/entrypoints/cli.js:80:7690)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-07-16T18:36:01.151Z"}]

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗