Skip to content

fix(gateway): classify service-managed status pids#16349

Open
WuKongAI-CMU wants to merge 1 commit into
NousResearch:mainfrom
WuKongAI-CMU:fix/gateway-status-systemd-pids
Open

fix(gateway): classify service-managed status pids#16349
WuKongAI-CMU wants to merge 1 commit into
NousResearch:mainfrom
WuKongAI-CMU:fix/gateway-status-systemd-pids

Conversation

@WuKongAI-CMU

Copy link
Copy Markdown
Contributor

Summary

Fixes #16264

Tests

  • pytest tests/hermes_cli/test_gateway_service.py::TestGatewaySystemServiceRouting::test_gateway_status_prefers_system_service_when_only_system_unit_exists tests/hermes_cli/test_gateway_service.py::TestGatewaySystemServiceRouting::test_gateway_status_reports_manual_process_when_service_is_stopped tests/hermes_cli/test_gateway_service.py::TestGatewaySystemServiceRouting::test_gateway_status_does_not_label_systemd_pid_manual_when_unit_file_is_profile_scoped tests/hermes_cli/test_gateway_service.py::TestGatewaySystemServiceRouting::test_gateway_status_on_termux_shows_manual_guidance -q
  • git diff --check

Note: running the full tests/hermes_cli/test_gateway_service.py file on macOS currently hits unrelated user-systemd preflight failures in existing systemd_start/restart tests; the status-path regression tests above pass.

Gateway status already includes service-owned PIDs discovered through the service manager, but when the current profile lacks its expected unit path the fallback branch labeled those PIDs as manual foreground runs. Reusing the existing service PID discovery keeps the status output accurate without changing service control behavior.

Constraint: Profile-specific unit paths can be absent while a matching hermes-gateway service is still active under systemd.

Rejected: Dispatch every wildcard service to systemd_status | current status helpers are scoped to get_service_name() and would misreport cross-profile units.

Confidence: high

Scope-risk: narrow

Directive: Keep status display and service-control actions separate; this branch only corrects classification of already-discovered PIDs.

Tested: pytest tests/hermes_cli/test_gateway_service.py::TestGatewaySystemServiceRouting::test_gateway_status_prefers_system_service_when_only_system_unit_exists tests/hermes_cli/test_gateway_service.py::TestGatewaySystemServiceRouting::test_gateway_status_reports_manual_process_when_service_is_stopped tests/hermes_cli/test_gateway_service.py::TestGatewaySystemServiceRouting::test_gateway_status_does_not_label_systemd_pid_manual_when_unit_file_is_profile_scoped tests/hermes_cli/test_gateway_service.py::TestGatewaySystemServiceRouting::test_gateway_status_on_termux_shows_manual_guidance -q

Tested: git diff --check

Not-tested: Full test file on macOS has existing systemd preflight failures unrelated to status output.
@alt-glitch alt-glitch added type/bug Something isn't working P2 Medium — degraded but workaround exists comp/gateway Gateway runner, session dispatch, delivery comp/cli CLI entry point, hermes_cli/, setup wizard labels Apr 27, 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 P2 Medium — degraded but workaround exists type/bug Something isn't working

Projects

None yet

2 participants