{"record":{"id":"f5c1c6b41e2d1fc2","repo":"microsoft/autogen","slug":"agent-state-for-self-group-chat-manager-name-no","errorCode":null,"errorMessage":"Agent state for {self._group_chat_manager_name} not found in the saved state.","messagePattern":"Agent state for (.+?) not found in the saved state\\.","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/packages/autogen-agentchat/src/autogen_agentchat/teams/_group_chat/_base_group_chat.py","lineNumber":823,"sourceCode":"        if not self._initialized:\n            await self._init(self._runtime)\n\n        if self._is_running:\n            raise RuntimeError(\"The team cannot be loaded while it is running.\")\n        self._is_running = True\n\n        try:\n            team_state = TeamState.model_validate(state)\n            # Load the state of all participants.\n            for name, agent_type in zip(self._participant_names, self._participant_topic_types, strict=True):\n                agent_id = AgentId(type=agent_type, key=self._team_id)\n                if name not in team_state.agent_states:\n                    raise ValueError(f\"Agent state for {name} not found in the saved state.\")\n                await self._runtime.agent_load_state(agent_id, team_state.agent_states[name])\n            # Load the state of the group chat manager.\n            agent_id = AgentId(type=self._group_chat_manager_topic_type, key=self._team_id)\n            if self._group_chat_manager_name not in team_state.agent_states:\n                raise ValueError(f\"Agent state for {self._group_chat_manager_name} not found in the saved state.\")\n            await self._runtime.agent_load_state(agent_id, team_state.agent_states[self._group_chat_manager_name])\n\n        except ValidationError as e:\n            raise ValueError(\n                \"Invalid state format. The expected state format has changed since v0.4.9. \"\n                \"Please read the release note on GitHub.\"\n            ) from e\n\n        finally:\n            # Indicate that the team is no longer running.\n            self._is_running = False\n","sourceCodeStart":805,"sourceCodeEnd":835,"githubUrl":"https://github.com/microsoft/autogen/blob/027ecf0a379bcc1d09956d46d12d44a3ad9cee14/python/packages/autogen-agentchat/src/autogen_agentchat/teams/_group_chat/_base_group_chat.py#L805-L835","documentation":"After participant states are loaded, load_state() also requires an entry for the group chat manager itself (named e.g. 'group_chat_manager' per the team type) in team_state.agent_states. Missing manager state means the saved checkpoint predates the manager-state feature or came from a different team type.","triggerScenarios":"Calling load_state() with a state dict whose agent_states lacks the key matching self._group_chat_manager_name — typically a state saved by an older version or one assembled manually without the manager entry.","commonSituations":"Upgrading AutoGen and loading pre-upgrade checkpoints; mixing state files between team classes; hand-crafted state dicts for testing.","solutions":["Re-save the state with the current library version so the manager entry is included.","If migrating manually, add a valid manager state entry under the manager's name (inspect TeamState and the manager's save_state output for the schema).","Check the exact expected name via the team's group_chat_manager_name / saved keys before loading."],"exampleFix":"# before\nawait team.load_state({\"agent_states\": {\"assistant\": {...}}})  # no manager entry\n\n# after\nawait team.load_state({\"agent_states\": {\"assistant\": {...}, \"group_chat_manager\": {...}}})  # include manager state from save_state()","handlingStrategy":"validation","validationCode":"mgr = team._group_chat_manager_name\nif mgr not in state.get(\"agent_states\", {}):\n    raise ValueError(f\"saved state lacks manager entry '{mgr}'; re-save with the current version\")\nawait team.load_state(state)","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Only load checkpoints produced by the same major/minor version that saved them.","Re-save state immediately after upgrading the library.","Log the keys of agent_states when validating checkpoints."],"tags":["python","autogen","state","save-load","group-chat-manager"],"backgroundTag":null,"analyzedSha":"027ecf0a379bcc1d09956d46d12d44a3ad9cee14","analyzedAt":"2026-08-15T03:38:00.719Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}