fix(gateway): keep launchd KeepAlive unconditional for macOS resilience - #35668
Closed
drzeast-png wants to merge 2 commits into
Closed
fix(gateway): keep launchd KeepAlive unconditional for macOS resilience#35668drzeast-png wants to merge 2 commits into
drzeast-png wants to merge 2 commits into
Conversation
Collaborator
This was referenced Jun 1, 2026
Author
|
🔔 Bumping — this PR is still relevant and ready for review. Recent context:
Behavior after all three merge:
Happy to address review feedback or split into smaller PRs if preferred. |
drzeast-png
force-pushed
the
fix/gateway-keepalive-unconditional
branch
from
June 4, 2026 03:33
b4a90ca to
52be890
Compare
added 2 commits
June 4, 2026 12:20
…estarts Allow restart/stop from inside the gateway (e.g. via WeChat/Telegram) so the user can manage the gateway remotely. Trust launchd KeepAlive as the only respawn policy; the upstream blanket guard (NousResearch#35679) blocks legitimate manual restarts. Supersedes the still-open PR NousResearch#35815 (loop-detector variant).
…resilience
Changes KeepAlive from {SuccessfulExit: false} to unconditional <true/>
so launchd restarts the gateway process on every exit, not just abnormal
exits. This prevents edge cases where a clean shutdown (exit code 0)
leaves the gateway dead until manually restarted.
drzeast-png
force-pushed
the
fix/gateway-keepalive-unconditional
branch
from
June 4, 2026 04:20
52be890 to
f70848a
Compare
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.
Problem
On macOS, when the gateway exits cleanly (e.g. during
hermes gateway stopor a controlled restart), the current KeepAlive policy{SuccessfulExit: false}does NOT restart it — launchd treats exit code 0 as "intentional" and leaves the service dead.Change
Replace:
With:
This ensures launchd always restarts the gateway after any exit, matching the expectation that the service runs continuously.
Verification
Tested on macOS 26.5: after applying this change,
hermes gateway stopproperly unloads viabootout(which removes the service definition), while a crash or SIGTERM without bootout correctly respawns the process.