# Session Notes: Hermes Web Dashboard

## 2026-05-09: Full Deployment with API Server + Memory Injection

### What was deployed
- Web chat server at `~/.hermes/webchat/server.py` (port 8888)
- Nginx reverse proxy on port 80
- Hermes API Server on port 8080 (via gateway)
- Password: `Hermes2026!`
- Public IP: `74.48.56.81`

### Key discoveries

**API Server session continuity**: Use `X-Hermes-Session-Id` header to maintain conversation context across requests. Each browser session gets a unique ID (`webchat-{sid[:8]}`).

**Memory injection**: Reading `~/.hermes/memories/USER.md` and `MEMORY.md` on every API call and injecting as system prompt. This gives web chat access to terminal agent's memory.

**Memory is one-way**: Web chat can read but not write back to memory files. Terminal agent handles persistence.

**429 rate limits**: OpenRouter credential pool exhaustion causes 429 errors. API Server retries 3 times then returns error. Wait 30-60s before retrying.

**Chrome blocks HTTP**: Chrome refuses to load insecure HTTP pages on non-localhost IPs (`ERR_BLOCKED_BY_CLIENT`). Use HTTPS or access via localhost.

**Nginx Basic Auth doesn't work with Chrome**: Chrome blocks the auth dialog entirely. Use cookie-based auth instead.

**Stale processes accumulate**: Multiple webchat/gateway processes from repeated restarts. Always check with `ss -tlnp` and kill stale ones.

**BrokenPipeError on disconnect**: When user closes browser mid-request, server gets `BrokenPipeError`. Harmless.

### Service startup order
1. Start gateway with API Server: `API_SERVER_ENABLED=true API_SERVER_KEY=... hermes gateway run --accept-hooks`
2. Start webchat: `python3 ~/.hermes/webchat/server.py &`
3. Reload nginx: `nginx -s reload`

### User context
- User is 张哥, named the agent 星璇
- User tried 6-7 Hermes versions before, all had connection issues
- User wants web chat + QQ bot as backup access paths to prevent losing connection
- User prefers Chinese, concise responses
