Skip to content

openclaw gateway restart fails to re-bootstrap LaunchAgent on macOS #40905

Description

@AlMcClaw-ctrl

Bug type

Regression (worked before, now fails)

Summary

openclaw gateway restart on macOS performs bootout + bootstrap of the LaunchAgent (ai.openclaw.gateway), but the bootstrap step silently fails. The gateway process is killed and never comes back. The user must manually run launchctl load ~/Library/LaunchAgents/ai.openclaw.gateway.plist to restore the service.

The v2026.3.8 fix "re-enable disabled LaunchAgent services before updater bootstrap" only applies to the update flow (openclaw update), not to openclaw gateway restart.

launchctl kickstart -k gui/$(id -u)/ai.openclaw.gateway works correctly as a workaround — it kills the process and launchd restarts it immediately without the unload/load dance.

Steps to reproduce

  1. Have OpenClaw gateway running as a LaunchAgent on macOS (KeepAlive: true, service enabled)
  2. Run openclaw gateway restart
  3. Gateway process is killed
  4. Service does not come back — launchctl list | grep openclaw.gateway shows the service is gone
  5. Must manually run launchctl load ~/Library/LaunchAgents/ai.openclaw.gateway.plist to restore

Tested multiple times — 100% reproducible.

Expected behavior

Gateway process is killed and launchd re-bootstraps the LaunchAgent automatically. Service resumes within seconds.

Actual behavior

Gateway is killed and the LaunchAgent is not re-bootstrapped. The service disappears from launchctl list. All agent sessions, Telegram, Discord, and cron jobs stop working until manual launchctl load is performed.

OpenClaw version

2026.3.8 (3caab92)

Operating system

macOS 26.2 (arm64) — Mac Mini M4

Install method

npm global (Homebrew Node 22.22.0)

Logs, screenshots, and evidence

Gateway log after restart attempt shows the process being killed but no subsequent startup entries. LaunchAgent plist has `KeepAlive: true` and `RunAtLoad: true` configured correctly. Service shows as `enabled` in `launchctl print-disabled`.

Impact and severity

Affected: All macOS users using LaunchAgent-managed gateway
Severity: High — completely kills the gateway with no automatic recovery
Frequency: 100% reproducible
Consequence: All channels (Telegram, Discord), cron jobs, and agent sessions stop working until manual intervention

Additional information

Workaround: Use launchctl kickstart -k gui/$(id -u)/ai.openclaw.gateway instead of openclaw gateway restart. This kills the process and launchd restarts it immediately without unload/load.

Suggested fix: openclaw gateway restart should either:

  1. Use launchctl kickstart -k instead of bootout + bootstrap, or
  2. Apply the same "re-enable disabled LaunchAgent" logic from the update flow (v2026.3.8 fix) to the restart flow

Related: The v2026.3.8 changelog entry "Update/macOS launchd restart: re-enable disabled LaunchAgent services before updater bootstrap" fixes this for openclaw update but not for openclaw gateway restart.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingregressionBehavior that previously worked and now fails

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions