The gateway now ships in the
praisonai-bot package. praisonai serve gateway still works exactly as documented here; for a standalone install see praisonai-bot Migration.reliability is a single posture switch on BotOS, gateway YAML, or the CLI that maps a profile name onto drain window, concurrency ceiling, and admission queue — without touching individual settings.
The user deploys with a reliability preset; retries, timeouts, and drain behaviour apply automatically.
Quick Start
CLI flag — override any YAML value
Profiles
Three built-in profiles cover the most common deployment scenarios.| Profile | Drain window | Admission ceiling | Overflow behaviour |
|---|---|---|---|
production | 15 s | CPU-scaled max_concurrent_runs | Bounded fair-wait queue (overflow=queue) |
default / None (unset) | 5 s | none | pass-through |
off | 0 s (immediate teardown) | none | today’s no-backpressure behaviour |
How It Works
The resolver_reliability.py converts the profile string into concrete values for drain_timeout, max_concurrent_runs, and admission_policy. Those values are passed directly to the underlying WebSocketGateway build step.
Precedence (highest → lowest):
- Explicit kwargs on
BotOS.__init__— e.g.drain_timeout=30 reliability=preset — e.g."production"- SDK defaults
Configuration Surfaces
Python
YAML
Both placements are accepted:CLI
Common Patterns
Production deployment
Extend the drain window for slow agents
Disable all backpressure for development
Best Practices
Use production in all deployed services
Use production in all deployed services
production composes drain + admission control together. Enabling them separately is error-prone — the preset guarantees a coherent configuration.Never mix reliability= with manual drain/admission in YAML unless intentional
Never mix reliability= with manual drain/admission in YAML unless intentional
Explicit YAML keys like
gateway.drain_timeout override the preset. That is correct behaviour when you need to tune a single value, but it can surprise you if you forget the preset was set.Unknown profile names raise immediately — do not catch the error
Unknown profile names raise immediately — do not catch the error
An unrecognised profile (e.g.
reliability: "fast") raises at startup, not at first request. This fail-fast behaviour is intentional — silent fallback to default would hide misconfiguration.Use --reliability CLI flag for canary deployments
Use --reliability CLI flag for canary deployments
Deploying a new preset to a single pod via the CLI flag lets you validate behaviour before updating the shared
gateway.yaml.Related
Gateway Overview
Bot gateway architecture and core concepts
Gateway Graceful Drain
In-flight turn drain on shutdown or reload
Gateway Admission Control
Cap concurrent runs and queue overflow requests
Gateway Flow Control
Back-pressure and send-policy options

