ISSUE DESCRIPTION Hermes Desktop 0.4.3 remote mode fails against working local Hermes…
- User
ISSUE DESCRIPTION
Hermes Desktop 0.4.3 remote mode fails against working local Hermes API server
Bug: Hermes Desktop 0.4.3 fails to connect reliably to existing local Hermes API server
Summary
Hermes Desktop 0.4.3 fails to work as a frontend for an already-running local Hermes Agent API server.
The Hermes Agent backend is installed separately under
/opt/hermes-agent, runs correctly with Python 3.12, exposes the API server on127.0.0.1:8642, and successfully handles OpenAI-compatible API requests viacurl.However, Hermes Desktop fails to connect or send messages in remote mode. It either reports that it cannot reach the server, returns
404: Not Found, or tries to spawn a removed/incorrect local Hermes installation under~/.hermes/hermes-agent.Environment
- OS: Ubuntu 24.04.3 LTS
- Kernel: Linux 6.17.0-14-generic x86_64
- Desktop: KDE/Plasma
- Hermes Agent version: 0.14.0
- Hermes Desktop version: 0.4.3
- Hermes Agent install path:
/opt/hermes-agent - Hermes config/home:
~/.hermes - Python used by working Hermes Agent: Python 3.12.3
- GPU: NVIDIA RTX 5060 Ti, 16 GB VRAM
- Model backend: Ollama
- Ollama model:
gemma4:e4b - Ollama API endpoint:
http://127.0.0.1:11434/v1 - Hermes API server:
http://127.0.0.1:8642
Working backend configuration
Hermes Agent works correctly from CLI/API with this model configuration:
yaml Assistant
Now let's implement fixes. First, the
getApiUrl()normalization for a trailing/v1, and guardstart-gateway/stop-gateway/gateway-statusIPC handlers against pure remote mode.Assistant
Now let's check
set-platform-enabledandset-env/set-model-confighandlers which callrestartGatewayguarded byisGatewayRunning()— since we changedgateway-statussemantics but notisGatewayRunning()itself (from hermes.ts), those remain fine since they still call the realisGatewayRunning()(imported directly), not the IPC layer. Let's verify.Assistant
Good, those are fine since
isGatewayRunning()from hermes.ts returns false when no local pid, sorestartGatewaywon't fire in remote mode anyway. Now let's fix the URL normalization forgetApiUrl().Assistant
No python but node is available. I'll use the
replaceeditor command directly for edits instead.Assistant
Now update
testRemoteConnectionto normalize the URL used for building the health-check target so it's consistent withgetApiUrl().Assistant
Unused now — let's remove it to avoid lint errors (unused variable).
Assistant
Duplicate line 91-92, fix:
Assistant
Now let's check whole file compiles - run typescript check / build.
Assistant
No type errors. Let's also run eslint on changed files.
Assistant
Only pre-existing prettier warnings unrelated to our changes. Good, no new errors introduced. Now let's write a quick script to verify
normalizeRemoteBaseUrllogic andgetApiUrlbehavior.Assistant
All variants normalize correctly. Now let's check the existing test suite for hermes.ts / related files to make sure nothing is broken.
Assistant
Let's run the full test suite (or at least relevant ones) to make sure nothing broke.
Assistant
All passing. Now let's run the full test suite to be thorough.
Assistant
All 435 tests pass. Now let's check the ipc-handlers.test.ts to see if it tests
start-gateway/gateway-statusbehavior, to make sure our edit matches expectations.Assistant
That test just checks handler names exist, not their internal logic. Good, no conflicts. Now let's create a small reproduce script simulating the double
/v1bug scenario to confirm fix resolves it.Assistant
The fix confirms
getApiUrl()correctly strips the/v1suffix, avoiding the double/v1/v1/chat/completions404 bug. Now let's view final diff.Assistant
Good, both Welcome and Settings use
testRemoteConnectionandsetConnectionConfigIPC calls which route through our fixedhermes.tslogic. Now let's double check thesetConnectionConfigipc handler in index.ts and preload forremoteUrltype/trim handling.Assistant
That's fine as-is; normalization happens centrally. Let's view final diff summary and run full test + typecheck once more.
Assistant
All 435 tests still pass, typecheck clean. Let's clean up temp files.
Assistant
Good, no leftover test files (grep found nothing, hence exit code 1). Let's do a final review of the diff.
Assistant
Now let's go through the checklist explicitly.
Checklist review:
- Reproduced the error — I reproduced the double-
/v1bug (the reported404: Not Found/ connection failures) with a targeted test showing that enteringhttp://127.0.0.1:8642/v1as the remote URL causedgetApiUrl()to return a URL that, when the fixed/v1/chat/completionssuffix was appended, producedhttp://127.0.0.1:8642/v1/v1/chat/completions— a route that doesn't exist on the server (matching the 404s from the issue). I also traced thespawn ... hermes-agent/venv/bin/python ENOENTerror to thestart-gatewayIPC handler inindex.ts, which only special-cased SSH mode and fell through to spawning a local Hermes install even when the user was in pure "remote" HTTP mode.
- Reproduced the error — I reproduced the double-
Assistant
This is the complete summary of the change. Let me go through the checklist:
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.