Skip to main content
Three CLI checks verify a running gateway from the outside in β€” HTTP endpoints reachable, inbound messages actually flowing, and no competing gateway fighting for the same tokens.

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:
Inspect stored conversations when a user reports a missing reply:
Call the checks directly from Python for custom health tooling:
Each function returns a dataclass with a .to_dict() for JSON output:
The inbound tier reads a counter the gateway increments on every inbound message.
  • Metric: messages_inbound_total{channel="..."} β€” incremented per channel, including the Slack @mention path. handle_mention now fires fire_message_received, so mentions count toward inbound and honour drop / rewritten content decisions.
  • /health additions: top-level last_inbound_at; per-channel ok, reason (from the HealthReason enum), last_activity, and optional probe.ok.
  • Two doctor checks (category BOTS, both requires_deep=True):
Run them with praisonai doctor --deep.

Best Practices

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.
When a bot stops replying, a second gateway sharing the same token is the most common cause. Run --check-duplicates before touching config.
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.
--since 10m suits busy bots. For a quiet channel use --since 2h or --since 1d so a real-but-old message still registers.

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