Skip to content

[Bug]: Gateway restart via launchctl has no effect when gateway was started via TUI or CLI — orphaned process holds port #26736

@i-am-rad

Description

@i-am-rad

Summary

When the OpenClaw gateway is started via the TUI or openclaw gateway start from a terminal, it runs as a detached foreground process that is not managed by launchd. Running openclaw gateway restart, launchctl kickstart -k, or clicking restart in the TUI does not kill the original process — it starts a new launchd-managed instance that immediately fails because port 18789 is already held. The original process continues running silently with the old config.

This means config changes never take effect after a restart, with no visible error to the user.

Steps to reproduce

  1. Start the gateway via TUI or openclaw gateway start in a terminal
  2. Make any config change (e.g. channel allowlist, model)
  3. Run openclaw gateway restart or launchctl kickstart -k gui/$UID/ai.openclaw.gateway
  4. Check ps aux | grep openclaw-gateway — the original PID is still running
  5. Verify the config change has not taken effect

Expected behavior

openclaw gateway restart should detect any process holding port 18789 (regardless of how it was started), kill it, and start fresh. Config changes should reliably take effect after a restart.

Actual behavior

  • Original gateway process survives the restart
  • New launchd instance silently fails to bind (port in use)
  • No error surfaced in TUI or webchat
  • Config changes are silently ignored
  • openclaw doctor does not flag the conflict

Workaround: Manually kill the orphaned PID (kill ) then start fresh.

OpenClaw version

2026.2.24

Operating system

macOS 15.7.3 (Darwin 24.6.0, x64)

Install method

npm (pnpm)

Logs, screenshots, and evidence

Impact and severity

No response

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions