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.BotOS(agent=..., ...) or praisonai gateway start with no reliability= argument is now safe by default — the gateway picks a bounded admission ceiling, a fair wait queue, strict outbound ordering, and a drain window sized to the bind (loopback → 5s, real interface → 15s). The reliability= preset is still there for callers who want to override that.
Quick Start
1
Simplest — safe by default
No
reliability= needed. The gateway resolves admission, a fair queue, strict ordering, and a bind-aware drain:2
Force the full production window even on loopback
3
Explicit opt-out (revert to pre-#3438 immediate teardown)
4
YAML — set reliability: at the top level
5
CLI flag — override any YAML value
6
Override individual settings after the preset
Explicit kwargs on
BotOS always win over the preset:Profiles
Four distinct postures. The unset posture is bind-aware, so it appears twice.
The safe posture (unset) and
production both enable strict per-conversation FIFO delivery on the outbox — see Outbound Ordering. "default" and "off" keep best_effort for backward compatibility.
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,outbound_ordering="strict" reliability=preset — e.g."production"- SDK defaults
outbound_ordering= is also an explicit kwarg that overrides the preset. Passing outbound_ordering="strict" (or "best_effort") always wins over the profile’s choice; unknown values raise ValueError at resolve time.
Configuration Surfaces
Python
YAML
Both placements are accepted:CLI
Common Patterns
Production deployment
A non-loopback bind auto-selects the full production window — noreliability= argument needed:
Extend the drain window for slow agents
Production preset with per-thread ordering
Theproduction preset enables strict ordering; pass a custom lane_key to order sends within a shared channel:
Disable all backpressure for development
Best Practices
Recommended: pass nothing — the unset posture is now production-safe
Recommended: pass nothing — the unset posture is now production-safe
On a non-loopback bind the unset posture is equivalent to
production — same admission ceiling, fair queue, strict ordering, and 15 s drain. Most operators don’t need to pass anything. Use reliability="production" only to pin the 15 s window even on a loopback bind.I want the pre-3438 behaviour back
I want the pre-3438 behaviour back
Pass
reliability="off" for no drain and no admission, or reliability="default" for a 5 s drain with no admission ceiling. Neither is a recommended default — they exist for callers who explicitly want the pre-#3438 shape.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
Outbound Ordering
Per-conversation FIFO delivery the production preset turns on

