Quick Start
1
Verify the gateway is reachable
Probe the runtime endpoints of a running gateway:
2
Confirm messages are arriving
Check inbound delivery within a time window using a config file:
3
Detect a competing gateway
Scan for a second gateway sharing your Slack/Telegram token:
How It Works
Each tier answers a different βis my bot healthy?β question.
The inbound tier combines two independent signals: a scan of the gateway log and a Prometheus counter compared against a persisted baseline.
Configuration Options
The diagnostics are entirely CLI-driven β no new YAML keys.praisonai gateway test flags:
praisonai gateway status flags:
praisonai gateway sessions subcommands:
Environment variable:
/health uses the existing health_config.stale_after (default 120.0s) and startup_grace (default 60.0s).
State files the checks read (read-only):
~/.praisonai/state/inbound_metrics_baseline.json (counter baseline), ~/.praisonai/logs/bot-stderr.log (mention markers), and ~/.hermes/gateway_state.json + ~/.praisonai/.env + ~/.hermes/.env (duplicate detection).Common Patterns
Run runtime and duplicate checks together for a fast liveness sweep:.to_dict() for JSON output:
Related Emissions
The inbound tier reads a counter the gateway increments on every inbound message.- Metric:
messages_inbound_total{channel="..."}β incremented per channel, including the Slack@mentionpath.handle_mentionnow firesfire_message_received, so mentions count toward inbound and honourdrop/ rewrittencontentdecisions. /healthadditions: top-levellast_inbound_at; per-channelok,reason(from theHealthReasonenum),last_activity, and optionalprobe.ok.- Two doctor checks (category
BOTS, bothrequires_deep=True):
Run them with
praisonai doctor --deep.
Best Practices
Seed the inbound baseline first
Seed the inbound baseline first
The first
--check-inbound run seeds inbound_metrics_baseline.json. Re-run it after sending a test message to see a real delta within the window.Use --check-duplicates before debugging silence
Use --check-duplicates before debugging silence
When a bot stops replying, a second gateway sharing the same token is the most common cause. Run
--check-duplicates before touching config.Keep GATEWAY_AUTH_TOKEN loopback-only for remote gateways
Keep GATEWAY_AUTH_TOKEN loopback-only for remote gateways
The bearer token is withheld over plaintext HTTP to a remote host. Probe over loopback or serve the gateway behind HTTPS so
/info and /metrics stay reachable.Widen the window for low-traffic bots
Widen the window for low-traffic bots
--since 10m suits busy bots. For a quiet channel use --since 2h or --since 1d so a real-but-old message still registers.Related
Gateway Forensics
Deep post-incident inspection of gateway state
Gateway Liveness
Health, readiness, and liveness endpoints
Runtime Preflight
Pre-start readiness verification
Loop Watchdog
Detect and break runaway gateway loops

