microsoft/autogen · error · RuntimeError

The group chat has not been initialized. It must be run befo

Error message

The group chat has not been initialized. It must be run before it can be resumed.

What it means

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.

Source

Thrown at python/packages/autogen-agentchat/src/autogen_agentchat/teams/_group_chat/_base_group_chat.py:734

        It calls the :meth:`~autogen_agentchat.base.ChatAgent.on_resume` method on each
        participant, and if the participant does not implement the method, it
        will be a no-op.

        .. note::

            It is the responsibility of the agent class to handle the resume
            and ensure that the agent continues from where it was paused.
            Make sure to implement the :meth:`~autogen_agentchat.agents.BaseChatAgent.on_resume`
            method in your agent class for custom resume behavior.

        Raises:
            RuntimeError: If the team has not been initialized. Exceptions from
                the participants when calling their implementations of :class:`~autogen_agentchat.base.ChatAgent.on_resume`
                method are propagated to this method and raised.

        """
        if not self._initialized:
            raise RuntimeError("The group chat has not been initialized. It must be run before it can be resumed.")

        # Send a resume message to all participants.
        for participant_topic_type in self._participant_topic_types:
            await self._runtime.send_message(
                GroupChatResume(),
                recipient=AgentId(type=participant_topic_type, key=self._team_id),
            )
        # Send a resume message to the group chat manager.
        await self._runtime.send_message(
            GroupChatResume(),
            recipient=AgentId(type=self._group_chat_manager_topic_type, key=self._team_id),
        )

    async def save_state(self) -> Mapping[str, Any]:
        """Save the state of the group chat team.

        The state is saved by calling the :meth:`~autogen_core.AgentRuntime.agent_save_state` method
        on each participant and the group chat manager with their internal agent ID.

View on GitHub (pinned to 027ecf0a37)

Solutions

  1. Initialize first: await team.load_state(saved_state) or perform one run, then resume().
  2. If resuming after a process restart, always restore state before calling resume().
  3. Disable/ignore resume until your session manager confirms the team has run.

Example fix

# before
team = RoundRobinGroupChat([agent])
await team.resume()  # RuntimeError

# after
team = RoundRobinGroupChat([agent])
await team.load_state(saved_state)  # initializes the runtime
await team.resume()
Defensive patterns

Strategy: validation

Validate before calling

if not getattr(team, "_initialized", False):
    await team.load_state(saved_state)  # initialize before resume
await team.resume()

Try / catch

try:
    await team.resume()
except RuntimeError as e:
    if "must be run" in str(e):
        pass  # never initialized, so nothing was paused
    else:
        raise

Prevention

When it happens

Trigger: Calling await team.resume() before any run()/run_stream()/load_state() has initialized the team.

Common situations: UI resume button pressed before a session started; orchestrator restart that reconstructs the team and immediately resumes without loading prior state.

Related errors


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