{"record":{"id":"69f70a96a6240817","repo":"microsoft/autogen","slug":"the-group-chat-has-not-been-initialized-it-must-b-69f70a","errorCode":null,"errorMessage":"The group chat has not been initialized. It must be run before it can be resumed.","messagePattern":"The group chat has not been initialized\\. It must be run before it can be resumed\\.","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"python/packages/autogen-agentchat/src/autogen_agentchat/teams/_group_chat/_base_group_chat.py","lineNumber":734,"sourceCode":"        It calls the :meth:`~autogen_agentchat.base.ChatAgent.on_resume` method on each\n        participant, and if the participant does not implement the method, it\n        will be a no-op.\n\n        .. note::\n\n            It is the responsibility of the agent class to handle the resume\n            and ensure that the agent continues from where it was paused.\n            Make sure to implement the :meth:`~autogen_agentchat.agents.BaseChatAgent.on_resume`\n            method in your agent class for custom resume behavior.\n\n        Raises:\n            RuntimeError: If the team has not been initialized. Exceptions from\n                the participants when calling their implementations of :class:`~autogen_agentchat.base.ChatAgent.on_resume`\n                method are propagated to this method and raised.\n\n        \"\"\"\n        if not self._initialized:\n            raise RuntimeError(\"The group chat has not been initialized. It must be run before it can be resumed.\")\n\n        # Send a resume message to all participants.\n        for participant_topic_type in self._participant_topic_types:\n            await self._runtime.send_message(\n                GroupChatResume(),\n                recipient=AgentId(type=participant_topic_type, key=self._team_id),\n            )\n        # Send a resume message to the group chat manager.\n        await self._runtime.send_message(\n            GroupChatResume(),\n            recipient=AgentId(type=self._group_chat_manager_topic_type, key=self._team_id),\n        )\n\n    async def save_state(self) -> Mapping[str, Any]:\n        \"\"\"Save the state of the group chat team.\n\n        The state is saved by calling the :meth:`~autogen_core.AgentRuntime.agent_save_state` method\n        on each participant and the group chat manager with their internal agent ID.","sourceCodeStart":716,"sourceCodeEnd":752,"githubUrl":"https://github.com/microsoft/autogen/blob/027ecf0a379bcc1d09956d46d12d44a3ad9cee14/python/packages/autogen-agentchat/src/autogen_agentchat/teams/_group_chat/_base_group_chat.py#L716-L752","documentation":"resume() mirrors pause(): it sends GroupChatResume control messages and needs the runtime's agents registered via _init(), which only the first run performs. Resuming a team that was never initialized (hence never paused) is rejected with RuntimeError.","triggerScenarios":"Calling await team.resume() before any run()/run_stream()/load_state() has initialized the team.","commonSituations":"UI resume button pressed before a session started; orchestrator restart that reconstructs the team and immediately resumes without loading prior state.","solutions":["Initialize first: await team.load_state(saved_state) or perform one run, then resume().","If resuming after a process restart, always restore state before calling resume().","Disable/ignore resume until your session manager confirms the team has run."],"exampleFix":"# before\nteam = RoundRobinGroupChat([agent])\nawait team.resume()  # RuntimeError\n\n# after\nteam = RoundRobinGroupChat([agent])\nawait team.load_state(saved_state)  # initializes the runtime\nawait team.resume()","handlingStrategy":"validation","validationCode":"if not getattr(team, \"_initialized\", False):\n    await team.load_state(saved_state)  # initialize before resume\nawait team.resume()","typeGuard":null,"tryCatchPattern":"try:\n    await team.resume()\nexcept RuntimeError as e:\n    if \"must be run\" in str(e):\n        pass  # never initialized, so nothing was paused\n    else:\n        raise","preventionTips":["Persist team state before shutdown and call load_state on restart before resume().","Track paused/resumed state in your session manager, not by guesswork.","Only call resume() after a successful pause()."],"tags":["python","autogen","lifecycle","pause-resume"],"backgroundTag":null,"analyzedSha":"027ecf0a379bcc1d09956d46d12d44a3ad9cee14","analyzedAt":"2026-08-15T03:38:00.719Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}