Skip to content

bug(gateway): /update hard-fails with ' command not found on PATH' even when Hermes is running #1049

@atuida

Description

@atuida

Bug Description

The gateway /update flow currently hard-fails if shutil.which("hermes") returns nothing, even though Hermes is already running.

In gateway/run.py:

hermes_bin = shutil.which("hermes")
if not hermes_bin:
    return "✗ `hermes` command not found on PATH."

This makes /update brittle in setups where Hermes is launched via a venv/module/launcher and the hermes executable is not on PATH for the gateway process.

Steps to Reproduce

  1. Run Hermes gateway from an environment where the app works normally but the hermes CLI executable is not on PATH for that process.
  2. Trigger the gateway /update command.
  3. Observe the failure message.

Expected Behavior

/update should still work when Hermes is already running, or it should have a fallback resolution strategy (current Python executable/module invocation, configured install path, etc.) instead of assuming hermes is on PATH.

Actual Behavior

Gateway returns:

✗ `hermes` command not found on PATH.

Why this matters

This is confusing for users because Hermes is clearly running already. The command fails due to PATH resolution, not because Hermes is unavailable.

Suggested Fixes

  • Fall back to sys.executable -m hermes_cli.main (or equivalent module entrypoint) when shutil.which("hermes") fails.
  • Alternatively persist the launch command / install path and reuse that for self-update.
  • Improve the error message so it explains that the problem is update-command path resolution, not Hermes availability.

Environment

  • Seen from Telegram gateway session
  • Repo: NousResearch/hermes-agent
  • Relevant file: gateway/run.py around the /update handler

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions