Bug type
Behavior bug (incorrect output/state without crash)
Summary
When an agent session calls openclaw gateway restart on macOS, the gateway process dies (via launchctl bootout) but never comes back — because bootout unloads the service definition, preventing launchd from respawning it despite KeepAlive: true. The user must manually run openclaw gateway install to recover.
Steps to reproduce
- Install OpenClaw on macOS with LaunchAgent (
openclaw gateway install)
- Verify gateway is running as a LaunchAgent with
KeepAlive: true
- From an active agent session (e.g., Telegram chat or cron job), trigger
openclaw gateway restart (either directly via exec tool, or indirectly through agent logic)
- Gateway performs
launchctl bootout gui/$UID/ai.openclaw.gateway
- Process dies — the agent session dies with it
- Gateway stays down indefinitely
Expected behavior
gateway restart should survive self-invocation. The gateway should come back up automatically after the restart, whether called from an agent session or externally.
Actual behavior
Gateway process is killed and never restarts. launchctl list | grep openclaw shows exit code -15 (SIGTERM). The LaunchAgent plist is unloaded by bootout, so launchd doesn't know to respawn it. User must run openclaw gateway install from a separate terminal to re-register the service.
OpenClaw version
2026.3.8 (3caab92)
Operating system
macOS 15.3 (arm64, Apple Silicon M4)
Install method
pnpm global
Model
anthropic/claude-opus-4-6 (not model-specific — affects any model)
Provider / routing chain
openclaw -> anthropic (direct)
Config file / key location
No response
Additional provider/model setup details
No response
Logs, screenshots, and evidence
Impact and severity
- Affected: Any macOS user whose agent calls
openclaw gateway restart (e.g., to clear stale cron locks)
- Severity: High — gateway goes down completely, all channels (Telegram, Slack, etc.) stop receiving/sending messages
- Frequency: 100% reproducible on macOS with LaunchAgent install
- Consequence: Complete agent downtime until user manually intervenes with
openclaw gateway install. Cron jobs stop, heartbeats stop, all channel connectivity lost.
Additional information
Suggested fix: Use launchctl kickstart -k gui/$UID/ai.openclaw.gateway instead of bootout + bootstrap. This sends SIGTERM while keeping the service loaded, so launchd respawns it via KeepAlive: true.
Alternatively, gateway restart could:
- Detect it's being called from within an active agent session and warn/refuse (with instructions to restart externally)
- Fork a detached process to perform the
bootstrap after bootout
Workaround: Don't call openclaw gateway restart from within agent sessions. Use openclaw gateway install from a separate terminal instead.
Bug type
Behavior bug (incorrect output/state without crash)
Summary
When an agent session calls
openclaw gateway restarton macOS, the gateway process dies (vialaunchctl bootout) but never comes back — becausebootoutunloads the service definition, preventing launchd from respawning it despiteKeepAlive: true. The user must manually runopenclaw gateway installto recover.Steps to reproduce
openclaw gateway install)KeepAlive: trueopenclaw gateway restart(either directly via exec tool, or indirectly through agent logic)launchctl bootout gui/$UID/ai.openclaw.gatewayExpected behavior
gateway restartshould survive self-invocation. The gateway should come back up automatically after the restart, whether called from an agent session or externally.Actual behavior
Gateway process is killed and never restarts.
launchctl list | grep openclawshows exit code -15 (SIGTERM). The LaunchAgent plist is unloaded bybootout, so launchd doesn't know to respawn it. User must runopenclaw gateway installfrom a separate terminal to re-register the service.OpenClaw version
2026.3.8 (3caab92)
Operating system
macOS 15.3 (arm64, Apple Silicon M4)
Install method
pnpm global
Model
anthropic/claude-opus-4-6 (not model-specific — affects any model)
Provider / routing chain
openclaw -> anthropic (direct)
Config file / key location
No response
Additional provider/model setup details
No response
Logs, screenshots, and evidence
Impact and severity
openclaw gateway restart(e.g., to clear stale cron locks)openclaw gateway install. Cron jobs stop, heartbeats stop, all channel connectivity lost.Additional information
Suggested fix: Use
launchctl kickstart -k gui/$UID/ai.openclaw.gatewayinstead ofbootout+bootstrap. This sends SIGTERM while keeping the service loaded, so launchd respawns it viaKeepAlive: true.Alternatively,
gateway restartcould:bootstrapafterbootoutWorkaround: Don't call
openclaw gateway restartfrom within agent sessions. Useopenclaw gateway installfrom a separate terminal instead.