microsoft/autogen · error · RuntimeError

MagenticOneOrchestrator does not support GroupChatTeamRespon

Error message

MagenticOneOrchestrator does not support GroupChatTeamResponse messages.

What it means

MagenticOneOrchestrator.handle_agent_response raises RuntimeError when it receives a GroupChatTeamResponse instead of a GroupChatAgentResponse. The MagenticOne ledger loop can only reason about single-agent responses; a nested team publishing into the group topic produces a message type the orchestrator cannot process.

Source

Thrown at python/packages/autogen-agentchat/src/autogen_agentchat/teams/_group_chat/_magentic_one/_magentic_one_orchestrator.py:198

        )
        response = await self._model_client.create(
            self._get_compatible_context(planning_conversation), cancellation_token=ctx.cancellation_token
        )

        assert isinstance(response.content, str)
        self._plan = response.content

        # Kick things off
        self._n_stalls = 0
        await self._reenter_outer_loop(ctx.cancellation_token)

    @event
    async def handle_agent_response(  # type: ignore
        self, message: GroupChatAgentResponse | GroupChatTeamResponse, ctx: MessageContext
    ) -> None:  # type: ignore
        try:
            if not isinstance(message, GroupChatAgentResponse):
                raise RuntimeError("MagenticOneOrchestrator does not support GroupChatTeamResponse messages.")
            delta: List[BaseAgentEvent | BaseChatMessage] = []
            if message.response.inner_messages is not None:
                for inner_message in message.response.inner_messages:
                    delta.append(inner_message)
            await self.update_message_thread([message.response.chat_message])
            delta.append(message.response.chat_message)

            if self._termination_condition is not None:
                stop_message = await self._termination_condition(delta)
                if stop_message is not None:
                    # Reset the termination conditions.
                    await self._termination_condition.reset()
                    # Signal termination.
                    await self._signal_termination(stop_message)
                    return

            await self._orchestrate_step(ctx.cancellation_token)
        except Exception as e:

View on GitHub (pinned to 027ecf0a37)

Solutions

  1. Remove nested teams from MagenticOne participants; only ChatAgent instances may participate (also enforced as TypeError at construction).
  2. If you wrapped a team in a custom agent, make sure the wrapper publishes only GroupChatAgentResponse-shaped output via the standard team plumbing.
  3. Inspect the subscription/topology: no participant should publish GroupChatTeamResponse to the MagenticOne group topic.

Example fix

# before
# a nested team re-publishing team responses into the group topic
team = MagenticOneGroupChat(participants=[wrapper_around_team, assistant], model_client=client)

# after
team = MagenticOneGroupChat(participants=[assistant, coder, reviewer], model_client=client)
Defensive patterns

Strategy: validation

Validate before calling

# Prevent by construction: only ChatAgent participants can emit GroupChatAgentResponse
from autogen_agentchat.agents import ChatAgent
assert all(isinstance(p, ChatAgent) for p in team._participants)

Try / catch

try:
    result = await team.run(task=task)
except RuntimeError as e:
    if "GroupChatTeamResponse" in str(e):
        raise RuntimeError("Nested team publishing into MagenticOne group topic; flatten participants") from e
    raise

Prevention

When it happens

Trigger: A participant inside MagenticOneGroupChat is (or wraps) a Team whose responses are re-published as GroupChatTeamResponse on the group topic; wiring a team's output topic into the orchestrator's group topic type.

Common situations: Custom runtime/topic wiring that lets a sub-team broadcast into the MagenticOne group chat; using a middleware or handoff wrapper that forwards team-level responses.

Related errors


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