Skip to content

fix(gateway): fall back to sys.executable -m hermes_cli.main when hermes not on PATH#1052

Closed
teyrebaz33 wants to merge 1 commit into
NousResearch:mainfrom
teyrebaz33:fix/update-command-path-fallback
Closed

fix(gateway): fall back to sys.executable -m hermes_cli.main when hermes not on PATH#1052
teyrebaz33 wants to merge 1 commit into
NousResearch:mainfrom
teyrebaz33:fix/update-command-path-fallback

Conversation

@teyrebaz33

Copy link
Copy Markdown
Contributor

Fixes #1049

Problem

/update hard-failed with hermes command not found on PATH. even when Hermes was already running. This happens in setups where Hermes is launched via a venv or module invocation and the hermes symlink is not on PATH for the gateway process.

Fix

Extracts a _resolve_hermes_bin() helper that tries two strategies in order:

  1. shutil.which("hermes") — standard PATH lookup (existing behavior)
  2. sys.executable -m hermes_cli.main — fallback when hermes_cli is importable but the symlink is missing from PATH

If both fail, returns a clear error message explaining that the problem is path resolution, not Hermes availability, and suggests running hermes update manually.

Changes

  • gateway/run.py: add _resolve_hermes_bin() helper, use it in _handle_update_command
  • tests/gateway/test_update_command.py: update existing test + add 4 new tests covering fallback behavior

…mes not on PATH

When shutil.which('hermes') returns None, _resolve_hermes_bin() now tries
sys.executable -m hermes_cli.main as a fallback. This handles setups where
Hermes is launched via a venv or module invocation and the hermes symlink is
not on PATH for the gateway process.

Fixes NousResearch#1049
teknium1 added a commit that referenced this pull request Mar 15, 2026
Follow up on salvaged PR #1052.
Restore current-main gateway lifecycle handling after conflict resolution and
adapt the update fallback to use shell-quoted argv parts safely.
teknium1 added a commit that referenced this pull request Mar 15, 2026
Salvaged PR #1052 onto current main with the contributor commit preserved plus a small follow-up for current-main conflict resolution and safe command quoting.
@teknium1

Copy link
Copy Markdown
Contributor

Merged via PR #1355. Your substantive /update path-resolution fix was cherry-picked onto current main with authorship preserved, plus a small follow-up for the current-main gateway conflict and safe command quoting. Thanks for the contribution.

@teknium1 teknium1 closed this Mar 15, 2026
angelburgosrosado pushed a commit to angelburgosrosado/hermes-agent that referenced this pull request Apr 27, 2026
Follow up on salvaged PR NousResearch#1052.
Restore current-main gateway lifecycle handling after conflict resolution and
adapt the update fallback to use shell-quoted argv parts safely.
angelburgosrosado pushed a commit to angelburgosrosado/hermes-agent that referenced this pull request Apr 27, 2026
…ec1096a3

Salvaged PR NousResearch#1052 onto current main with the contributor commit preserved plus a small follow-up for current-main conflict resolution and safe command quoting.
02356abc pushed a commit to 02356abc/hermes-agent that referenced this pull request May 14, 2026
Follow up on salvaged PR NousResearch#1052.
Restore current-main gateway lifecycle handling after conflict resolution and
adapt the update fallback to use shell-quoted argv parts safely.
02356abc pushed a commit to 02356abc/hermes-agent that referenced this pull request May 14, 2026
…ec1096a3

Salvaged PR NousResearch#1052 onto current main with the contributor commit preserved plus a small follow-up for current-main conflict resolution and safe command quoting.
olympus-terminal pushed a commit to olympus-terminal/hermes-agent that referenced this pull request May 16, 2026
Follow up on salvaged PR NousResearch#1052.
Restore current-main gateway lifecycle handling after conflict resolution and
adapt the update fallback to use shell-quoted argv parts safely.
olympus-terminal pushed a commit to olympus-terminal/hermes-agent that referenced this pull request May 16, 2026
…ec1096a3

Salvaged PR NousResearch#1052 onto current main with the contributor commit preserved plus a small follow-up for current-main conflict resolution and safe command quoting.
Egavasyug pushed a commit to Egavasyug/hermes-agent that referenced this pull request Jun 10, 2026
Follow up on salvaged PR NousResearch#1052.
Restore current-main gateway lifecycle handling after conflict resolution and
adapt the update fallback to use shell-quoted argv parts safely.
Egavasyug pushed a commit to Egavasyug/hermes-agent that referenced this pull request Jun 10, 2026
…ec1096a3

Salvaged PR NousResearch#1052 onto current main with the contributor commit preserved plus a small follow-up for current-main conflict resolution and safe command quoting.
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(gateway): /update hard-fails with ' command not found on PATH' even when Hermes is running

2 participants