{"record":{"id":"450819c7a3b8b649","repo":"microsoft/autogen","slug":"magenticoneorchestrator-does-not-support-groupchat","errorCode":null,"errorMessage":"MagenticOneOrchestrator does not support GroupChatTeamResponse messages.","messagePattern":"MagenticOneOrchestrator does not support GroupChatTeamResponse messages\\.","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"python/packages/autogen-agentchat/src/autogen_agentchat/teams/_group_chat/_magentic_one/_magentic_one_orchestrator.py","lineNumber":198,"sourceCode":"        )\n        response = await self._model_client.create(\n            self._get_compatible_context(planning_conversation), cancellation_token=ctx.cancellation_token\n        )\n\n        assert isinstance(response.content, str)\n        self._plan = response.content\n\n        # Kick things off\n        self._n_stalls = 0\n        await self._reenter_outer_loop(ctx.cancellation_token)\n\n    @event\n    async def handle_agent_response(  # type: ignore\n        self, message: GroupChatAgentResponse | GroupChatTeamResponse, ctx: MessageContext\n    ) -> None:  # type: ignore\n        try:\n            if not isinstance(message, GroupChatAgentResponse):\n                raise RuntimeError(\"MagenticOneOrchestrator does not support GroupChatTeamResponse messages.\")\n            delta: List[BaseAgentEvent | BaseChatMessage] = []\n            if message.response.inner_messages is not None:\n                for inner_message in message.response.inner_messages:\n                    delta.append(inner_message)\n            await self.update_message_thread([message.response.chat_message])\n            delta.append(message.response.chat_message)\n\n            if self._termination_condition is not None:\n                stop_message = await self._termination_condition(delta)\n                if stop_message is not None:\n                    # Reset the termination conditions.\n                    await self._termination_condition.reset()\n                    # Signal termination.\n                    await self._signal_termination(stop_message)\n                    return\n\n            await self._orchestrate_step(ctx.cancellation_token)\n        except Exception as e:","sourceCodeStart":180,"sourceCodeEnd":216,"githubUrl":"https://github.com/microsoft/autogen/blob/027ecf0a379bcc1d09956d46d12d44a3ad9cee14/python/packages/autogen-agentchat/src/autogen_agentchat/teams/_group_chat/_magentic_one/_magentic_one_orchestrator.py#L180-L216","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Remove nested teams from MagenticOne participants; only ChatAgent instances may participate (also enforced as TypeError at construction).","If you wrapped a team in a custom agent, make sure the wrapper publishes only GroupChatAgentResponse-shaped output via the standard team plumbing.","Inspect the subscription/topology: no participant should publish GroupChatTeamResponse to the MagenticOne group topic."],"exampleFix":"# before\n# a nested team re-publishing team responses into the group topic\nteam = MagenticOneGroupChat(participants=[wrapper_around_team, assistant], model_client=client)\n\n# after\nteam = MagenticOneGroupChat(participants=[assistant, coder, reviewer], model_client=client)","handlingStrategy":"validation","validationCode":"# Prevent by construction: only ChatAgent participants can emit GroupChatAgentResponse\nfrom autogen_agentchat.agents import ChatAgent\nassert all(isinstance(p, ChatAgent) for p in team._participants)","typeGuard":null,"tryCatchPattern":"try:\n    result = await team.run(task=task)\nexcept RuntimeError as e:\n    if \"GroupChatTeamResponse\" in str(e):\n        raise RuntimeError(\"Nested team publishing into MagenticOne group topic; flatten participants\") from e\n    raise","preventionTips":["Never route a Team's output topic into a MagenticOne group topic.","Keep MagenticOne participants to plain ChatAgents; wrap logic in agents, not teams."],"tags":["autogen","magentic-one","orchestrator","message-type","runtime-error"],"backgroundTag":null,"analyzedSha":"027ecf0a379bcc1d09956d46d12d44a3ad9cee14","analyzedAt":"2026-08-15T03:38:00.719Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}