no-mistakes(review): Fix zulip-health v3.1.0 review findings: SSH octet, B6 guard check, restart rationale, env extraction

This commit is contained in:
root
2026-07-22 21:59:52 +00:00
parent 3d832658b9
commit a9ec9daf84
+22 -7
View File
@@ -196,7 +196,7 @@ grep -a "Finalized\|Failed to finalize" /root/.pm2/logs/abiba-zulip-out.log | ta
| `last_error` set | Log and monitor |
| Crash loop >10/h | Alert user |
### Step 3: Platform B — Hermes (Tanko .122, Mumuni .123, Koonimo .113, Koby .111)
### Step 3: Platform B — Hermes (Tanko .122, Mumuni .123, Koonimo .114, Koby .111)
Platform B now monitors four Hermes agents:
- Tanko (CT 112, 192.168.68.122) — Zulip + Telegram
@@ -330,13 +330,20 @@ still be fine — do NOT treat as Zulip outage).
Check whether the `no-key-required` fallback string exists without the
LiteLLM-specific guard (only needed when LiteLLM key injection failures are
suspected):
suspected). A bare count of the fallback string cannot distinguish a guarded
occurrence from an unguarded one, so count both the fallback string and the
LiteLLM guard token:
```bash
ssh root@<CT> "grep -c 'no-key-required' /usr/local/lib/hermes-agent/hermes_cli/cli_agent_setup_mixin.py 2>/dev/null || echo 0"
ssh root@<CT> "f=\$(grep -c 'no-key-required' /usr/local/lib/hermes-agent/hermes_cli/cli_agent_setup_mixin.py 2>/dev/null || echo 0); g=\$(grep -c 'LITELLM_API_KEY' /usr/local/lib/hermes-agent/hermes_cli/cli_agent_setup_mixin.py 2>/dev/null || echo 0); echo fallback=\$f guard=\$g"
# pct exec variant:
ssh root@192.168.68.15 "pct exec 113 -- bash -c 'f=\$(grep -c no-key-required /usr/local/lib/hermes-agent/hermes_cli/cli_agent_setup_mixin.py 2>/dev/null || echo 0); g=\$(grep -c LITELLM_API_KEY /usr/local/lib/hermes-agent/hermes_cli/cli_agent_setup_mixin.py 2>/dev/null || echo 0); echo fallback=\$f guard=\$g'"
```
If the fallback string exists without the guard → patch is missing.
If `fallback > 0` and `guard == 0` → the fallback string is present without
the LiteLLM-specific guard, so the patch is missing. If unsure, inspect each
occurrence with `grep -n -B2 -A2 'no-key-required'` to confirm the guard
wraps it.
**Platform B Actions**
@@ -361,14 +368,22 @@ ssh root@<CT> "pkill -f 'gateway run'; sleep 2; hermes gateway restart"
ssh root@192.168.68.15 "pct exec 113 -- bash -c 'pkill -f \"gateway run\"; sleep 2; systemctl restart hermes-gateway'"
```
The mechanisms differ by design: Tanko/Mumuni launch the gateway through a
wrapper loop, so the `hermes gateway restart` CLI is the correct entry point
(it re-arms the wrapper). Koonimo/Koby run the gateway as a systemd unit
(`hermes-gateway.service`), so `systemctl restart hermes-gateway` is the
correct entry point under `pct exec`. Do not swap the two — using the CLI on
Koonimo/Koby would bypass the unit, and using `systemctl` on Tanko/Mumuni
would miss the wrapper loop.
Fallback: Infisical missing → start gateway directly from venv with env vars:
```bash
ssh root@<CT> "source /usr/local/lib/hermes-agent/venv/bin/activate && \
export LITELLM_API_KEY=\$(grep LITELLM_API_KEY /root/.hermes/.env | cut -d= -f2) && \
export ZULIP_API_KEY=\$(grep ZULIP_API_KEY /root/.hermes/.env | cut -d= -f2) && \
export LITELLM_API_KEY=\$(grep -E '^LITELLM_API_KEY=' /root/.hermes/.env | cut -d= -f2-) && \
export ZULIP_API_KEY=\$(grep -E '^ZULIP_API_KEY=' /root/.hermes/.env | cut -d= -f2-) && \
cd /root/.hermes && nohup hermes gateway run > logs/gateway-manual-start.log 2>&1 &"
# pct exec variant:
ssh root@192.168.68.15 "pct exec 113 -- bash -c 'source /usr/local/lib/hermes-agent/venv/bin/activate; export LITELLM_API_KEY=\$(grep LITELLM_API_KEY /root/.hermes/.env | cut -d= -f2); export ZULIP_API_KEY=\$(grep ZULIP_API_KEY /root/.hermes/.env | cut -d= -f2); cd /root/.hermes; nohup hermes gateway run > logs/gateway-manual-start.log 2>&1 &'"
ssh root@192.168.68.15 "pct exec 113 -- bash -c 'source /usr/local/lib/hermes-agent/venv/bin/activate; export LITELLM_API_KEY=\$(grep -E ^LITELLM_API_KEY= /root/.hermes/.env | cut -d= -f2-); export ZULIP_API_KEY=\$(grep -E ^ZULIP_API_KEY= /root/.hermes/.env | cut -d= -f2-); cd /root/.hermes; nohup hermes gateway run > logs/gateway-manual-start.log 2>&1 &'"
```
### Step 4: Platform C — Agent Zero (kagentz, CT 105 via Docker host .14)