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) | |
|---|---|---|
| Persona | Amy#0305 | Hoe#9145 |
| Role | omp coding-agent bridge (/amy, /ompcord, session threads) | Hermes messaging gateway + cron delivery |
| Credentials | ~/.omp/.env → OMPCORD_DISCORD_* | ~/.hermes/.env → DISCORD_BOT_TOKEN |
| Home channel | 1513664007146438666 (Amy sessions) | 1506357291555754044 (#_hoe) |
| systemd | amyd.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):
| Property | Value |
|---|---|
| Unit | amyd.service |
| Enabled | multi-user.target (starts on boot) |
| Restart | always / 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#0305Hermes/Hoe uses a user unit with linger enabled (loginctl show-user usr -p Linger → yes), 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.
| Method | When |
|---|---|
sudo systemctl reload amyd | SIGHUP → re-exec same env, reap in-flight omp child |
node /home/usr/pi-discord-amy/redeploy.mjs | No 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 testIn Discord: /amy status in Amy’s home channel → 🟢 Online · idle.
Related
- Ompcord overview
- Runbooks
- Hermes setup
- Repo SSOT:
~/pi-discord-amy/AGENTS.md