Environment
- Hardware: NVIDIA DGX Spark (ARM64, NVIDIA GB10 GPU)
- OS: Ubuntu 24.04, X11 (DISPLAY=:1)
- Hermes version: 0.18.2 (build 0b2907f)
- Electron version: 40.10.2
- Model provider: DeepSeek, LM Studio
- Desktop launch method:
hermes desktop (CLI)
Symptoms
After hermes update (from ~0.15.x to 0.18.x), Hermes Desktop exhibits the following issues:
- Electron window opens, backend (
hermes serve) starts successfully (visible in desktop.log)
- User can type in the chat input, and the agent starts executing tool calls (task timer is visible)
- Agent response text NEVER appears in the chat window — only tool execution progress is shown
- After first failed response, a second message attempt shows "Gateway is not connected" error
- The Desktop window must be restarted to clear the error
What works correctly
hermes serve backend starts and runs normally
hermes dashboard (Web UI in browser) works perfectly — same backend, same model
hermes chat (CLI) works perfectly
- All gateway platforms (QQ Bot, Feishu) work fine
Root Cause Analysis
The issue is in the Electron Desktop's gateway WebSocket connection mechanism introduced with hermes serve as the backend.
How it works (v0.18.x):
hermes desktop spawns the Electron binary
- Electron's
startHermes() → spawns hermes serve --port 0 as a child process (auto-assigned random port)
- The backend announces readiness via stdout
HERMES_BACKEND_READY port=XXXXX
- Desktop frontend calls
hermes:gateway:ws-url IPC to get the WebSocket URL
- Frontend establishes a WebSocket connection to
ws://127.0.0.1:PORT/api/ws?token=...
- The agent's streaming responses are pushed through this WebSocket
The bug:
- The
hermes:api REST IPC works fine (session list, tool execution → timer visible)
- The WebSocket connection either fails to establish or drops after the first request
- When agent tries to stream response →
ECONNRESET / socket hang up
- Frontend shows error "Gateway is not connected"
- The old backend port becomes stale when desktop is restarted or respawns
Key log evidence:
Error occurred in handler for 'hermes:api': Error: connect ECONNREFUSED 127.0.0.1:44583
[hermes] [boot] Hermes backend is ready. Finalizing desktop startup
[hermes] [renderer] render-process-gone reason=clean-exit exitCode=0
The issue is NOT GPU-related (already confirmed with --no-sandbox --disable-gpu --in-process-gpu).
Additional issue on DGX Spark:
Electron v40.10.2 has GPU process crash on this platform due to NVIDIA ARM64 GPU incompatibility:
FATAL:content/browser/gpu/gpu_data_manager_impl_private.cc:415
GPU process isn't usable. Goodbye.
This was worked around with --disable-gpu --disable-software-rasterizer --in-process-gpu flags via desktop.electron_flags config. However, even with this fix, the WS disconnection issue persists independently.
Suggested Investigation
- Check
getGatewayWsUrl() → freshGatewayWsUrl() in apps/desktop/electron/main.ts — verify the WS URL returned to frontend matches the actual hermes serve port
- Check whether
hermes serve's WebSocket endpoint at /api/ws correctly authenticates the token passed from Electron
- Investigate if the WS connection is established via the Electron main process proxy or direct from renderer — the
hermes:api IPC works, suggesting the REST API is fine but the WS path is different
- The
connection.json at app.getPath("userData")/connection.json with {"mode":"local"} should be sufficient for local mode — verify it's not causing WS issues
- Check if
hermes gateway run (spawned as subprocess of hermes serve) handles WS differently from the old hermes dashboard backend
Workaround
Using hermes dashboard (Web UI via browser) instead of the Electron Desktop completely avoids the issue.
Environment
hermes desktop(CLI)Symptoms
After
hermes update(from ~0.15.x to 0.18.x), Hermes Desktop exhibits the following issues:hermes serve) starts successfully (visible in desktop.log)What works correctly
hermes servebackend starts and runs normallyhermes dashboard(Web UI in browser) works perfectly — same backend, same modelhermes chat(CLI) works perfectlyRoot Cause Analysis
The issue is in the Electron Desktop's gateway WebSocket connection mechanism introduced with
hermes serveas the backend.How it works (v0.18.x):
hermes desktopspawns the Electron binarystartHermes()→ spawnshermes serve --port 0as a child process (auto-assigned random port)HERMES_BACKEND_READY port=XXXXXhermes:gateway:ws-urlIPC to get the WebSocket URLws://127.0.0.1:PORT/api/ws?token=...The bug:
hermes:apiREST IPC works fine (session list, tool execution → timer visible)ECONNRESET/socket hang upKey log evidence:
The issue is NOT GPU-related (already confirmed with
--no-sandbox --disable-gpu --in-process-gpu).Additional issue on DGX Spark:
Electron v40.10.2 has GPU process crash on this platform due to NVIDIA ARM64 GPU incompatibility:
This was worked around with
--disable-gpu --disable-software-rasterizer --in-process-gpuflags viadesktop.electron_flagsconfig. However, even with this fix, the WS disconnection issue persists independently.Suggested Investigation
getGatewayWsUrl()→freshGatewayWsUrl()inapps/desktop/electron/main.ts— verify the WS URL returned to frontend matches the actualhermes serveporthermes serve's WebSocket endpoint at/api/wscorrectly authenticates the token passed from Electronhermes:apiIPC works, suggesting the REST API is fine but the WS path is differentconnection.jsonatapp.getPath("userData")/connection.jsonwith{"mode":"local"}should be sufficient for local mode — verify it's not causing WS issueshermes gateway run(spawned as subprocess ofhermes serve) handles WS differently from the oldhermes dashboardbackendWorkaround
Using
hermes dashboard(Web UI via browser) instead of the Electron Desktop completely avoids the issue.