fix(gateway): classify service-managed status pids#16349
Open
WuKongAI-CMU wants to merge 1 commit into
Open
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
hermes gateway statusfallback output when the detected gateway PID is already managed by systemd/launchdFixes #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 -qgit diff --checkNote: running the full
tests/hermes_cli/test_gateway_service.pyfile on macOS currently hits unrelated user-systemd preflight failures in existingsystemd_start/restarttests; the status-path regression tests above pass.