microsoft/autogen · error · ValueError

The number of participant topic types, agent types, and desc

Error message

The number of participant topic types, agent types, and descriptions must be the same.

What it means

The group chat manager requires participant_topic_types and participant_descriptions to be parallel lists of identical length — each participant needs exactly one topic and one description. Internally they are zipped with strict=True, so any length mismatch is rejected up front.

Source

Thrown at python/packages/autogen-agentchat/src/autogen_agentchat/teams/_group_chat/_base_group_chat_manager.py:64

        termination_condition: TerminationCondition | None,
        max_turns: int | None,
        message_factory: MessageFactory,
        emit_team_events: bool = False,
    ):
        super().__init__(
            description="Group chat manager",
            sequential_message_types=[
                GroupChatStart,
                GroupChatAgentResponse,
                GroupChatTeamResponse,
                GroupChatMessage,
                GroupChatReset,
            ],
        )
        if max_turns is not None and max_turns <= 0:
            raise ValueError("The maximum number of turns must be greater than 0.")
        if len(participant_topic_types) != len(participant_descriptions):
            raise ValueError("The number of participant topic types, agent types, and descriptions must be the same.")
        if len(set(participant_topic_types)) != len(participant_topic_types):
            raise ValueError("The participant topic types must be unique.")
        if group_topic_type in participant_topic_types:
            raise ValueError("The group topic type must not be in the participant topic types.")
        self._name = name
        self._group_topic_type = group_topic_type
        self._output_topic_type = output_topic_type
        self._participant_names = participant_names
        self._participant_name_to_topic_type = {
            name: topic_type for name, topic_type in zip(participant_names, participant_topic_types, strict=True)
        }
        self._participant_descriptions = participant_descriptions
        self._message_thread: List[BaseAgentEvent | BaseChatMessage] = []
        self._output_message_queue = output_message_queue
        self._termination_condition = termination_condition
        self._max_turns = max_turns
        self._current_turn = 0
        self._message_factory = message_factory

View on GitHub (pinned to 027ecf0a37)

Solutions

  1. Build descriptions from the participants themselves so lengths cannot diverge: [a.description for a in participants].
  2. Add or remove entries until both lists match, one per participant.
  3. Add an assertion before manager construction: assert len(topics) == len(descriptions).

Example fix

# before
manager = MyManager(
    participant_topic_types=topics,          # 3 entries
    participant_descriptions=descriptions,   # 2 entries -> ValueError
)

# after
manager = MyManager(
    participant_topic_types=topics,
    participant_descriptions=[a.description for a in participants],  # same length
)
Defensive patterns

Strategy: validation

Validate before calling

assert len(participant_topic_types) == len(participant_descriptions), (
    f"length mismatch: {len(participant_topic_types)} topics vs {len(participant_descriptions)} descriptions"
)

Prevention

When it happens

Trigger: Constructing a group chat manager (or a custom team/flow that instantiates one) where descriptions were built from a different source than the agents, leaving len(participant_descriptions) != len(participant_topic_types) — e.g. one agent added without a matching description string.

Common situations: Custom team subclasses or GraphFlow-style code that assembles the manager's arguments by hand; config-driven setups where the agents list and descriptions list drift out of sync.

Related errors


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