Skip to content

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

Merged
teknium1 merged 1 commit into
mainfrom
hermes/hermes-8c54fd4a
May 4, 2026
Merged

fix(gateway): show friendly error when service is not installed#19707
teknium1 merged 1 commit into
mainfrom
hermes/hermes-8c54fd4a

Conversation

@teknium1

@teknium1 teknium1 commented May 4, 2026

Copy link
Copy Markdown
Contributor

Salvage of #15922 by @h0tp-ftw onto current main.

Summary

Running hermes gateway start/stop/restart without first installing the service surfaced a raw CalledProcessError traceback from systemctl (Unit hermes-gateway.service not found). Add a _require_service_installed() preflight that prints a clear "✗ Gateway service is not installed" + "Run: hermes gateway install" message and exits with code 1.

Conflict resolution during salvage

Main has added a test_run_gateway_refreshes_outdated_unit_on_boot test to the same class. Preserved both the existing test and the PR's new TestRequireServiceInstalled class.

Changes

  • hermes_cli/gateway.py: _require_service_installed(action, system=False) preflight called from systemd_start/stop/restart
  • tests: TestRequireServiceInstalled class with install-hint + pass-when-installed cases

Validation

scripts/run_tests.sh tests/hermes_cli/test_gateway_service.py -k TestRequireServiceInstalled -> 2 passed

Original PR: #15922

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>
@teknium1
teknium1 merged commit 8c8f95b into main May 4, 2026
7 of 10 checks passed
@teknium1
teknium1 deleted the hermes/hermes-8c54fd4a branch May 4, 2026 11:49
@alt-glitch alt-glitch added type/bug Something isn't working P3 Low — cosmetic, nice to have comp/gateway Gateway runner, session dispatch, delivery comp/cli CLI entry point, hermes_cli/, setup wizard labels 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