Quick Start
1
Open a thread and post into it
2
Read the typed outcome
How It Works
create_thread resolves the target, checks the channel’s supports_threads capability, and dispatches to the adapter — returning a typed outcome instead of raising.
Status Decision Guide
Each call resolves to exactly oneThreadStatus — map it to the right caller action.
Progressive disclosure: start with the boolean
result.ok, then branch on the four status values, then read the full ThreadResult dataclass when you need target, thread_id, or detail.Configuration Options
ThreadResult (from praisonaiagents.gateway) is the typed return of every create_thread call.
ThreadStatus is a string literal — one of the four values below.
The capability flag lives on the adapter’s
PlatformCapabilities.
Fallback Pattern
Try the thread, and route to the parent channel on any non-ok outcome.
Never raises. A channel that cannot thread returns a typed
unsupported outcome — you do not need try/except around create_thread.Authoring a Custom Adapter
A customOutboundMessengerProtocol implementation declares the capability and returns a ThreadResult.
Per-Platform Support
Support tracks each adapter’ssupports_threads capability.
Common Patterns
Scope a multi-agent subtask into its own thread so it doesn’t flood the shared channel.Best Practices
Always compose the routed target from the result
Always compose the routed target from the result
Send into
f"{result.target}:{result.thread_id}" only when result.ok is True. On any other status, send to the parent target so the message still lands.Skip try/except — the call never raises
Skip try/except — the call never raises
create_thread resolves to a typed unsupported / failed / no_route outcome instead of throwing. Branch on result.status, not on exceptions.Treat no_route as a bug, not a fallback
Treat no_route as a bug, not a fallback
"no_route" means the target string didn’t resolve to a reachable channel — log it and fix the target rather than silently retrying.Declare supports_threads on custom adapters
Declare supports_threads on custom adapters
Return
PlatformCapabilities(supports_threads=True) and implement create_thread together. Declaring the capability without the method leaves the router returning unsupported.Related
Channel Capabilities
What each channel supports, including threads
Send Message Tool
Deliver messages and reactions to symbolic targets
Gateway
Gateway lifecycle predicates and exported symbols
Platform Capabilities
Per-adapter capability descriptor

