microsoft/autogen · error · ValueError

At least one participant is required.

Error message

At least one participant is required.

What it means

BaseGroupChat's constructor requires at least one participant; an empty list means there is no agent to route messages to, so the team cannot function. This is a fail-fast validation at team construction time.

Source

Thrown at python/packages/autogen-agentchat/src/autogen_agentchat/teams/_group_chat/_base_group_chat.py:82

    component_type = "team"

    def __init__(
        self,
        name: str,
        description: str,
        participants: List[ChatAgent | Team],
        group_chat_manager_name: str,
        group_chat_manager_class: type[SequentialRoutedAgent],
        termination_condition: TerminationCondition | None = None,
        max_turns: int | None = None,
        runtime: AgentRuntime | None = None,
        custom_message_types: List[type[BaseAgentEvent | BaseChatMessage]] | None = None,
        emit_team_events: bool = False,
    ):
        self._name = name
        self._description = description
        if len(participants) == 0:
            raise ValueError("At least one participant is required.")
        if len(participants) != len(set(participant.name for participant in participants)):
            raise ValueError("The participant names must be unique.")
        self._participants = participants
        self._base_group_chat_manager_class = group_chat_manager_class
        self._termination_condition = termination_condition
        self._max_turns = max_turns
        self._message_factory = MessageFactory()
        if custom_message_types is not None:
            for message_type in custom_message_types:
                self._message_factory.register(message_type)

        for agent in participants:
            if isinstance(agent, ChatAgent):
                for message_type in agent.produced_message_types:
                    try:
                        is_registered = self._message_factory.is_registered(message_type)  # type: ignore[reportUnknownArgumentType]
                        if issubclass(message_type, StructuredMessage) and not is_registered:
                            self._message_factory.register(message_type)  # type: ignore[reportUnknownArgumentType]

View on GitHub (pinned to 027ecf0a37)

Solutions

  1. Pass at least one ChatAgent or Team: RoundRobinGroupChat([assistant]).
  2. If agents are generated dynamically, guard with `if not agents: raise/log` before constructing the team.
  3. Check the upstream config/filter that produced the empty list.

Example fix

# before
team = RoundRobinGroupChat(participants=agents)  # agents == []

# after
assert agents, "at least one agent is required"
team = RoundRobinGroupChat(participants=agents)
Defensive patterns

Strategy: validation

Validate before calling

if not participants:
    raise SystemExit("config error: no agents configured")
team = RoundRobinGroupChat(participants)

Prevention

When it happens

Trigger: Creating any group chat team (RoundRobinGroupChat, SelectorGroupChat, GraphFlow, etc.) with participants=[] — commonly when the list is built dynamically (e.g. agents filtered by a condition that matched nothing).

Common situations: Programmatically generated agent lists where a filter/config yields zero agents; misconfigured YAML/env-driven setups that produce an empty roster; refactor that moved agent creation after team construction.

Related errors


AI-assisted analysis of microsoft/autogen@027ecf0a37 (2026-08-15). Data as JSON: /api/errors/8e285ca778f1499c. Report an issue: GitHub.