Skip to content

CLI falsely reports 'Gateway service not loaded' for user LaunchAgents even when running #41829

@novuxx888

Description

@novuxx888

Bug Description

When using openclaw gateway restart via Discord (or any remote channel), the CLI incorrectly reports "Gateway service not loaded" even when the Gateway is actually running.

Steps to Reproduce

  1. Have OpenClaw Gateway installed as a user LaunchAgent (~/.openclaw/launchd.plist or via openclaw gateway install)
  2. Gateway is running (verified via launchctl list | grep openclaw shows PID)
  3. Run openclaw gateway restart
  4. CLI reports "Gateway service not loaded" and suggests running openclaw gateway install

Expected Behavior

CLI should correctly detect that the user LaunchAgent is running and allow restart without reinstalling.

Workaround

Using launchctl kickstart -k gui/502/ai.openclaw.gateway works correctly.

Additional Context

  • macOS user LaunchAgents (in ~/Library/LaunchAgents/) only run when a user is logged in
  • For headless Macs, the Gateway may not auto-start after Mac reboot
  • The CLI's status check appears to have a false-negative bug for the gui/* domain

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions