Both gateway daemons maintain heartbeats to signal liveness. This enables the UI to detect stale gateways and Docker to detect crashed containers.Documentation Index
Fetch the complete documentation index at: https://docs.yourhq.ai/llms.txt
Use this file to discover all available pages before exploring further.
Two heartbeat mechanisms
Supabase heartbeat (command runner only)
The command runner daemon upsertsgateways.last_seen_at every 30 seconds via the PostgREST API. This is the primary signal the UI uses to determine gateway health.
Pause-aware: If the gateway’s status is paused or hibernating, the daemon only updates last_seen_at without overwriting the status back to ready. This preserves user-initiated pauses.
Local heartbeat file (both daemons)
Both the command runner and inbox dispatcher write the current ISO timestamp to/tmp/heartbeat.txt every 30 seconds. This file is consumed by Docker healthchecks.
Freshness threshold
The UI considers a heartbeat stale after 90 seconds (HEARTBEAT_FRESH_SECONDS in apps/ui/src/lib/gateways/types.ts). Since the daemon writes every 30s, this allows up to 2 missed heartbeats before marking stale.
A gateway with status ready but a stale heartbeat is displayed as error (red) in the UI with a “stale” badge.
Gateway detail page
The gateway detail sidebar shows a Heartbeat property with:- Healthy (green) —
last_seen_atis within 90 seconds - Stale (amber) — status is
readybut heartbeat is old - No signal —
last_seen_atis null (gateway has never reported)
Structured JSON logs
Both daemons emit structured JSON logs to stdout. Each log entry includes:docker compose logs -f or a log aggregator to monitor daemon health.