LivenessConfig
Defined in the config module.AI Agent Configuration for application-level connection liveness (Issue #2798). Drives the transport-agnostic ping/pong heartbeat contract: the gateway emits a
PING every interval_ms and reaps any connection whose
last activity is older than interval_ms × missed_beats_before_reap
(closing it with GatewayCloseCode.LIVENESS_TIMEOUT), while the
reference client sends heartbeats on the same cadence and force-reconnects
after a silence watchdog fires.
This maps directly onto the pure core :class:~praisonaiagents.gateway. protocols.LivenessPolicy; :meth:to_policy builds one.
Attributes:
enabled: Toggle liveness heartbeat/reaping. When False (default),
behaviour is unchanged — last_activity is stamped but never
acted upon, so upgrading is fully backward-compatible.
interval_ms: Heartbeat interval in milliseconds (advertised to clients
as heartbeat_ms).
missed_beats_before_reap: How many consecutive missed heartbeat
intervals of silence before a connection is reaped (>= 1).
Properties
bool
No description available.
int
No description available.
int
No description available.
Methods
to_policy()
Build the pure core
LivenessPolicy this config describes.Internal & Generic Methods
Internal & Generic Methods
- from_dict: Create from a parsed
gateway.livenessmapping (tolerant of None). - to_dict: Convert to dictionary.
Source
View on GitHub
praisonaiagents/gateway/config.py at line 530
