What version of OpenClaw are you using?
2026.3.13
What platform are you on?
macOS
What happened?
A gateway installed as a macOS LaunchAgent appears to shut down cleanly on SIGTERM, but does not automatically respawn afterward.
Instead, launchd leaves the service inactive and logs:
pending spawn, domain in on-demand-only mode: ai.openclaw.gateway
The gateway remains down until an explicit/manual restart or some later demand-triggered startup occurs.
This was initially mistaken for a state-bloat issue, but we reproduced it independently on a healthy instance with small state and no OOM behavior.
Expected behavior
If the installed gateway service receives SIGTERM, it should be restarted automatically by launchd (or otherwise remain available as an always-on gateway service).
Actual behavior
After SIGTERM:
- gateway process exits cleanly
launchctl print gui/<uid>/ai.openclaw.gateway shows state = not running
- health endpoint stops responding
- no immediate respawn happens
- service only returns after explicit restart, e.g.
launchctl kickstart -k gui/<uid>/ai.openclaw.gateway
Reproduction
- Install the gateway service on macOS using the normal OpenClaw service install flow.
- Confirm the service is healthy.
- Send
SIGTERM to the running gateway process.
- Poll:
curl http://127.0.0.1:18789/health
launchctl print gui/<uid>/ai.openclaw.gateway
Reproduction result
Observed sequence:
- before test:
- gateway healthy
- launchd service running
- after
SIGTERM:
- health endpoint stops responding
launchctl shows service inactive / not running
- no automatic respawn occurs
- after manual restart:
launchctl kickstart -k gui/<uid>/ai.openclaw.gateway
- health endpoint returns healthy again
Relevant logs
Gateway log:
[gateway] signal SIGTERM received
[gateway] received SIGTERM; shutting down
launchd / unified log:
service inactive: ai.openclaw.gateway
pending spawn, domain in on-demand-only mode: ai.openclaw.gateway
Manual recovery later shows:
launching: non-ipc demand
Successfully spawned node[...] because non-ipc demand
Additional notes
- This was reproduced on a healthy instance with small persisted state, so it does not appear to depend on OOM or large session files.
- The LaunchAgent had
RunAtLoad = true and KeepAlive = true.
- This may be a macOS LaunchAgent/session-domain issue rather than a gateway crash issue, but from the user perspective the installed service is not behaving as an always-on service after a clean termination.
Question
Is this expected behavior for the current macOS LaunchAgent install model, or should the installed gateway service be resilient to SIGTERM without requiring manual/demand restart?
What version of OpenClaw are you using?
2026.3.13
What platform are you on?
macOS
What happened?
A gateway installed as a macOS LaunchAgent appears to shut down cleanly on
SIGTERM, but does not automatically respawn afterward.Instead,
launchdleaves the service inactive and logs:pending spawn, domain in on-demand-only mode: ai.openclaw.gatewayThe gateway remains down until an explicit/manual restart or some later demand-triggered startup occurs.
This was initially mistaken for a state-bloat issue, but we reproduced it independently on a healthy instance with small state and no OOM behavior.
Expected behavior
If the installed gateway service receives
SIGTERM, it should be restarted automatically by launchd (or otherwise remain available as an always-on gateway service).Actual behavior
After
SIGTERM:launchctl print gui/<uid>/ai.openclaw.gatewayshowsstate = not runninglaunchctl kickstart -k gui/<uid>/ai.openclaw.gatewayReproduction
SIGTERMto the running gateway process.curl http://127.0.0.1:18789/healthlaunchctl print gui/<uid>/ai.openclaw.gatewayReproduction result
Observed sequence:
SIGTERM:launchctlshows service inactive / not runninglaunchctl kickstart -k gui/<uid>/ai.openclaw.gatewayRelevant logs
Gateway log:
launchd / unified log:
Manual recovery later shows:
Additional notes
RunAtLoad = trueandKeepAlive = true.Question
Is this expected behavior for the current macOS LaunchAgent install model, or should the installed gateway service be resilient to
SIGTERMwithout requiring manual/demand restart?