Skip to content

Agent name param (Agent Team, #4844) breaks the bundled /review skill — spawns fail "no active team", then the turn loops into a provider repetitive-call abort #5100

Description

@LaZzyMan

What happened?

Running /review <pr> --comment (seen with /review 5096 --comment) on an OpenAI-compatible / DashScope (Aliyun Bailian) backend fails before it produces any review:

  1. Step 4 of the bundled /review skill launches its 9 review agents in a single response (Agent 1 Correctness … Agent 7 Build & Test, with 6a/6b/6c personas).
  2. The model passes a name argument to every spawn (agent1-correctness, agent2-security, …).
  3. Every spawn fails immediately:
    Cannot spawn teammate "agent1-correctness": no active team.
    Use team_create to start a team first, or omit "name" to launch a one-shot subagent.
    
  4. The model correctly notes it should drop name ("I need to use one-shot subagents instead"), but instead of recovering it hallucinates that the never-started agents are "still running" / "standing by" and repeats the same tool call across consecutive rounds.
  5. The backend's repetitive-call guard then aborts the turn:
    [API Error: <400> InternalError.Algo.InvalidParameter: Repetitive tool calls detected
    in the conversation history. The same tool call with identical name and arguments has
    been repeated across multiple consecutive rounds. ...]
    

Net effect: /review is unusable in this configuration — it never produces a review and burns the whole turn into a hard API error.

What did you expect to happen?

/review should launch its review agents as ordinary one-shot subagents and complete the review. At minimum, passing name when no team is active should degrade gracefully to a one-shot subagent (treating name as a label, with a warning) instead of hard-failing every spawn and cascading into a provider-side abort.

Client information

Client Information

Found during development on main (around commit 64a1efb20), macOS. To reproduce against a clean build, run qwen then /about and paste here:

$ qwen /about
# paste output here

Login information

OpenAI-compatible / DashScope (Aliyun Bailian) backend.

Anything else we need to know?

Root cause — an inconsistency introduced by #4844 (Agent Team)

  • The Agent tool's name parameter is advertised in the schema unconditionally (packages/core/src/tools/agent/agent.ts, initialSchema, ~L543), described as "spawn as a named teammate … requires an active team context."
  • The team guidance that explains how to use it (call team_create first) is gated behind isAgentTeamEnabled() (~L622). So the visibility of the param and the guidance for using it correctly are out of sync.
  • Passing name with no active team is a hard error (~L1639-1654), not a fallback.
  • The bundled /review skill (packages/core/src/skills/bundled/review/SKILL.md, Step 4) gives every review agent a name/number and tells the model to launch them all "in a single response". The model maps those names onto the name param. The skill has zero awareness of teams (no team_create step, no mention of name), and "all in one response" is structurally incompatible with "team_create must come first in a prior turn".

So the model is invited to fill name — by the always-present param, and (when agentTeam is enabled) actively pushed by the team guidance, which explicitly says "if the user asks for agents to review each other's work, or produce a consolidated result — create a team." That is exactly what /review is. But nothing makes the model call team_create first, and the failure is fatal instead of recoverable.

Reproduction conditions

  • /review <pr> --comment (or any /review invocation that reaches the multi-agent Step 4).
  • Most reliable with experimental.agentTeam: true / QWEN_CODE_ENABLE_AGENT_TEAM=1 (the team guidance steers the model toward named teammates). Can also occur with the flag off, because the name param is always in the schema and the skill names its agents.
  • More likely on weaker models that do not self-recover from the per-call error.

Suggested directions (not prescriptive)

  1. Gate the name param's schema visibility behind isAgentTeamEnabled(), matching the team-guidance gate — so the param disappears when teams are off.
  2. When name is passed without an active team, fall back to a one-shot subagent + warning, instead of a hard error.
  3. Make /review team-aware (insert a team_create step when teams are enabled) or explicitly instruct it to use one-shot agents without name.
  4. Optional: a runtime circuit-breaker on N consecutive identical tool calls, so a degenerate loop fails fast locally instead of relying on the provider's guard.

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    category/toolsTool integration and executionpriority/P2Medium - Moderately impactful, noticeable problemroadmap/multi-agentRoadmap: Multi-agent collaborationroadmap/subagents-toolsRoadmap: Subagents and tool systemtype/bugSomething isn't working as expected

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions