Farhan Beg commited on
Commit
2da650a
Β·
1 Parent(s): cb6f955

docs: rewrite README + add suspension disclaimer

Browse files

- Add prominent 'Read this before you deploy' section warning that HF
accounts are being suspended for always-on free-tier agent Spaces;
the Cloudflare keep-alive worker is the likely trigger. Recommend a
throwaway account or paid tier, and keeping off-platform backups.
- Update 'What You Get' to include /hm/logs, /hm/desktop-app-setup, /hmd.
- Add Hermes desktop app section (stable persisted session token,
/hm/desktop-app-setup, local-vs-remote feature split).
- Note OAuth + ~/.hermes persistence and config.yaml redaction in the
data-safety section, with the caveat that a suspended account loses
the backup dataset too.
- Add Ollama prefix + full provider-prefix list to quick start, plus an
Ollama subsection.
- Add debugging-without-SSH endpoints table (/hm/logs,
/hm/debug/model-options[-trace], /status).
- Update persistence details: atomic restore, hot-path pruning,
Tini + SIGTERM, file lock.
- Update architecture diagram/prose: Tini as PID 1, wait -n watchdog,
/hmd route, in-process log/debug viewers.
- Add suspension + desktop-app rows to troubleshooting table.
- Add HERMES_DASHBOARD_SESSION_TOKEN and WRITE_SECRETS_TO_ENV to the
optional secrets table.
- Rewrite credits paragraph to reflect this repo's actual contribution
(router, unified auth, stable token, OAuth persistence, log/debug
endpoints, security hardening) instead of 'minor tweaks.'

Files changed (1) hide show
  1. README.md +98 -31
README.md CHANGED
@@ -20,13 +20,28 @@ All credit goes to the original creators. This repo just wires them together.
20
 
21
  ---
22
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
23
  ## Quick Setup (5 minutes)
24
 
25
  ### 1. Duplicate the Space
26
 
