deploy: ship krystie-hermes-gateway.service + README update

Permanent fix for the recurring 'Krystie's UMP writes silently drop'
problem. Kills the last manual-process row from the drift stack by
moving krystie's hermes-cli gateway under systemd.

Two new assets in deploy/:
  - krystie-hermes-gateway.service
  - README.md sections describing install + the manual-to-systemd
    migration steps

Run from a non-gateway shell to swap:
  sudo cp deploy/krystie-hermes-gateway.service /etc/systemd/system/
  sudo systemctl daemon-reload
  sudo systemctl enable --now krystie-hermes-gateway.service
This commit is contained in:
Hermes Agent
2026-07-13 21:48:54 -07:00
parent 8e1a88f106
commit 5401ec6ff7
2 changed files with 55 additions and 0 deletions
+28
View File
@@ -40,3 +40,31 @@ reboot). Then `ump.recall` would fall back to canonical ump via the
shim's fallback path — which works, but loses RRF fusion and the graph
channel. Now the sidecar is persistent and the MCP recall quality is
uninterrupted.
## krystie-hermes-gateway.service
Manages the krystie-profile Hermes gateway (the Telegram session
attributed to krystie).
**Install (idempotent):**
```bash
sudo cp deploy/krystie-hermes-gateway.service /etc/systemd/system/
sudo systemctl daemon-reload
sudo systemctl enable --now krystie-hermes-gateway.service
sudo systemctl status krystie-hermes-gateway.service
```
**Important:** Before installing, stop any manually-launched krystie
gateway (`pgrep -f 'gateway run --replace -p krystie'` then
`kill -INT <pid>`). Wait ~10s for the Telegram session to release,
then start the systemd unit. Telegram reconnects in ~5s.
**Deps:** ump-memory.service, ump-recall-sidecar.service.
**Why this exists:** Before this unit, the krystie gateway was launched
manually, holding stale env (including UMP_DIR) from whatever was in
the env when the user typed the command. After the openclaw→Hermes ump
migration, krystie's MCP shim children were inheriting stale UMP_DIR
and silently dropping writes. Now the gateway is systemd-managed so
its shim and the canonical ump recompute their env together on every
restart — drift can no longer accumulate silently.
+27
View File
@@ -0,0 +1,27 @@
[Unit]
Description=Hermes Gateway — krystie profile (Telegram session)
After=network.target ump-memory.service ump-recall-sidecar.service
Wants=ump-memory.service ump-recall-sidecar.service
[Service]
Type=simple
User=root
WorkingDirectory=/root
ExecStart=/usr/local/lib/hermes-agent/venv/bin/python -m hermes_cli.main gateway run -p krystie --replace
# Always restart — handles OOM kills, hot reloads, dev iterations.
# --replace ensures only one instance owns the Telegram connection.
Restart=always
RestartSec=5
# Graceful shutdown — gives Telegram polling time to ACK disconnect
KillSignal=SIGINT
TimeoutStopSec=30
# Logging — flows through journal with this identifier
StandardOutput=journal
StandardError=journal
SyslogIdentifier=hermes-gateway-krystie
[Install]
WantedBy=multi-user.target