fix(cli): use runtime pid fallback for gateway detection on macOS#11445
Closed
Hyena0x wants to merge 1 commit into
Closed
fix(cli): use runtime pid fallback for gateway detection on macOS#11445Hyena0x wants to merge 1 commit into
Hyena0x wants to merge 1 commit into
Conversation
Contributor
|
Superseded by #11896 (salvaged from @snreynolds's #11167). Your macOS find_gateway_pids fallback is included in the unified snapshot path that landed. Thanks @Hyena0x! |
Author
|
Thanks — glad this got addressed. |
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.
What does this PR do?
Fixes a macOS gateway-status false negative where
find_gateway_pids()can return an empty list even though the current profile's gateway is alive and healthy.On this macOS setup,
hermes cron listreportedGateway is not runningwhile the gateway process was actually running and cron jobs were firing. The root problem is thatfind_gateway_pids()relies on service-manager / process-list probing that can miss the active gateway, while Hermes already has a more authoritative current-profile runtime check ingateway.status.get_running_pid().This PR takes the smallest possible approach:
get_running_pid()firstThis approach is preferable because it reuses Hermes' existing PID-file/runtime validation helper instead of adding more macOS-specific parsing logic for
launchctlor broadening platform-specificpshandling.Related Issue
No dedicated issue filed.
Related open PRs for the same symptom:
This PR intentionally takes a narrower approach by reusing the existing runtime PID helper and adding regression tests.
Type of Change
Changes Made
hermes_cli/gateway.pyfind_gateway_pids()to reusegateway.status.get_running_pid()for the current profile before falling back to broader process scanningtests/hermes_cli/test_gateway_service.pyexclude_pidsstill takes precedence over the runtime PID fallbackHow to Test
gateway.status.get_running_pid()returns a live PID.hermes cron list(or callfind_gateway_pids()directly) and verify the gateway is detected instead of being reported as not running.pytest -n 0 tests/hermes_cli/test_gateway_service.py -qChecklist
Code
fix(scope):,feat(scope):, etc.)pytest tests/ -qand all tests passDocumentation & Housekeeping
docs/, docstrings) — or N/Acli-config.yaml.exampleif I added/changed config keys — or N/ACONTRIBUTING.mdorAGENTS.mdif I changed architecture or workflows — or N/AScreenshots / Logs
Relevant targeted test output:
Relevant user-visible symptom before the fix on macOS:
After applying the fix,
find_gateway_pids()correctly returns the current profile gateway PID viaget_running_pid().