Skip to content

fix(gateway): show friendly error when service is not installed - #15922

Closed
h0tp-ftw wants to merge 1 commit into
NousResearch:mainfrom
h0tp-ftw:fix/gateway-not-installed-error
Closed

fix(gateway): show friendly error when service is not installed#15922
h0tp-ftw wants to merge 1 commit into
NousResearch:mainfrom
h0tp-ftw:fix/gateway-not-installed-error

Conversation

@h0tp-ftw

Copy link
Copy Markdown
Contributor

Summary

  • When running hermes gateway start/stop/restart without first installing the service, the CLI now shows a clear error with install instructions instead of a raw CalledProcessError traceback
  • Adds _require_service_installed() guard to systemd_start, systemd_stop, and systemd_restart

Before:

subprocess.CalledProcessError: Command '['systemctl', '--user', 'start', 'hermes-gateway']' returned non-zero exit status 5.

After:

✗ Gateway service is not installed
  Run: hermes gateway install

Test plan

  • Added unit tests for _require_service_installed (exits with hint when unit missing, passes when unit exists)
  • Updated existing restart tests to mock the new guard
  • Manual: run hermes gateway start on a machine without the service installed — should show the friendly message

🤖 Generated with Claude Code

Instead of an unhelpful CalledProcessError traceback when running
`hermes gateway start/stop/restart` without first installing the service,
check for the unit file and exit with an actionable install hint.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@alt-glitch alt-glitch added type/bug Something isn't working P3 Low — cosmetic, nice to have comp/cli CLI entry point, hermes_cli/, setup wizard comp/gateway Gateway runner, session dispatch, delivery labels Apr 26, 2026
@teknium1

teknium1 commented May 4, 2026

Copy link
Copy Markdown
Contributor

Salvaged via #19707 onto current main. Test-file conflict resolved by preserving both the existing test_run_gateway_refreshes_outdated_unit_on_boot and your new TestRequireServiceInstalled class. Thanks @h0tp-ftw!

@teknium1 teknium1 closed this May 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/cli CLI entry point, hermes_cli/, setup wizard comp/gateway Gateway runner, session dispatch, delivery P3 Low — cosmetic, nice to have type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants