{"record":{"id":"0c45f66b191bbd03","repo":"microsoft/autogen","slug":"unhandled-message-in-group-chat-manager-type-mes","errorCode":null,"errorMessage":"Unhandled message in group chat manager: {type(message)}","messagePattern":"Unhandled message in group chat manager: (.+?)","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/packages/autogen-agentchat/src/autogen_agentchat/teams/_group_chat/_base_group_chat_manager.py","lineNumber":326,"sourceCode":"        This is called when the group chat manager have received all responses from the participants\n        for a turn and is ready to select the next speakers for the next turn.\n\n        Args:\n            thread: The message thread of the group chat.\n\n        Returns:\n            A list of topic types of the selected speakers.\n            If only one speaker is selected, a single string is returned instead of a list.\n        \"\"\"\n        ...\n\n    @abstractmethod\n    async def reset(self) -> None:\n        \"\"\"Reset the group chat manager.\"\"\"\n        ...\n\n    async def on_unhandled_message(self, message: Any, ctx: MessageContext) -> None:\n        raise ValueError(f\"Unhandled message in group chat manager: {type(message)}\")\n","sourceCodeStart":308,"sourceCodeEnd":327,"githubUrl":"https://github.com/microsoft/autogen/blob/027ecf0a379bcc1d09956d46d12d44a3ad9cee14/python/packages/autogen-agentchat/src/autogen_agentchat/teams/_group_chat/_base_group_chat_manager.py#L308-L327","documentation":"Raised by on_unhandled_message on the group chat manager when the runtime delivers a message whose type has no registered handler/subscription match. The manager only handles the internal GroupChat* protocol messages (plus types its subclass registers); anything else arriving on its topic triggers this ValueError. It usually indicates a message-routing or API-usage bug rather than a model problem.","triggerScenarios":"Publishing a custom or user message type directly to the group topic type instead of running it through team.run_stream()/run(); extending a manager subclass without registering a handler for a new internal message type; sending an agent's raw output event to the manager topic.","commonSituations":"Custom orchestration code that uses the low-level runtime alongside a team; version upgrades that add new GroupChat* message types while a serialized/handcrafted message is replayed; misconfigured topic subscriptions in a custom manager.","solutions":["Do not publish messages to the team's internal topics; pass tasks via Team.run() / run_stream() so the GroupChatStart protocol is used.","If you subclass a group chat manager and introduce new message types, add matching handlers and subscriptions (see SequentialRoutedAgent/routed agent registration).","Log type(message) and the topic it arrived on to find which publisher is misaddressing traffic."],"exampleFix":"// before\nawait runtime.publish_message(UserText(content=\"hi\"), DefaultTopicId(type=team_group_topic))  # wrong topic\n\n// after\nawait team.run(task=\"hi\")  # task enters via the public API","handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":"try:\n    await team.run(task=\"hello\")\nexcept ValueError as e:\n    if \"Unhandled message in group chat manager\" in str(e):\n        # a publisher sent a non-protocol type to the manager topic; fix routing\n        ...","preventionTips":["Never publish application messages to the team's internal topics; use Team.run/run_stream only.","When subclassing a manager, register a handler for every message type you introduce.","Keep autogen-core and autogen-agentchat versions in sync."],"tags":["group-chat","message-routing","runtime","api-misuse"],"backgroundTag":null,"analyzedSha":"027ecf0a379bcc1d09956d46d12d44a3ad9cee14","analyzedAt":"2026-08-15T03:38:00.719Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}