Ompcord deployment & always-on

Two Discord bots, one guild. Amy#0305 (Ompcord) and Hoe#9145 (Hermes gateway) are separate applications with separate tokens, home channels, and systemd units. Never share tokens between them.

Bot identity matrix

Amy (Ompcord)Hoe (Hermes)
PersonaAmy#0305Hoe#9145
Roleomp coding-agent bridge (/amy, /ompcord, session threads)Hermes messaging gateway + cron delivery
Credentials~/.omp/.envOMPCORD_DISCORD_*~/.hermes/.envDISCORD_BOT_TOKEN
Home channel1513664007146438666 (Amy sessions)1506357291555754044 (#_hoe)
systemdamyd.service (system)hermes-gateway.service (user + linger)
Log~/pi-discord-amy/amyd.log~/.hermes/logs/agent.log

amyd.mjs refuses to start if the token decodes to Hoe’s bot id — this prevents accidental hijacks.

Credentials (~/.omp/.env)

Primary operator SSOT for Amy (chmod 600):

OMPCORD_DISCORD_BOT_TOKEN=        # Amy#0305 only — NOT DISCORD_BOT_TOKEN from Hermes
OMPCORD_DISCORD_GUILD_ID=1496176276933972110
OMPCORD_DISCORD_HOME_CHANNEL=1513664007146438666
OMPCORD_DISCORD_ALLOWED_USERS=id,id,…

Bootstrap into the systemd env file (also chmod 600):

node /home/usr/pi-discord-amy/scripts/bootstrap-amy-env.mjs
# writes ~/.config/amy/amyd.env (DISCORD_TOKEN, DISCORD_GUILD_ID, …)

Always-on after reboot

Amy is supervised by systemd on the host (not Kubernetes):

PropertyValue
Unitamyd.service
Enabledmulti-user.target (starts on boot)
Restartalways / RestartSec=3
Env file/home/usr/.config/amy/amyd.env
PATH/home/usr/.bun/bin (omp + bun shebang)
Binary/usr/bin/node /home/usr/pi-discord-amy/amyd.mjs
sudo systemctl enable --now amyd.service   # install + start
sudo systemctl status amyd.service
tail -f /home/usr/pi-discord-amy/amyd.log  # expect: ONLINE as Amy#0305

Hermes/Hoe uses a user unit with linger enabled (loginctl show-user usr -p Lingeryes), so hermes-gateway.service also survives logout and reboot independently.

Code reload (zero-downtime)

Prefer one supervisor path — do not run manual node amyd.mjs alongside systemd.

MethodWhen
sudo systemctl reload amydSIGHUP → re-exec same env, reap in-flight omp child
node /home/usr/pi-discord-amy/redeploy.mjsNo systemd: recover env from /proc, wait idle, relaunch
node redeploy.mjs (daemon down)Cold-start from ~/.config/amy/amyd.env if present

Health checks

systemctl is-active amyd.service
grep 'ONLINE as Amy' /home/usr/pi-discord-amy/amyd.log | tail -1
grep 'Connected as Hoe' /home/usr/.hermes/logs/agent.log | tail -1
cd /home/usr/pi-discord-amy && bun test

In Discord: /amy status in Amy’s home channel → 🟢 Online · idle.

Ask Docs

AI assistant to help answer questions about the documentation. Answers are read-only and cite docs/source.

Hi! How can I help you with the documentation today? Answers are read-only and cite docs/source.

Ctrl+Enter to send