Skip to content

fix(gateway): include resolved node path in systemd unit - #1767

Merged
teknium1 merged 1 commit into
NousResearch:mainfrom
sai-samarth:fix/systemd-node-path-whatsapp
Mar 17, 2026
Merged

fix(gateway): include resolved node path in systemd unit#1767
teknium1 merged 1 commit into
NousResearch:mainfrom
sai-samarth:fix/systemd-node-path-whatsapp

Conversation

@sai-samarth

Copy link
Copy Markdown
Contributor

Summary

  • include the directory of the resolved node binary when generating the gateway systemd unit PATH
  • keep the existing venv and node_modules/.bin entries unchanged
  • add a regression test covering Node installed under ~/.nvm/.../bin

Problem

On Linux, if Node is installed via nvm, hermes gateway install can generate a systemd unit whose PATH omits the actual Node binary directory. When WhatsApp is enabled, the gateway service then fails the WhatsApp bridge requirement check and can enter a restart loop.

Reproduction

This was reproduced on a fresh Ubuntu 24.04 install with upstream main, Node installed only through nvm, and:

WHATSAPP_ENABLED=true
WHATSAPP_MODE=bot

Then:

hermes gateway install
systemctl --user restart hermes-gateway

The generated unit PATH omitted ~/.nvm/.../bin, node was missing under the service environment, and the gateway crash-looped.

Fix

When generating the systemd unit, resolve node from the current install environment and append its parent directory to the service PATH if present.

Test plan

  • ./venv/bin/python -m pytest tests/hermes_cli/test_gateway_service.py -q
  • verified the clean repro separately on Ubuntu 24.04 before the fix

Closes #1766

@teknium1
teknium1 merged commit df74f86 into NousResearch:main Mar 17, 2026
angelburgosrosado pushed a commit to angelburgosrosado/hermes-agent that referenced this pull request Apr 27, 2026
…e-path-whatsapp

Clean fix for nvm/non-standard Node.js paths in systemd units. Merges cleanly.
02356abc pushed a commit to 02356abc/hermes-agent that referenced this pull request May 14, 2026
…e-path-whatsapp

Clean fix for nvm/non-standard Node.js paths in systemd units. Merges cleanly.
gweeteve pushed a commit to gweeteve/hermes-agent that referenced this pull request Jun 2, 2026
…e-path-whatsapp

Clean fix for nvm/non-standard Node.js paths in systemd units. Merges cleanly.
waefrebeorn pushed a commit to waefrebeorn/slermes that referenced this pull request Jul 2, 2026
…e-path-whatsapp

Clean fix for nvm/non-standard Node.js paths in systemd units. Merges cleanly.
melon-xf added a commit to melon-xf/hermes-agent that referenced this pull request Sep 3, 2026
…e-path-whatsapp

Clean fix for nvm/non-standard Node.js paths in systemd units. Merges cleanly.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: hermes gateway systemd unit omits nvm Node path and crash-loops with WhatsApp enabled

2 participants