Skip to content

fix(cli): launchd KeepAlive unconditional restart (#37388) - #38796

Closed
ashishpatel26 wants to merge 1 commit into
NousResearch:mainfrom
ashishpatel26:fix/launchd-keepalive-37388
Closed

fix(cli): launchd KeepAlive unconditional restart (#37388)#38796
ashishpatel26 wants to merge 1 commit into
NousResearch:mainfrom
ashishpatel26:fix/launchd-keepalive-37388

Conversation

@ashishpatel26

Copy link
Copy Markdown
Contributor

Summary

Replace KeepAlive.SuccessfulExit=false dict with <key>KeepAlive</key><true/> so launchd restarts hermes-gateway on any exit.

Root cause (fixes #37388)

KeepAlive.SuccessfulExit=false means launchd only restarts on non-zero exits. But the --graceful-restart / SIGUSR1 drain protocol exits with code 0 after draining in-flight runs. With the old plist, a graceful restart would drain correctly then exit 0 — and launchd would not respawn it.

Test plan

  • tests/hermes_cli/test_gateway_service.py — asserts generated plist contains <key>KeepAlive</key> immediately followed by <true/>, not a dict

🤖 Generated with Claude Code

Replace KeepAlive.SuccessfulExit=false dict with <key>KeepAlive</key><true/>
so launchd restarts hermes-gateway on any exit, matching the documented
drain-then-exit restart protocol used by --graceful-restart.
@ashishpatel26

Copy link
Copy Markdown
Contributor Author

Closing — fix merged upstream as c9b6206.

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

Development

Successfully merging this pull request may close these issues.

[Bug]: gateway launchd KeepAlive (SuccessfulExit:false) doesn't restart after a clean --replace exit on macOS

2 participants