Skip to content
TheChatArchiveThe Chat Archive
x-ai/grok-4.5· unknownHugging Face ibragim-bad/swe_rebench_07_2026_trajectories

ISSUE DESCRIPTION Hermes Desktop 0.4.3 remote mode fails against working local Hermes…

  1. 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 on 127.0.0.1:8642, and successfully handles OpenAI-compatible API requests via curl.

    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:

    model:
      default: gemma4:e4b
      provider: custom
      base_url: http://127.0.0.1:11434/v1
    
    The Hermes API server is enabled:
    
    API_SERVER_ENABLED=true
    API_SERVER_HOST=127.0.0.1
    API_SERVER_PORT=8642
    API_SERVER_KEY=<redacted>
    
    The backend works correctly via curl:
    
    KEY="$(grep '^API_SERVER_KEY=' ~/.hermes/.env | cut -d= -f2- | tr -d '\"'\'' ')"
    
    curl -i http://127.0.0.1:8642/v1/models \
      -H "Authorization: Bearer $KEY"
    
    Expected/actual result from curl:
    
    {
      "object": "list",
      "data": [
        {
          "id": "hermes-agent",
          "object": "model",
          "owned_by": "hermes",
          "root": "hermes-agent"
        }
      ]
    }
    
    Chat completions also work:
    
    curl -sS http://127.0.0.1:8642/v1/chat/completions \
      -H "Authorization: Bearer $KEY" \
      -H "Content-Type: application/json" \
      -d '{
        "model": "hermes-agent",
        "messages": [
          {"role": "user", "content": "Respond exactly: ok"}
        ]
      }'
    
    This returns a valid response from Hermes Agent, and Ollama confirms that the local model is loaded on GPU:
    
    gemma4:e4b    11 GB    100% GPU    CONTEXT 65536
    Problem in Hermes Desktop
    
    When using Hermes Desktop 0.4.3 and selecting:
    
    Connect to Remote Hermes
    
    with:
    
    URL: http://127.0.0.1:8642
    API key: <API_SERVER_KEY>
    
    or:
    
    URL: http://127.0.0.1:8642/v1
    API key: <API_SERVER_KEY>
    
    the GUI does not connect reliably.
    
    Observed GUI errors include:
    
    Could not reach Hermes at this URL. Check the URL and API key.
    
    and:
    
    Error: API server returned 404: 404: Not Found
    
    and:
    
    Error: API request failed: connect ECONNREFUSED 127.0.0.1:8642
    Logs
    
    Hermes Desktop log includes:
    
    [CRON] remote list failed: HTTP 404
    Error occurred in handler for 'send-message': Error: API server returned 404: 404: Not Found
    
    At one point, Hermes Desktop also attempted to spawn an old local Hermes installation that no longer exists:
    
    [MAIN UNCAUGHT] Error: spawn /home/patrick/.hermes/hermes-agent/venv/bin/python ENOENT
    
    spawnargs: [
      '/home/patrick/.hermes/hermes-agent/hermes',
      'gateway'
    ]
    
    This suggests that even after choosing remote mode, Hermes Desktop may still retain or use stale local-install state under ~/.hermes/hermes-agent.
    
    Route testing
    
    The local Hermes API server exposes these routes successfully:
    
    GET /health       -> 200 OK
    GET /v1/health    -> 200 OK
    GET /v1/models    -> 200 OK
    POST /v1/chat/completions -> 200 OK
    
    But these routes return 404:
    
    GET /models       -> 404 Not Found
    GET /api/health   -> 404 Not Found
    
    This may indicate that Hermes Desktop remote mode expects routes that are not provided by the Hermes Agent OpenAI-compatible API server.
    
    Expected behavior
    
    Hermes Desktop remote mode should work with an existing Hermes Agent API server when provided:
    
    URL: http://127.0.0.1:8642
    API key: API_SERVER_KEY
    
    or clearly document whether the required URL should be:
    
    http://127.0.0.1:8642
    
    or:
    
    http://127.0.0.1:8642/v1
    
    It should then list the exposed remote model:
    
    hermes-agent
    
    and send chat requests through the existing Hermes API server.
    
    Actual behavior
    
    Hermes Desktop does not list hermes-agent, fails validation, returns 404, or tries to spawn a stale local Hermes installation under:
    
    ~/.hermes/hermes-agent
    
    even though the remote Hermes API server is alive and working via curl.
    
    Why this appears to be a Hermes Desktop issue
    
    The backend works outside Hermes Desktop:
    
    curl /v1/models succeeds.
    curl /v1/chat/completions succeeds.
    Hermes Agent CLI works.
    Ollama backend works.
    GPU model loading works.
    The only failing component is Hermes Desktop remote frontend mode.
    
    Request
    
    Please clarify or fix Hermes Desktop remote mode behavior:
    
    Which URL format is expected for remote Hermes?
    http://host:8642
    or http://host:8642/v1
    Which endpoint does Hermes Desktop use to validate remote connectivity?
    Should remote mode depend on routes like /models, /api/health, /cron, or local gateway-management endpoints?
    Can Hermes Desktop avoid trying to spawn ~/.hermes/hermes-agent/... when the user explicitly chooses remote mode?
    Can stale local install state be ignored or reset when using remote mode?
    
    
    thanks!!!
    
    ## Interface
    
    No new interfaces are introduced.
    
    # ADDITIONAL ADVICE
    
    Since you are given a git repository, you can use git commands to simplify your work.
    For example, if you made a mistake and want to revert your changes, you can use `git checkout <file>` to restore the file to its original state.
    You can also reset all changes in the repository using `git reset --hard` command.
    Additionally, you can use `git stash` and `git stash pop` to temporarily save your changes and restore them later.
    Finally, you can see the changes that you've made (which will be submitted when you call `submit`) using `git status` or `git diff` commands.
    However you don't need to use `git add` or `git commit` before submitting your changes. In fact,
    `submit` only submits currently unstaged changes because it uses `git diff` to get the changes that need to be submitted.
    
    # CHECKLIST
    
    Before submitting your solution, please go over the following checklist and make sure you've done everything:
    - [ ] If an error was reported in the issue description, I have successfully reproduced it.
    - [ ] If an error was reported in the issue description, I have confirmed that my fix resolves the error.
    - [ ] I have thought about edge cases and made sure my fix handles them as well.
    - [ ] I have run existing tests in the repository that might have been affected by the change I made and confirmed that they pass.
    I want you to list every bullet from this checklist and write your reasoning for why you think you did it or didn't need to.
    
    Repository has been uploaded and your shell is currently at the repository root. Time to solve the issue!
    
    (Current directory: /hermes-desktop, current file: none) bash-$
    
  2. Assistant

    I'll start by exploring the repository structure and locating how remote mode connects to the Hermes API.

  3. Assistant

    I'll search the codebase for remote-mode connectivity, URL handling, and the endpoints that validate the Hermes API.

  4. Assistant

    rg is not available, let me use grep instead.

  5. Assistant

    Inspecting hermes.ts and related connection-test code for remote URL and endpoint handling.

  6. Assistant

    Let me read the full hermes.ts file focusing on the key parts - getApiUrl, testRemoteConnection, health checks, and chat.

  7. Assistant

    Let me continue reading the health check and testRemoteConnection parts.

  8. Assistant

    I'll dig into the failing endpoints and the tests that cover remote connectivity.

  9. Assistant

    I'll find where the 404 error is produced and how gateway/session routes are called in remote mode.

  10. Assistant

    Let me read the send-message handler and the chat response 404 path more carefully. Also startGateway - the issue says it tries to spawn local hermes even in remote mode.

  11. Assistant

    I'll review app startup and other callers that might still spawn a local gateway in remote mode.

  12. Assistant

    Let me look at git log and any open PR/issue notes in the repo. Also look at connection-config tests and any recent changes related to URL normalization.

  13. Assistant

    Next I'll inspect sessions, models, and other remote API usage for mismatched paths.

  14. Assistant

    Checking git history and any agent notes for known remote-connection fixes.

  15. Assistant

    Let me read the hermes-agent skill - it might document the API.

  16. Assistant

    Let me search for API server docs in the skill file.

  17. Assistant

    Let me read the API server section in detail.

  18. Assistant

    I'll inspect how the chat UI resolves models in remote mode and how Settings tests connectivity.

  19. Assistant

    Looking at getModelConfig - in remote mode, desktop reads local ~/.hermes config for model name. When user has local config with model gemma4:e4b, it sends that as model to hermes API.

  20. Assistant

    I'll scan git branches and recent PRs related to this connectivity problem.

  21. Assistant

    I'll inspect model listing, gateway startup paths, and any existing URL normalization helpers.

  22. Assistant

    Looking at index.ts handle start-gateway - does it guard remote?

  23. Assistant

    I'll check how connection config is stored and whether URL hints need updating.

  24. Assistant

    I'll implement URL normalization, multi-endpoint health checks, gateway spawn guards, and remote model listing.

  25. Assistant

    Implementing the core URL normalization and connectivity fixes in hermes.ts.

  26. Assistant

    The edit landed in the wrong file — I'll restore index.ts and apply the changes to hermes.ts.

  27. Assistant

    Good, index.ts is restored and hermes.ts is open. Now edit hermes.ts properly.

  28. Assistant

    Updating the health check, connection test, gateway guards, and remote model listing.

  29. Assistant

    Let me read around those lines and update them.

  30. Assistant

    I'll replace isApiServerReady and later the tip of the file for test and gateway.

  31. Assistant

    Updating testRemoteConnection, gateway guards, and adding remote model fetch.

  32. Assistant

    Also need to find startGateway definition

  33. Assistant

    I'll update startGateway, testRemoteConnection, restartGateway and add fetchRemoteModels.

  34. Assistant

    Now replace testRemoteConnection and restartGateway, and add fetchRemoteModels.

  35. Assistant

    I may have duplicated isApiReady. Let me check.

  36. Assistant

    Checking for remaining uses of stripTrailingSlashes, then updating index.ts and config.ts.

  37. Assistant

    Removing the unused helper, then wiring config and IPC handlers.

  38. Assistant

    Moving URL normalization into config.ts to avoid circular imports.

  39. Assistant

    I may have removed the ConnectionConfig interface — checking the file.

  40. Assistant

    Yes — ConnectionConfig is missing. Restoring it and normalizing the URL on save.

  41. Assistant

    Normalizing the URL when reading and writing connection config.

  42. Assistant

    There's a leftover duplicate from the old function — removing it.

  43. Assistant

    The closing brace is missing on resolveConnectionApiKeyUpdate — fixing that.

  44. Assistant

    Updating hermes.ts to import normalizeRemoteBaseUrl from config.

  45. Assistant

    The header is corrupted — I'll rewrite the top of hermes.ts cleanly.

  46. Assistant

    I need to fix lines 1-95 by replacing the broken section.

  47. Assistant

    There's still a duplicate resolveRemoteApiKey — cleaning that up.

  48. Assistant

    Remove the duplicate resolveRemoteApiKey function.

  49. Assistant

    Updating IPC handlers in index.ts next.

  50. Assistant

    Updating gateway and model handlers for remote mode.

  51. Assistant

    Update get-model-config and list-models for remote mode.

  52. Assistant

    Update list-models to include remote models.

  53. Assistant

    Refining remote model selection so we don't send the local Ollama id to the Hermes API.

  54. Assistant

    sendMessageViaApi still reads local config directly — fixing that so remote mode uses the API model id.

  55. Assistant

    I'll add a helper resolveChatModel in hermes.ts

  56. Assistant

    I'll add a resolveChatModelName helper before sendMessageViaApi.

  57. Assistant

    I have duplicate controller and still using mc.model. Fix that.

  58. Assistant

    The file has partial edits — I'll read and fix the broken sections.

  59. Assistant

    I need to fix the duplicate body lines.

  60. Assistant

    Checking for leftover issues and fixing the mc unused variable.

  61. Assistant

    Removing the unused mc variable.

  62. Assistant

    Updating the URL hint strings and running a verification script.

  63. Assistant

    I dropped the remoteApiKey key — restoring it.

  64. Assistant

    Checking whether welcome.ts keys still match the original shape.

  65. Assistant

    Writing a verification script and running the existing tests.

  66. Assistant

    Core fix verified. Running the unit tests next.

  67. Assistant

    Moving normalizeRemoteBaseUrl into utils.ts so mocked config imports don't break tests.

  68. Assistant

    Creating a small shared module that won't be mocked by the existing tests.

  69. Assistant

    The header got corrupted again — repairing remote-url.ts and the top of hermes.ts.

  70. Assistant

    Header looks good — running the tests again.

  71. Assistant

    Tests and typecheck passed. Running the full suite next.

  72. Assistant

    All 435 tests passed. Verifying the actual hermes module against a mock server.

  73. Assistant

    I'll use tsx to exercise the real module against the mock server.

  74. Assistant

    Need to wrap in async main

  75. Assistant

    Integration passed. Doing a final review of the diff.

  76. Assistant

    Cleaning a minor blank line and confirming the new file is present.

  77. Assistant

    Untracked files won't be picked up by git diff on submit — inlining the helper into existing tracked files.

  78. Assistant

    Updating the integration script and verifying the files.

  79. Assistant

    Running the full test suite one last time, then submitting.

Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.