27
  [![Duplicate this Space](https://huggingface.co/datasets/huggingface/badges/resolve/main/duplicate-this-space-xl.svg)](https://huggingface.co/spaces/f4b404/hermes?duplicate=true)
28
 
29
- Click the badge above, name your space β†’ pick **CPU Basic (Free)** β†’ and keep it public(else the .hf.space urls won't work).
30
 
31
  ### 2. Add Your Secrets
32
 
@@ -35,20 +50,21 @@ Go to **Settings β†’ Variables and secrets** in your new Space and add these:
35
  | Secret | What It's For | How to Get It |
36
  |--------|---------------|---------------|
37
  | `GATEWAY_TOKEN` | Your password for logging into the chat | Make up any strong password |
38
- | `HF_TOKEN` | Saves your chats and settings so they don't disappear | [Go here](https://huggingface.co/settings/tokens) β†’ Create new token β†’ Pick write|
39
  | `CLOUDFLARE_WORKERS_TOKEN` | Keeps your Space awake and lets Telegram work | [Create a token here](https://dash.cloudflare.com/profile/api-tokens) choose **Edit Cloudflare Workers** template |
40
 
41
  ### 3. Add an AI Provider
42
 
43
- Your agent needs an AI model to talk to. Add one of these API keys as a secret (or configure later in the dashboard):
44
 
45
- | Secret | Provider |
46
- |--------|----------|
47
- | `OPENAI_API_KEY` | OpenAI (GPT models) |
48
- | `ANTHROPIC_API_KEY` | Anthropic (Claude models) |
49
- | `MOONSHOT_API_KEY` | Moonshot / Kimi |
50
 
51
- Or configure manually later at `/hm/app/config` inside your Space.
 
 
52
 
53
  ### 4. Start It Up
54
 
@@ -60,8 +76,7 @@ HuggingMes + Hermes WebUI router listening on 0.0.0.0:7861
60
  ```
61
 
62
  Open your Space URL (`https://your-name.hf.space`) in a **new tab**, enter your `GATEWAY_TOKEN`, and start chatting.
63
- Open Hermes Dashboard from here (`https://f4b404-hermes.hf.space/hm/app`)
64
-
65
 
66
  > **Pro tip:** Bookmark the direct `*.hf.space` URL β€” it works better on mobile than the Hugging Face embed.
67
 
@@ -72,18 +87,42 @@ Open Hermes Dashboard from here (`https://f4b404-hermes.hf.space/hm/app`)
72
  | URL | What It Is |
73
  |-----|------------|
74
  | `/` | **Chat UI** β€” main interface for talking to your agent |
75
- | `/hm` | Status dashboard β€” see what's running |
76
- | `/hm/app/` | Settings β€” add AI models, set up cron jobs, manage profiles |
77
- | `/v1/*` | API endpoint β€” connect other apps to your agent |
78
- | `/telegram` | Telegram bot (if you added `TELEGRAM_BOT_TOKEN`) |
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
79
 
80
  ---
81
 
82
- ## Your Data Is Safe
83
 
84
  When `HF_TOKEN` is set:
85
- - All your chats, files, settings, and agent memory are backed up to a **private** Hugging Face Dataset within seconds of each change (change-driven, capped at 60 s)
86
- - If the Space restarts, everything comes back exactly as you left it
 
 
 
 
87
 
88
  ---
89
 
@@ -92,15 +131,16 @@ When `HF_TOKEN` is set:
92
  | Problem | Fix |
93
  |---------|-----|
94
  | Login keeps looping | Open the Space URL in a new tab (Hugging Face iframe blocks cookies) |
95
- | Space goes to sleep after a few hours | Make sure `CLOUDFLARE_WORKERS_TOKEN` is set |
96
  | Agent doesn't reply to questions | Check that you added an AI provider API key |
97
  | Dashboard shows blank pages | Hard-refresh and clear service workers in browser dev tools |
 
98
 
99
  ---
100
 
101
  ## Want It on Your Phone?
102
 
103
- Use the same (`https://your-name.hf.space`) url in android and then you can install it as Progressive Web App(PWA) or just use the same url on any browser for normal chat using the web.
104
 
105
  ---
106
 
@@ -119,6 +159,18 @@ Use the same (`https://your-name.hf.space`) url in android and then you can inst
119
  | `SYNC_INTERVAL` | Backup cadence in seconds (default 600, range 60–86400) |
120
  | `HERMES_AGENT_VERSION` | Pin the upstream Hermes Agent base image to a specific tag for reproducibility (default `latest`) |
121
  | `BACKUP_DATASET_NAME` | Name of the private HF Dataset used for persistence (default `huggingmes-backup`) |
 
 
 
 
 
 
 
 
 
 
 
 
122
 
123
  ## Configure LLM Provider via Config Editor
124
 
@@ -206,15 +258,26 @@ mcp:
206
 
207
  `uvx` and `npx` are pre-installed in the image.
208
 
 
 
 
 
 
 
 
 
 
 
 
209
  ## Persistence Details
210
 
211
  When `HF_TOKEN` is set:
212
 
213
- * **On boot**, the Space downloads the latest snapshot from your private HF Dataset and restores it into `/opt/data/`.
214
- * **Every `SYNC_INTERVAL` seconds** (default 600), it detects state changes and uploads a new snapshot.
215
- * **On graceful shutdown** (SIGTERM), it does one final sync before exit.
216
 
217
- What gets backed up: chat sessions, agent memory, workspace files, profiles, skills, cron jobs, Hermes config. The dataset is private to your HF account.
218
 
219
  ## Architecture
220
 
@@ -224,17 +287,19 @@ Single port (7861) Node.js router fronts multiple backends:
224
  HF Space port 7861
225
  β”‚
226
  β–Ό
227
- health-server.js (router + auth + status page)
228
  β”‚
229
  β”œβ”€β–Ί / β†’ Hermes WebUI (127.0.0.1:8787)
230
- β”œβ”€β–Ί /hm β†’ HuggingMes status (in-process)
 
231
  β”œβ”€β–Ί /hm/app/* β†’ Hermes dashboard (127.0.0.1:9119) [SPA-rewritten]
 
232
  β”œβ”€β–Ί /v1/* β†’ Hermes gateway API (127.0.0.1:8642) [bearer auth]
233
  β”œβ”€β–Ί /telegram β†’ Telegram webhook (127.0.0.1:8765)
234
  └─► /health, /status β†’ in-process JSON
235
  ```
236
 
237
- `start.sh` boots Hermes Agent's gateway + dashboard + WebUI as subprocesses, then the router on top. `hermes-sync.py` runs the periodic HF Dataset upload loop. Cloudflare and Telegram setup runs once at boot if their respective secrets are set.
238
 
239
  ## Local Testing
240
 
@@ -252,16 +317,18 @@ docker run --rm -p 7861:7861 --env-file .env huggingmes-hermes-webui
252
 
253
  | Symptom | Cause / Fix |
254
  | --- | --- |
 
255
  | Build fails on `nousresearch/hermes-agent:latest` | Set `HERMES_AGENT_VERSION` to a specific tag and restart |
256
- | Container Running but `/` returns 502 | Hermes WebUI didn't bind. Check Logs tab for `webui.log` output β€” usually missing/wrong provider API key or LLM config |
257
  | `/v1/*` returns 401 | Need `Authorization: Bearer <GATEWAY_TOKEN>` header |
258
  | `/api/status` 404s in logs | Cosmetic β€” old browser tab polling. Ignored. |
259
  | Login loops on `/login` | Browser embedded in HF iframe blocks cookies. Open the Space in a new tab. |
260
  | Dashboard pages blank or 404 on refresh | Should be fixed by the SPA rewriter in health-server.js. Hard-refresh and unregister service worker if cached: DevTools β†’ Application β†’ Service Workers β†’ Unregister |
261
- | Space sleeps after a few hours | Free tier limitation. Add `CLOUDFLARE_WORKERS_TOKEN` to provision a keep-alive cron worker |
262
  | Telegram bot doesn't respond | HF Spaces blocks `api.telegram.org` egress. Add `CLOUDFLARE_WORKERS_TOKEN` to auto-provision an outbound proxy |
263
  | Two Spaces overwriting each other's backup | Set different `BACKUP_DATASET_NAME` on each |
264
  | Agent responds but cannot answer questions | No LLM provider configured. Add provider API keys and restart, or configure via `/hm/app/config` |
 
265
 
266
  ## Credits
267
 
@@ -269,8 +336,8 @@ docker run --rm -p 7861:7861 --env-file .env huggingmes-hermes-webui
269
  * **[@nesquena](https://github.com/nesquena)** for **[Hermes WebUI](https://github.com/nesquena/hermes-webui)** β€” the chat interface you actually see and use. Three-panel layout, SSE streaming, slash commands, profile management, theme system, mobile responsive design β€” all theirs.
270
  * **[@somratpro](https://github.com/somratpro)** for **[HuggingMes](https://github.com/somratpro/HuggingMes)** β€” the HF Space packaging, the HF Dataset backup engine (`hermes-sync.py`), the Cloudflare proxy and keepalive setup, the Telegram integration, and the gateway auth wrapper.
271
 
272
- This repo's only contribution is the integration layer: a Node.js router that fronts both UIs on a single HF Space port, unified auth where one `GATEWAY_TOKEN` gates everything, and minor tweaks to `start.sh` to launch hermes-webui alongside the existing HuggingMes processes. If you find this useful, star the upstream projects.
273
 
274
  ## License
275
 
276
- MIT β€” same as all upstream projects.
 
20
 
21
  ---
22
 
23
+ ## ⚠️ Read this before you deploy
24
+
25
+ **Hugging Face accounts are getting suspended for running this kind of always-on agent on free Spaces.** It is not hypothetical β€” people (myself included) have had Spaces flagged and accounts warned or suspended, sometimes with no warning and no usable appeal path.
26
+
27
+ This project runs Hermes Agent, a WebUI, and a Cloudflare keep-alive worker specifically to defeat the free-tier sleep timer. That is exactly the pattern Hugging Face's trust & safety team has been flagging as abuse of free compute. Treat it accordingly:
28
+
29
+ - **Do not deploy this on an account you cannot afford to lose.** Use a throwaway HF account, or pay for a Pro/Spaces Compute tier and follow their ToS. Do not put your main account, your models, your datasets, or your other Spaces at risk.
30
+ - **Free-tier always-on hosting of a personal agent is against the spirit (and increasingly the letter) of HF's ToS.** The Cloudflare keep-alive worker in this repo exists to keep a free Space awake 24/7 β€” that is the part most likely to trigger a suspension.
31
+ - **Your private backup Dataset may also be at risk.** If the account is suspended you can lose access to your chats, memory, and workspace along with the Space. Keep an off-platform backup if any of that matters to you.
32
+ - **I am not responsible if your account gets suspended.** You are. This is a personal project shared as-is; deploying it is your decision and your risk.
33
+
34
+ If you want a safer alternative, run the same stack on any cheap VPS ($2–5/mo) β€” the Dockerfile and `start.sh` work outside HF with minor env changes. See the discussion in the repo for migration notes.
35
+
36
+ ---
37
+
38
  ## Quick Setup (5 minutes)
39
 
40
  ### 1. Duplicate the Space
41
 
42
  [![Duplicate this Space](https://huggingface.co/datasets/huggingface/badges/resolve/main/duplicate-this-space-xl.svg)](https://huggingface.co/spaces/f4b404/hermes?duplicate=true)
43
 
44
+ Click the badge above, name your space β†’ pick **CPU Basic (Free)** β†’ and keep it public (else the `.hf.space` URLs won't work).
45
 
46
  ### 2. Add Your Secrets
47
 
 
50
  | Secret | What It's For | How to Get It |
51
  |--------|---------------|---------------|
52
  | `GATEWAY_TOKEN` | Your password for logging into the chat | Make up any strong password |
53
+ | `HF_TOKEN` | Saves your chats and settings so they don't disappear | [Go here](https://huggingface.co/settings/tokens) β†’ Create new token β†’ Pick write |
54
  | `CLOUDFLARE_WORKERS_TOKEN` | Keeps your Space awake and lets Telegram work | [Create a token here](https://dash.cloudflare.com/profile/api-tokens) choose **Edit Cloudflare Workers** template |
55
 
56
  ### 3. Add an AI Provider
57
 
58
+ Your agent needs an AI model to talk to. The simplest way is to set `LLM_MODEL` and `LLM_API_KEY` as secrets β€” `start.sh` parses the `provider/model` prefix and exports the right provider env var automatically:
59
 
60
+ ```
61
+ LLM_MODEL=openrouter/anthropic/claude-sonnet-4
62
+ LLM_API_KEY=sk-or-...
63
+ ```
 
64
 
65
+ Supported prefixes include `openrouter/`, `anthropic/`, `openai/`, `huggingface/` (`hf/`), `google/` (`gemini/`), `deepseek/`, `zai/` (`glm/`), `kimi-coding/` (`moonshot/`), `minimax/`, `nvidia/`, `xai/` (`grok/`), and `ollama/` (Session 2+).
66
+
67
+ Or set the provider-specific key directly (e.g. `ANTHROPIC_API_KEY`) and configure the model later at `/hm/app/config` inside your Space.
68
 
69
  ### 4. Start It Up
70
 
 
76
  ```
77
 
78
  Open your Space URL (`https://your-name.hf.space`) in a **new tab**, enter your `GATEWAY_TOKEN`, and start chatting.
79
+ Open the Hermes Dashboard from `https://your-name.hf.space/hm/app`.
 
80
 
81
  > **Pro tip:** Bookmark the direct `*.hf.space` URL β€” it works better on mobile than the Hugging Face embed.
82
 
 
87
  | URL | What It Is |
88
  |-----|------------|
89
  | `/` | **Chat UI** β€” main interface for talking to your agent |
90
+ | `/hm` | Status dashboard β€” see what's running, backup state, desktop-app token |
91
+ | `/hm/app/` | Hermes dashboard β€” add AI models, set up cron jobs, manage profiles, config editor |
92
+ | `/hm/logs` | In-browser log viewer (dashboard / gateway / webui logs) β€” no HF Pro SSH needed |
93
+ | `/hm/desktop-app-setup` | One-page setup guide for the Hermes desktop app with copy-paste token |
94
+ | `/hmd` | Passthrough to the dashboard for the Hermes desktop app (uses its own session token) |
95
+ | `/v1/*` | OpenAI-compatible API endpoint β€” connect other apps to your agent |
96
+ | `/telegram` | Telegram bot webhook (if you added `TELEGRAM_BOT_TOKEN`) |
97
+ | `/health` `/status` | Health probe + JSON status dump (public) |
98
+
99
+ ---
100
+
101
+ ## Connecting the Hermes Desktop App
102
+
103
+ The Hermes desktop app (v0.16.0+) can connect to your Space as a remote gateway. The session token is **stable across restarts**, so you configure once and it persists.
104
+
105
+ 1. Open `https://your-name.hf.space/hm/desktop-app-setup` β€” log in with `GATEWAY_TOKEN`. It shows the Remote Gateway URL and the session token, ready to copy-paste.
106
+ 2. In the desktop app: Settings β†’ Gateway β†’ Remote gateway.
107
+ - URL: `https://your-name.hf.space/hmd`
108
+ - Session token: paste from step 1.
109
+ 3. Verify: WebSocket connects, chat works, model picker loads.
110
+
111
+ The token is auto-generated on first boot and persisted to your HF Dataset. To pin your own value, set `HERMES_DASHBOARD_SESSION_TOKEN` as a Space Secret.
112
+
113
+ Note: the desktop app is a **chat-first thin client** β€” chat and settings work remotely; the file browser and terminal panel show your *local* machine. For remote file/terminal access, use the WebUI in a browser.
114
 
115
  ---
116
 
117
+ ## Your Data Is Safe (on the Space β€” see the disclaimer above)
118
 
119
  When `HF_TOKEN` is set:
120
+
121
+ - All your chats, files, settings, agent memory, OAuth tokens, and config are backed up to a **private** Hugging Face Dataset within seconds of each change (change-driven, capped at 60 s).
122
+ - If the Space restarts, everything comes back exactly as you left it β€” including OAuth logins done via the dashboard (Claude, ChatGPT, xAI, Nous Portal, etc.), since the entire `~/.hermes` directory is backed up.
123
+ - `config.yaml` is backed up too, with `model.api_key` stripped from the staged copy before upload β€” the real key comes from the process environment at runtime.
124
+
125
+ **Reminder:** the dataset lives on your HF account. If the account is suspended (see the disclaimer at the top), you can lose access to it along with the Space. Keep an off-platform copy of anything you can't afford to lose.
126
 
127
  ---
128
 
 
131
  | Problem | Fix |
132
  |---------|-----|
133
  | Login keeps looping | Open the Space URL in a new tab (Hugging Face iframe blocks cookies) |
134
+ | Space goes to sleep after a few hours | Make sure `CLOUDFLARE_WORKERS_TOKEN` is set β€” but note this is also what tends to trigger suspensions |
135
  | Agent doesn't reply to questions | Check that you added an AI provider API key |
136
  | Dashboard shows blank pages | Hard-refresh and clear service workers in browser dev tools |
137
+ | `/api/model/options` 500 | Known upstream issue; use `/hm/debug/model-options-trace` to see the traceback |
138
 
139
  ---
140
 
141
  ## Want It on Your Phone?
142
 
143
+ Use the same `https://your-name.hf.space` URL on Android, then install it as a Progressive Web App (PWA), or just use the URL in any mobile browser for normal chat.
144
 
145
  ---
146
 
 
159
  | `SYNC_INTERVAL` | Backup cadence in seconds (default 600, range 60–86400) |
160
  | `HERMES_AGENT_VERSION` | Pin the upstream Hermes Agent base image to a specific tag for reproducibility (default `latest`) |
161
  | `BACKUP_DATASET_NAME` | Name of the private HF Dataset used for persistence (default `huggingmes-backup`) |
162
+ | `HERMES_DASHBOARD_SESSION_TOKEN` | Pin the desktop-app session token to a known value (otherwise auto-generated and persisted) |
163
+ | `WRITE_SECRETS_TO_ENV` | Opt-in (Space Variable) β€” materialize provider keys from env into the dashboard's `.env` so they show up in the Env tab. Default off. |
164
+
165
+ ## Ollama Support
166
+
167
+ `LLM_MODEL=ollama/llama3` works out of the box. The `ollama/` prefix sets `CUSTOM_BASE_URL` to `http://127.0.0.1:11434/v1`, strips the prefix from the model name, and passes `LLM_API_KEY` through as `OPENAI_API_KEY` (Ollama ignores it).
168
+
169
+ Ollama is not bundled in the container. For a remote Ollama server:
170
+ ```
171
+ LLM_MODEL=ollama/llama3
172
+ CUSTOM_BASE_URL=http://your-ollama-host:11434/v1
173
+ ```
174
 
175
  ## Configure LLM Provider via Config Editor
176
 
 
258
 
259
  `uvx` and `npx` are pre-installed in the image.
260
 
261
+ ## Debugging Without HF Pro SSH
262
+
263
+ HF Free tier doesn't allow SSH. Browser-based debug endpoints (all gated by `GATEWAY_TOKEN`):
264
+
265
+ | URL | What |
266
+ |-----|------|
267
+ | `/hm/logs` | List and view `dashboard.log` / `gateway.log` / `webui.log`. Append `?tail=N` to limit lines. |
268
+ | `/hm/debug/model-options` | Probes the dashboard's `/api/model/options` and shows raw HTTP status/headers/body. |
269
+ | `/hm/debug/model-options-trace` | Runs `build_models_payload()` inline with a full Python traceback β€” reveals the cause of the 500. |
270
+ | `/status` | JSON dump of gateway/dashboard/webui connectivity, uptime, ports, telegram config, backup status. |
271
+
272
  ## Persistence Details
273
 
274
  When `HF_TOKEN` is set:
275
 
276
+ * **On boot**, the Space downloads the latest snapshot from your private HF Dataset and restores it into `/opt/data/` (atomic per-entry, with rollback on failure).
277
+ * **Every `SYNC_INTERVAL` seconds** (default 600), it detects state changes and uploads a new snapshot. The hot path prunes `node_modules`/`.venv`/`__pycache__` so it doesn't walk them every poll.
278
+ * **On graceful shutdown** (SIGTERM, forwarded by Tini), it does one final sync before exit. A file lock prevents the loop and the shutdown sync from racing.
279
 
280
+ What gets backed up: chat sessions, agent memory, workspace files, profiles, skills, cron jobs, OAuth tokens (`~/.hermes`), and Hermes `config.yaml` (with `model.api_key` redacted from the staged copy). `config.yaml`'s secret and the Telegram webhook secret are explicitly excluded from the upload. The dataset is private to your HF account.
281
 
282
  ## Architecture
283
 
 
287
  HF Space port 7861
288
  β”‚
289
  β–Ό
290
+ health-server.js (router + auth + status page + WS proxy)
291
  β”‚
292
  β”œβ”€β–Ί / β†’ Hermes WebUI (127.0.0.1:8787)
293
+ β”œβ”€β–Ί /hm, /hm/logs, β†’ HuggingMes status (in-process)
294
+ β”‚ /hm/debug/* + log/debug viewers
295
  β”œβ”€β–Ί /hm/app/* β†’ Hermes dashboard (127.0.0.1:9119) [SPA-rewritten]
296
+ β”œβ”€β–Ί /hmd/* β†’ Hermes dashboard (127.0.0.1:9119) [passthrough, desktop app]
297
  β”œβ”€β–Ί /v1/* β†’ Hermes gateway API (127.0.0.1:8642) [bearer auth]
298
  β”œβ”€β–Ί /telegram β†’ Telegram webhook (127.0.0.1:8765)
299
  └─► /health, /status β†’ in-process JSON
300
  ```
301
 
302
+ `start.sh` boots Hermes Agent's gateway + dashboard + WebUI as subprocesses under Tini (PID 1, forwards SIGTERM, reaps zombies), then the router on top. A `wait -n` watchdog kills the container if any child dies after boot, so a broken UI no longer hides behind a green `/health`. `hermes-sync.py` runs the periodic HF Dataset upload loop. Cloudflare and Telegram setup runs once at boot if their respective secrets are set.
303
 
304
  ## Local Testing
305
 
 
317
 
318
  | Symptom | Cause / Fix |
319
  | --- | --- |
320
+ | Account suspended / Space flagged | See the disclaimer at the top. Running always-on agents on free Spaces is being flagged as abuse. Use a throwaway account or a paid tier, or move to a VPS. |
321
  | Build fails on `nousresearch/hermes-agent:latest` | Set `HERMES_AGENT_VERSION` to a specific tag and restart |
322
+ | Container Running but `/` returns 502 | Hermes WebUI didn't bind. Check `/hm/logs` for `webui.log` β€” usually missing/wrong provider API key or LLM config |
323
  | `/v1/*` returns 401 | Need `Authorization: Bearer <GATEWAY_TOKEN>` header |
324
  | `/api/status` 404s in logs | Cosmetic β€” old browser tab polling. Ignored. |
325
  | Login loops on `/login` | Browser embedded in HF iframe blocks cookies. Open the Space in a new tab. |
326
  | Dashboard pages blank or 404 on refresh | Should be fixed by the SPA rewriter in health-server.js. Hard-refresh and unregister service worker if cached: DevTools β†’ Application β†’ Service Workers β†’ Unregister |
327
+ | Space sleeps after a few hours | Free tier limitation. Add `CLOUDFLARE_WORKERS_TOKEN` to provision a keep-alive cron worker. Note: this is also what tends to trigger suspensions. |
328
  | Telegram bot doesn't respond | HF Spaces blocks `api.telegram.org` egress. Add `CLOUDFLARE_WORKERS_TOKEN` to auto-provision an outbound proxy |
329
  | Two Spaces overwriting each other's backup | Set different `BACKUP_DATASET_NAME` on each |
330
  | Agent responds but cannot answer questions | No LLM provider configured. Add provider API keys and restart, or configure via `/hm/app/config` |
331
+ | Desktop app can't connect | Token rotated? Re-fetch from `/hm/desktop-app-setup`. WebSocket Origin must match β€” Electron `file://` and `localhost:port` origins are allowed. |
332
 
333
  ## Credits
334
 
 
336
  * **[@nesquena](https://github.com/nesquena)** for **[Hermes WebUI](https://github.com/nesquena/hermes-webui)** β€” the chat interface you actually see and use. Three-panel layout, SSE streaming, slash commands, profile management, theme system, mobile responsive design β€” all theirs.
337
  * **[@somratpro](https://github.com/somratpro)** for **[HuggingMes](https://github.com/somratpro/HuggingMes)** β€” the HF Space packaging, the HF Dataset backup engine (`hermes-sync.py`), the Cloudflare proxy and keepalive setup, the Telegram integration, and the gateway auth wrapper.
338
 
339
+ This repo's contribution is the integration layer: a Node.js router that fronts both UIs on a single HF Space port, unified auth where one `GATEWAY_TOKEN` gates everything, a stable persisted session token for the desktop app, OAuth/token persistence across restarts, browser-based log/debug endpoints for no-SSH debugging, and a security/robustness hardening pass (WebSocket auth, Origin validation, atomic restore, Tini + watchdog, secret-redaction on backup). If you find this useful, star the upstream projects.
340
 
341
  ## License
342
 
343
+ MIT β€” same as all upstream projects.