microsoft/semantic-kernel · error · NotImplementedError
Unable to create channel. Channel type not configured.
Error message
Unable to create channel. Channel type not configured.
What it means
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.
Source
Thrown at python/semantic_kernel/agents/agent.py:436
def get_channel_keys(self) -> Iterable[str]:
"""Get the channel keys.
Returns:
A list of channel keys.
"""
if not self.channel_type:
raise NotImplementedError("Unable to get channel keys. Channel type not configured.")
yield self.channel_type.__name__
async def create_channel(self) -> AgentChannel:
"""Create a channel.
Returns:
An instance of AgentChannel.
"""
if not self.channel_type:
raise NotImplementedError("Unable to create channel. Channel type not configured.")
return self.channel_type()
# endregion
# region Instructions Management
async def format_instructions(self, kernel: Kernel, arguments: KernelArguments | None = None) -> str | None:
"""Format the instructions.
Args:
kernel: The kernel instance.
arguments: The kernel arguments.
Returns:
The formatted instructions.
"""
if self.prompt_template is None:
if self.instructions is None:View on GitHub (pinned to c028a0c7dc)
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.
Example fix
# before
class MyAgent(Agent):
... # no channel_type -> create_channel() errors
# after
from semantic_kernel.agents.channels.chat_history_channel import ChatHistoryChannel
class MyAgent(Agent):
channel_type: ClassVar[type[AgentChannel]] = ChatHistoryChannel Defensive patterns
Strategy: type-guard
Validate before calling
assert agent.channel_type is not None, \
f'{type(agent).__name__} has no channel_type; cannot create_channel()' Type guard
from semantic_kernel.agents.channels.agent_channel import AgentChannel
def agent_has_channel(agent) -> bool:
ct = getattr(type(agent), 'channel_type', None)
return ct is not None and issubclass(ct, AgentChannel) Prevention
- 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.
When it happens
Trigger: Adding a custom/base agent to a group chat that calls create_channel(); instantiating Agent directly; a subclass missing the channel_type ClassVar.
Common situations: Building a custom agent without specifying channel_type; using the abstract base; copy-pasting a subclass and dropping the channel declaration.
Related errors
- Unable to get channel keys. Channel type not configured.
- The message could not be added to the thread due to an error
- Agent with name {agentId.Type} not found.
- module {__name__} has no attribute {name}
- Thread has been deleted; call `create()` to recreate it.
AI-assisted analysis of microsoft/semantic-kernel@c028a0c7dc (2026-08-13).
Data as JSON: /api/errors/73f0652fa9106633.
Report an issue: GitHub.