Skip to content

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

Merged
teknium1 merged 1 commit intoNousResearch: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 intoNousResearch: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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants