Clone For Channel • AI Agent SDK
clone_for_channel: Return a fully independent copy of this agent for a gateway channel.
clone_for_channel
Method
</div>
Return a fully independent copy of this agent for a gateway channel.
This method safely clones an agent for use in multi-channel scenarios by avoiding deepcopy issues with tools/handoffs and creating fresh instances of mutable objects like interrupt_controller.
Signature
def clone_for_channel() -> 'Agent'Returns
ResponseField
'Agent'A new Agent instance with copied configuration but fresh locks, interrupt controller, and shallow-copied tools.
Uses
warnings.warnExecutionConfigMemoryConfig
Source
View on GitHubpraisonaiagents/agent/agent.py at line 3362