Messaging
¶ Message stuck on the sending clock
python -m app.cli diagnose-stuck-sends
Operations
Diagnose before reading code. Find the symptom, take the first move, then follow the deep dive if it isn't resolved.
python -m app.cli
Symptom → first move
Tags
python -m app.cli reconcile-tags
Deploys
doctl apps list-deployments
doctl apps get-deployment
Then read the component logs.
Connector
CPU tracks media volume.
Connector CPU / queue backlogCloud API
@lid or @g.us.
services/transport.py.Fleet-wide
docs/runbook-connector-freeze.md.
Confirm the connector (API health plus the DB heartbeat), snapshot evidence, restart only the connector, verify the heartbeat, then notify users and open an issue. Collect connector runtime logs, a DigitalOcean Insights screenshot, the connector pod or hostname with its last-log time, and the DB heartbeat query.
History & media
Ops watchdog
It alerts on WhatsApp sending delays, channels stuck on connecting, connector heartbeat silence, queued outbound messages, the public /healthz, and DigitalOcean restarts.
scripts\watchdog.ps1
python -m app.cli watchdog
python -m app.cli watchdog --once
python -m app.cli watchdog --dry-run
DATABASE_URL and REDIS_URL pointed at production, plus TELEGRAM_BOT_TOKEN and TELEGRAM_CHAT_ID. For DigitalOcean restart alerts, supply DIGITALOCEAN_TOKEN or be logged in with doctl.
scripts\watchdog.ps1 copies only the required production variables into the process and removes them on exit, and adds this computer's current IP to the managed DB firewall for the session so the run does not time out immediately.
Edge-triggered: one start message, one recovery, and periodic reminders while an issue is ongoing. Alerts are deduplicated and confirmed to avoid flapping.
Operational code lives in apps/api/app/services/watchdog.py, and the CLI entry is python -m app.cli watchdog. --once does a single dry check; --dry-run keeps running but prints instead of sending Telegram messages.
seed
create-superuser
backfill-contact-phones
merge-username-contacts
reconcile-tags
diagnose-stuck-sends