{"record":{"id":"73f0652fa9106633","repo":"microsoft/semantic-kernel","slug":"unable-to-create-channel-channel-type-not-configu","errorCode":null,"errorMessage":"Unable to create channel. Channel type not configured.","messagePattern":"Unable to create channel\\. Channel type not configured\\.","errorType":"exception","errorClass":"NotImplementedError","httpStatus":null,"severity":"error","filePath":"python/semantic_kernel/agents/agent.py","lineNumber":436,"sourceCode":"\n    def get_channel_keys(self) -> Iterable[str]:\n        \"\"\"Get the channel keys.\n\n        Returns:\n            A list of channel keys.\n        \"\"\"\n        if not self.channel_type:\n            raise NotImplementedError(\"Unable to get channel keys. Channel type not configured.\")\n        yield self.channel_type.__name__\n\n    async def create_channel(self) -> AgentChannel:\n        \"\"\"Create a channel.\n\n        Returns:\n            An instance of AgentChannel.\n        \"\"\"\n        if not self.channel_type:\n            raise NotImplementedError(\"Unable to create channel. Channel type not configured.\")\n        return self.channel_type()\n\n    # endregion\n\n    # region Instructions Management\n\n    async def format_instructions(self, kernel: Kernel, arguments: KernelArguments | None = None) -> str | None:\n        \"\"\"Format the instructions.\n\n        Args:\n            kernel: The kernel instance.\n            arguments: The kernel arguments.\n\n        Returns:\n            The formatted instructions.\n        \"\"\"\n        if self.prompt_template is None:\n            if self.instructions is None:","sourceCodeStart":418,"sourceCodeEnd":454,"githubUrl":"https://github.com/microsoft/semantic-kernel/blob/c028a0c7dc4f0814cdcbaba9d998f187a41197bf/python/semantic_kernel/agents/agent.py#L418-L454","documentation":"Agent.create_channel() instantiates self.channel_type() to give the agent a communication channel; if the subclass never set channel_type (None on the base), it raises NotImplementedError. This is the async sibling of error 695 and fires when the chat runtime asks the agent to produce its channel.","triggerScenarios":"Adding a custom/base agent to a group chat that calls create_channel(); instantiating Agent directly; a subclass missing the channel_type ClassVar.","commonSituations":"Building a custom agent without specifying channel_type; using the abstract base; copy-pasting a subclass and dropping the channel declaration.","solutions":["Set channel_type on your custom Agent subclass to a concrete AgentChannel type.","Use a built-in concrete agent which already configures its channel.","Avoid instantiating the abstract Agent base."],"exampleFix":"# before\nclass MyAgent(Agent):\n    ...  # no channel_type -> create_channel() errors\n# after\nfrom semantic_kernel.agents.channels.chat_history_channel import ChatHistoryChannel\nclass MyAgent(Agent):\n    channel_type: ClassVar[type[AgentChannel]] = ChatHistoryChannel","handlingStrategy":"type-guard","validationCode":"assert agent.channel_type is not None, \\\n    f'{type(agent).__name__} has no channel_type; cannot create_channel()'","typeGuard":"from semantic_kernel.agents.channels.agent_channel import AgentChannel\ndef agent_has_channel(agent) -> bool:\n    ct = getattr(type(agent), 'channel_type', None)\n    return ct is not None and issubclass(ct, AgentChannel)","tryCatchPattern":null,"preventionTips":["Declare channel_type on custom agent subclasses.","Prefer built-in concrete agents.","Don't instantiate the abstract base Agent.","Confirm channel_type before invoking chat creation."],"tags":["agents","channel","subclassing","semantic-kernel","not-implemented"],"backgroundTag":null,"analyzedSha":"c028a0c7dc4f0814cdcbaba9d998f187a41197bf","analyzedAt":"2026-08-13T13:48:05.040Z","schemaVersion":2},"datasetVersion":"2026-08-13T14:17:21.547Z"}