Moving a live gateway conversation between platforms is this page. For assembling an agent-side continuation prompt from durable state, see Session Handoff — a different feature.
Quick Start
1
Minimal handoff
2
With a seed message and breadcrumb
How It Works
handoff reuses DeliveryRouter.create_thread to open the destination thread, then seeds it with the origin transcript so the conversation continues seamlessly — it adds no new per-platform behaviour.
The destination session key is composed as platform:channel:thread — subsequent turns arriving on the new thread route to it through the normal inbound path.
ThreadRef
handoff returns a frozen ThreadRef describing the destination thread and the session key subsequent turns route to.
handoff() Parameters
Status Decision Guide
Every call resolves to exactly onestatus — map it to the right caller action.
Capability Requirements
The target adapter must setsupports_threads=True on its PlatformCapabilities; otherwise handoff returns status == "unsupported" and seeds nothing.
See Platform Capabilities for the per-adapter descriptor.
Common Patterns
Chat-command style — a/handoff <platform> wrapper moves the session and reports the outcome back.
Best Practices
Branch on ref.ok — handoff never raises
Branch on ref.ok — handoff never raises
An unsupported or unreachable target returns a non-
ok ThreadRef instead of throwing. Check ref.ok; you do not need try/except.Pass announce=False for batch or CLI origins
Pass announce=False for batch or CLI origins
The
"Continued on <platform>." breadcrumb interrupts the origin. Silence it with announce=False when the origin is a batch job or CLI you don’t want to notify.Handoff moves the transcript, not the run
Handoff moves the transcript, not the run
The next turn starts on the destination as soon as
ref.ok is True. Route the following message to ref.session_key — the in-flight run is not transferred.Fall back to identity linking on unsupported platforms
Fall back to identity linking on unsupported platforms
Platforms without native threads (WhatsApp, Email) return
status == "unsupported". Link the user’s identities instead of opening a thread.Related
Gateway Threads
The underlying
create_thread primitive handoff builds onGateway Overview
Where
BotOS fits in the gatewaySession Persistence
Durable transcripts handoff reads and seeds
Session Handoff
Different feature — agent-side context resume

