Skip to content

fix(gateway): use unconditional KeepAlive in launchd plist - #9689

Closed
digging-airfare-4u wants to merge 1 commit into
NousResearch:mainfrom
digging-airfare-4u:fix/issue-9659
Closed

fix(gateway): use unconditional KeepAlive in launchd plist#9689
digging-airfare-4u wants to merge 1 commit into
NousResearch:mainfrom
digging-airfare-4u:fix/issue-9659

Conversation

@digging-airfare-4u

Copy link
Copy Markdown

Summary

Changes the generated launchd plist's KeepAlive from a conditional SuccessfulExit-based dictionary to an unconditional <true/> boolean.

Problem

The previous KeepAlive config only restarted the gateway after a non-zero exit code. When the gateway exited cleanly (e.g., during restarts, config reloads, or graceful shutdowns), launchd treated it as "job completed successfully" and did not restart it. With multiple profiles, all worker gateways could silently stay down until manually restarted.

Changes

  • hermes_cli/gateway.py (generate_launchd_plist): use <true/> for KeepAlive
  • hermes_cli/gateway.py (launchd_stop): updated comment to reflect the new unconditional KeepAlive behavior

Related Issue

Fixes #9659

@digging-airfare-4u

Copy link
Copy Markdown
Author

ping — keeps launchd from silently dropping gateways on clean exit. one-liner, ready for review.

Change KeepAlive from conditional SuccessfulExit-based to unconditional.
This ensures launchd always restarts the gateway after any exit
(including clean exits during restarts or config reloads), preventing
the gateway from silently staying down.

Fixes NousResearch#9659
@alt-glitch alt-glitch added type/bug Something isn't working P2 Medium — degraded but workaround exists comp/gateway Gateway runner, session dispatch, delivery labels Apr 26, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

Likely duplicate of #14001 — both change launchd KeepAlive from SuccessfulExit-conditional to unconditional true for gateway restart reliability.

@teknium1

Copy link
Copy Markdown
Contributor

This is an automated hermes-sweeper review: the requested launchd behavior is already implemented on current main.

  • hermes_cli/gateway.py:3962 emits scalar <key>KeepAlive</key><true/>, rather than the conditional SuccessfulExit dictionary.
  • tests/hermes_cli/test_gateway_service.py:3552 verifies the unconditional form and rejects the old conditional form.
  • Commit c9b62061d43feb61a3a69caec99148623d988a5e (fix(cli): launchd KeepAlive unconditional restart (#37388)) implemented this behavior and shipped in v2026.6.5.
  • The launchd_stop() rationale is also current at hermes_cli/gateway.py:4247, where launchctl bootout unloads the job so unconditional KeepAlive does not respawn an intentionally stopped gateway.

Thanks for the focused fix and for documenting the clean-exit failure mode.

@teknium1 teknium1 closed this Jul 12, 2026
@teknium1 teknium1 added the sweeper:implemented-on-main Sweeper: behavior already present on current main label Jul 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/gateway Gateway runner, session dispatch, delivery P2 Medium — degraded but workaround exists sweeper:implemented-on-main Sweeper: behavior already present on current main type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

launchd plist KeepAlive should be unconditional, not SuccessfulExit-based

3 participants