Overview
WorkerRunner runs agents to completion and acts as the host for a multi-agent session. It owns the shared WorkerBus and WorkerRegistry that back the whole session, and responds to bus messages for lifecycle coordination.
PipelineRunner is a deprecated alias for WorkerRunner; existing code that
uses it keeps working but should migrate to WorkerRunner.add_workers() attaches it to the runner’s bus and registry, so agents do not take a bus in their constructor.
Configuration
str | None
default:"None"
Unique name for this runner. Defaults to a UUID-based name. Must be unique
across all runners in a distributed setup.
WorkerBus | None
default:"None"
The
WorkerBus instance. Creates
an AsyncQueueBus if not
provided.bool
default:"True"
Whether to automatically handle SIGINT signals for graceful shutdown.
bool
default:"False"
Whether to automatically handle SIGTERM signals for graceful shutdown.
bool
default:"False"
Whether to force garbage collection after the main worker completes.
asyncio.AbstractEventLoop | None
default:"None"
Event loop to use. If
None, uses the current running loop.Properties
bus
registry
Methods
add_workers
run(). When called after run() has started, each agent starts immediately; otherwise agents are queued and started during run setup.
run
auto_end=True), the runner ends once every root agent has finished. For long-lived hosts that add and remove agents over many sessions, pass auto_end=False so the runner does not exit when no agents are left.