{"record":{"id":"63aa72220b91e82c","repo":"microsoft/semantic-kernel","slug":"the-members-list-cannot-be-empty","errorCode":null,"errorMessage":"The members list cannot be empty.","messagePattern":"The members list cannot be empty\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/semantic_kernel/agents/orchestration/orchestration_base.py","lineNumber":116,"sourceCode":"        agent_response_callback: Callable[[DefaultTypeAlias], Awaitable[None] | None] | None = None,\n        streaming_agent_response_callback: Callable[[StreamingChatMessageContent, bool], Awaitable[None] | None]\n        | None = None,\n    ) -> None:\n        \"\"\"Initialize the orchestration base.\n\n        Args:\n            members (list[Agent]): The list of agents to be used.\n            name (str | None): A unique name of the orchestration. If None, a unique name will be generated.\n            description (str | None): The description of the orchestration. If None, use a default description.\n            input_transform (Callable | None): A function that transforms the external input message.\n            output_transform (Callable | None): A function that transforms the internal output message.\n            agent_response_callback (Callable | None): A function that is called when a full response is produced\n                by the agents.\n            streaming_agent_response_callback (Callable | None): A function that is called when a streaming response\n                is produced by the agents.\n        \"\"\"\n        if not members:\n            raise ValueError(\"The members list cannot be empty.\")\n        self._members = members\n\n        self.name = name or f\"{self.__class__.__name__}_{uuid.uuid4().hex}\"\n        self.description = description or \"A multi-agent orchestration.\"\n\n        self._input_transform = input_transform or self._default_input_transform\n        self._output_transform = output_transform or self._default_output_transform\n\n        self._agent_response_callback = agent_response_callback\n        self._streaming_agent_response_callback = streaming_agent_response_callback\n\n    def _set_types(self) -> None:\n        \"\"\"Set the external input and output types from the class arguments.\n\n        This method can only be run after the class has been initialized because it relies on the\n        `__orig_class__` attributes to determine the type parameters.\n\n        This method will first try to get the type parameters from the class itself. The `__orig_class__`","sourceCodeStart":98,"sourceCodeEnd":134,"githubUrl":"https://github.com/microsoft/semantic-kernel/blob/c028a0c7dc4f0814cdcbaba9d998f187a41197bf/python/semantic_kernel/agents/orchestration/orchestration_base.py#L98-L134","documentation":"OrchestrationBase requires at least one agent to coordinate; an empty members list has no one to route messages to, so the constructor rejects it. This is the first validation in __init__ and applies to every orchestration subclass (Magentic, GroupChat, Sequential, etc.).","triggerScenarios":"Constructing any orchestration with `members=[]` (an empty list). Also if members resolves to an empty iterable/falsy value.","commonSituations":"Building the members list dynamically and it happened to be empty (filtered out all agents). Passing members before populating it. Copy-paste scaffolding with a placeholder empty list.","solutions":["Provide at least one Agent instance in members.","Validate the members list is non-empty before constructing the orchestration.","For Magentic, also remember each member needs a description (separate check)."],"exampleFix":"// before\norch = MagenticOrchestration(members=[], manager=manager)  # raises\n\n// after\nagents = [ChatCompletionAgent(name=\"A\", description=\"A: ...\", service=svc)]\norch = MagenticOrchestration(members=agents, manager=manager)","handlingStrategy":"validation","validationCode":"if not members:\n    raise ValueError(\"At least one agent is required.\")\norch = MagenticOrchestration(members=members, manager=manager)","typeGuard":"def has_members(members) -> bool:\n    return bool(members) and len(members) >= 1","tryCatchPattern":null,"preventionTips":["Populate the members list before constructing the orchestration.","Add an assertion/guard in agent-building helpers to reject empty lists.","For Magentic, also ensure every member has a description."],"tags":["semantic-kernel","orchestration","configuration","init","validation"],"backgroundTag":null,"analyzedSha":"c028a0c7dc4f0814cdcbaba9d998f187a41197bf","analyzedAt":"2026-08-13T13:48:05.040Z","schemaVersion":2},"datasetVersion":"2026-08-13T14:17:21.547Z"}