#gateway not connecting

1 messages ¡ Page 1 of 1 (latest)

solar nimbusBOT
#

To help others find answers, you can mark your question as solved via Right click solution message -> Apps -> ✅ Mark Solution

cobalt socketBOT
#

That error (gateway closed (1006 abnormal closure)) means the CLI tried to open a WebSocket to the Gateway and the connection got dropped without a clean close — most commonly:

  • the Gateway isn’t running / crashes immediately
  • the CLI is pointing at the wrong URL (remote mode / wrong host/port)
  • auth/token mismatch (gateway closes the WS)
  • service is running but RPC probe fails (config/service mismatch, bind/auth guardrails, port conflict)

Can you run these in order on the machine where the Gateway should be running, and paste the output?

openclaw --version
openclaw status --all
openclaw gateway status
openclaw logs --follow
openclaw doctor
#

A couple notes:

  • openclaw status --all is the best thing to share in Discord (it’s meant to be shareable; tokens get redacted).
  • In openclaw gateway status, tell us specifically whether it says Runtime: running and whether RPC probe: ok or failed.

If you want a quick “try this first” while you gather output:

openclaw gateway restart
openclaw logs --follow

Docs that match this exact symptom/runbook:

Once you paste openclaw gateway status + the first relevant error lines from openclaw logs --follow, it’s usually obvious which bucket it’s in.

grand cradle
#

Service: LaunchAgent (loaded)
File logs: /tmp/openclaw/openclaw-2026-02-15.log
Command: /opt/homebrew/bin/node /opt/homebrew/lib/node_modules/openclaw/dist/index.js gateway --port 19000
Service file: ~/Library/LaunchAgents/ai.openclaw.gateway.plist
Service env: OPENCLAW_GATEWAY_PORT=19000

Config (cli): ~/.openclaw/openclaw.json
Config (service): ~/.openclaw/openclaw.json

Gateway: bind=loopback (127.0.0.1), port=19000 (service args)
Probe target: ws://127.0.0.1:19000
Dashboard: http://127.0.0.1:19000/
Probe note: Loopback-only gateway; only local clients can connect.

Runtime: stopped (state active)
RPC probe: failed
RPC target: ws://127.0.0.1:19000
gateway closed (1006 abnormal closure (no close frame)): no close reason
Gateway target: ws://127.0.0.1:19000
Source: cli --url
Config: /Users/jiwoongyoo/.openclaw/openclaw.json

Service is loaded but not running (likely exited immediately).
File logs: /tmp/openclaw/openclaw-2026-02-15.log
Launchd stdout (if installed): /Users/jiwoongyoo/.openclaw/logs/gateway.log
Launchd stderr (if installed): /Users/jiwoongyoo/.openclaw/logs/gateway.err.log

Other gateway-like services detected (best effort):

  • ai.openclaw.mac (user, plist: /Users/jiwoongyoo/Library/LaunchAgents/ai.openclaw.mac.plist)
    Cleanup hint: launchctl bootout gui/$UID/ai.openclaw.gateway
    Cleanup hint: rm ~/Library/LaunchAgents/ai.openclaw.gateway.plist

Recommendation: run a single gateway per machine for most setups. One gateway supports multiple agents (see docs: /gateway#multiple-gateways-same-host).
If you need multiple gateways (e.g., a rescue bot on the same host), isolate ports + config/state (see docs: /gateway#multiple-gateways-same-host).

jiwoongyoo@Jis-MacBook-Pro-2 ~ % openclaw logs --follow

Gateway not reachable. Is it running and accessible?
Gateway target: ws://127.0.0.1:19000
Source: local loopback
Config: /Users/jiwoongyoo/.openclaw/openclaw.json
Bind: loopback

cobalt socketBOT
#

That status output is super clear: the LaunchAgent is loaded but the Gateway process exited immediately, so the CLI tries to connect and gets the WS 1006 close because there’s nothing healthy listening.

openclaw logs --follow won’t work until the Gateway is reachable — you need to look at the file logs / launchd stderr to see why it exited.

Please run these and paste the output (especially the first obvious error/stacktrace):

# 1) What did the gateway crash with?
tail -n 200 /tmp/openclaw/openclaw-2026-02-15.log

# 2) launchd captured stderr (often contains the real exception)
tail -n 200 ~/.openclaw/logs/gateway.err.log
tail -n 200 ~/.openclaw/logs/gateway.log

# 3) sanity: runtime versions
openclaw --version
#
node -v

Two common causes to check quickly:

A) Port 19000 is already in use

lsof -nP -iTCP:19000 -sTCP:LISTEN || true

B) You accidentally have two gateway-ish services fighting (you have ai.openclaw.mac detected)

Run:

launchctl print gui/$UID/ai.openclaw.gateway | head -n 80
launchctl print gui/$UID/ai.openclaw.mac | head -n 80
#

If you want the fastest “see the crash immediately” path, stop the service and run the gateway in the foreground once:

openclaw gateway stop
openclaw gateway --port 19000

It should print the real error directly. Paste that, and we can tell you the exact fix.

grand cradle
#

Bad request.
Could not find service "ai.openclaw.mac" in domain for user gui: 501
jiwoongyoo@Jis-MacBook-Pro-2 ~ % openclaw gateway stop
openclaw gateway --port 19000

🦞 OpenClaw 2026.2.13 (203b5bd) — Works on Android. Crazy concept, we know.

Stopped LaunchAgent: gui/501/ai.openclaw.gateway

🦞 OpenClaw 2026.2.13 (203b5bd)
Pairing codes exist because even bots believe in consent—and good security hygiene.

15:10:09 [gateway] openclaw-mem0: registered (mode: platform, user: ji, graph: false, autoRecall: true, autoCapture: true)
15:10:10 [canvas] host mounted at http://127.0.0.1:19000/__openclaw__/canvas/ (root /Users/jiwoongyoo/.openclaw/canvas)
15:10:10 [heartbeat] started
15:10:10 [gateway] agent model: zai/glm-5
15:10:10 [gateway] listening on ws://127.0.0.1:19000 (PID 19309)
15:10:10 [gateway] listening on ws://[::1]:19000
15:10:10 [gateway] log file: /tmp/openclaw/openclaw-2026-02-15.log
15:10:10 [browser/service] Browser control service ready (profiles=2)
15:10:10 [hooks:loader] Registered hook: boot-md -> gateway:startup
15:10:10 [hooks:loader] Registered hook: bootstrap-extra-files -> agent:bootstrap
15:10:10 [hooks:loader] Registered hook: command-logger -> command
15:10:10 [hooks:loader] Registered hook: session-memory -> command:new
02:10:10 ⚠️ Session file not found: gateway
02:10:10 Proceeding with reset...
02:10:10 EXECUTE_NEW
jiwoongyoo@Jis-MacBook-Pro-2 ~ % openclaw --version
2026.2.13
jiwoongyoo@Jis-MacBook-Pro-2 ~ % node -v
v22.22.0

cobalt socketBOT
#

Nice — that confirms the install itself is fine (openclaw 2026.2.13, node v22, and the gateway can bind + start on 127.0.0.1:19000).

Now the key question is: did openclaw gateway --port 19000 keep running, or did it exit back to your shell on its own? (In your paste it looks like you got your prompt back pretty quickly, which would explain why launchd also “exits immediately”.)

Either way, the next step is to pull the real crash reason from the logs (because openclaw logs --follow is RPC-based and won’t work while the gateway is down).

Run and paste:

tail -n 200 /tmp/openclaw/openclaw-2026-02-15.log
tail -n 200 ~/.openclaw/logs/gateway.err.log
tail -n 200 ~/.openclaw/logs/gateway.log

Also worth checking (quick sanity):

#
lsof -nP -iTCP:19000 -sTCP:LISTEN || true

One very common macOS pattern: works in your terminal, fails under LaunchAgent because launchd doesn’t inherit your shell env. Since your default agent model is zai/glm-5, make sure the service can see ZAI_API_KEY (don’t paste the key, just confirm it exists in one of these places):

  • ~/.openclaw/.env containing ZAI_API_KEY=... (recommended), or
  • config env: { ZAI_API_KEY: "..." }, or
  • enable shell import:
{
  env: { shellEnv: { enabled: true } }
}

(FAQ section: https://docs.openclaw.ai/help/faq#i-started-the-gateway-via-the-service-and-my-env-vars-disappeared-what-now)

#

After adding/fixing env, restart the service:

openclaw gateway restart
openclaw gateway status

Paste the log tail from those files and we can pinpoint the exact exit reason in one hop.

grand cradle
#

Service: LaunchAgent (not loaded)
File logs: /tmp/openclaw/openclaw-2026-02-15.log
Command: /opt/homebrew/bin/node /opt/homebrew/lib/node_modules/openclaw/dist/index.js gateway --port 19000
Service file: ~/Library/LaunchAgents/ai.openclaw.gateway.plist
Service env: OPENCLAW_GATEWAY_PORT=19000

Config (cli): ~/.openclaw/openclaw.json
Config (service): ~/.openclaw/openclaw.json

Gateway: bind=loopback (127.0.0.1), port=19000 (service args)
Probe target: ws://127.0.0.1:19000
Dashboard: http://127.0.0.1:19000/
Probe note: Loopback-only gateway; only local clients can connect.

Runtime: unknown (Bad request.
Could not find service "ai.openclaw.gateway" in domain for user gui: 501)
RPC probe: failed
RPC target: ws://127.0.0.1:19000
gateway closed (1006 abnormal closure (no close frame)): no close reason
Gateway target: ws://127.0.0.1:19000
Source: cli --url
Config: /Users/jiwoongyoo/.openclaw/openclaw.json

Service unit not found.
Service not installed. Run: openclaw gateway install
File logs: /tmp/openclaw/openclaw-2026-02-15.log
Other gateway-like services detected (best effort):

  • ai.openclaw.mac (user, plist: /Users/jiwoongyoo/Library/LaunchAgents/ai.openclaw.mac.plist)
    Cleanup hint: launchctl bootout gui/$UID/ai.openclaw.gateway
    Cleanup hint: rm ~/Library/LaunchAgents/ai.openclaw.gateway.plist

Recommendation: run a single gateway per machine for most setups. One gateway supports multiple agents (see docs: /gateway#multiple-gateways-same-host).
If you need multiple gateways (e.g., a rescue bot on the same host), isolate ports + config/state (see docs: /gateway#multiple-gateways-same-host).

cobalt socketBOT
#

That output means the CLI is trying to probe ws://127.0.0.1:19000, but there is no LaunchAgent job loaded anymore (ai.openclaw.gateway not in launchd), and there’s also no gateway process currently listening, so you get the 1006 close.

1) Re-install + start the LaunchAgent

Run:

openclaw gateway install --port 19000 --force
openclaw gateway start
openclaw gateway status

If that works, gateway status should show Service: loaded and RPC probe: ok.

2) Make sure the port isn’t taken

If it still won’t stay up, check for a port conflict:

#
lsof -nP -iTCP:19000 -sTCP:LISTEN || true

3) If you’re using --url, don’t (or pass token)

Your status output says Source: cli --url. FYI: when you pass --url, the CLI does not fall back to creds from config/env. So after the gateway is running, if you keep using --url you may need to also pass --token (but do not paste tokens in Discord), or just omit --url and let it use your config.

4) If it immediately exits again: paste the crash

If after gateway start it still stops, paste the last ~100 lines:

tail -n 120 /tmp/openclaw/openclaw-2026-02-15.log
tail -n 120 ~/.openclaw/logs/gateway.err.log 2>/dev/null || true

(That will show the actual reason launchd is quitting.)

grand cradle
#

Service: LaunchAgent (loaded)
File logs: /tmp/openclaw/openclaw-2026-02-15.log
Command: /opt/homebrew/bin/node /opt/homebrew/lib/node_modules/openclaw/dist/index.js gateway --port 19000
Service file: ~/Library/LaunchAgents/ai.openclaw.gateway.plist
Service env: OPENCLAW_GATEWAY_PORT=19000

Config (cli): ~/.openclaw/openclaw.json
Config (service): ~/.openclaw/openclaw.json

Gateway: bind=loopback (127.0.0.1), port=19000 (service args)
Probe target: ws://127.0.0.1:19000
Dashboard: http://127.0.0.1:19000/
Probe note: Loopback-only gateway; only local clients can connect.

Runtime: running (pid 19517, state active)
Warm-up: launch agents can take a few seconds. Try again shortly.
RPC probe: failed
RPC target: ws://127.0.0.1:19000
gateway closed (1006 abnormal closure (no close frame)): no close reason
Gateway target: ws://127.0.0.1:19000
Source: cli --url
Config: /Users/jiwoongyoo/.openclaw/openclaw.json

Gateway port 19000 is not listening (service appears running).
Last gateway error: 2026-02-14T22:14:53.450+11:00 Gateway start blocked: set gateway.mode=local (current: unset) or pass --allow-unconfigured.
Logs: ~/.openclaw/logs/gateway.log
Errors: ~/.openclaw/logs/gateway.err.log

Other gateway-like services detected (best effort):

  • ai.openclaw.mac (user, plist: /Users/jiwoongyoo/Library/LaunchAgents/ai.openclaw.mac.plist)
    Cleanup hint: launchctl bootout gui/$UID/ai.openclaw.gateway
    Cleanup hint: rm ~/Library/LaunchAgents/ai.openclaw.gateway.plist

Recommendation: run a single gateway per machine for most setups. One gateway supports multiple agents (see docs: /gateway#multiple-gateways-same-host).
If you need multiple gateways (e.g., a rescue bot on the same host), isolate ports + config/state (see docs: /gateway#multiple-gateways-same-host).

cobalt socketBOT
#

That last line is the smoking gun:

Gateway start blocked: set gateway.mode=local (current: unset) or pass --allow-unconfigured.

So launchd is starting the process, but the Gateway immediately refuses to run (guardrail), so nothing ends up listening on :19000 → CLI gets the 1006 WS close.

Fix (recommended): set gateway mode in config, then restart the service:

openclaw config set gateway.mode local
openclaw gateway restart
openclaw gateway status

If you want to confirm the value first:

grand cradle
#

Service: LaunchAgent (loaded)
File logs: /tmp/openclaw/openclaw-2026-02-15.log
Command: /opt/homebrew/bin/node /opt/homebrew/lib/node_modules/openclaw/dist/index.js gateway --port 19000
Service file: ~/Library/LaunchAgents/ai.openclaw.gateway.plist
Service env: OPENCLAW_GATEWAY_PORT=19000

Config (cli): ~/.openclaw/openclaw.json
Config (service): ~/.openclaw/openclaw.json

Gateway: bind=loopback (127.0.0.1), port=19000 (service args)
Probe target: ws://127.0.0.1:19000
Dashboard: http://127.0.0.1:19000/
Probe note: Loopback-only gateway; only local clients can connect.

Runtime: running (pid 19915, state active)
Warm-up: launch agents can take a few seconds. Try again shortly.
RPC probe: failed
RPC target: ws://127.0.0.1:19000
gateway closed (1006 abnormal closure (no close frame)): no close reason
Gateway target: ws://127.0.0.1:19000
Source: cli --url
Config: /Users/jiwoongyoo/.openclaw/openclaw.json

Gateway port 19000 is not listening (service appears running).
Last gateway error: 2026-02-14T22:14:53.450+11:00 Gateway start blocked: set gateway.mode=local (current: unset) or pass --allow-unconfigured.
Logs: ~/.openclaw/logs/gateway.log
Errors: ~/.openclaw/logs/gateway.err.log

Other gateway-like services detected (best effort):

  • ai.openclaw.mac (user, plist: /Users/jiwoongyoo/Library/LaunchAgents/ai.openclaw.mac.plist)
    Cleanup hint: launchctl bootout gui/$UID/ai.openclaw.gateway
    Cleanup hint: rm ~/Library/LaunchAgents/ai.openclaw.gateway.plist

Recommendation: run a single gateway per machine for most setups. One gateway supports multiple agents (see docs: /gateway#multiple-gateways-same-host).
If you need multiple gateways (e.g., a rescue bot on the same host), isolate ports + config/state (see docs: /gateway#multiple-gateways-same-host).
jiwoongyoo@Jis-MacBook-Pro-2 ~ % openclaw config get gateway.mode
local

cobalt socketBOT
#

Good — gateway.mode is set correctly now.

What you’re seeing in gateway status is just the last recorded failure from before that change. The LaunchAgent needs a restart to pick up the updated config and actually bind the port.

Run:

openclaw gateway restart
# wait ~5 seconds
openclaw gateway status

If it still says “port 19000 is not listening”, verify whether anything is listening:

lsof -nP -iTCP:19000 -sTCP:LISTEN || true
#

…and paste the crash reason from the service logs (this is the real source of truth when RPC probe can’t connect):

tail -n 120 ~/.openclaw/logs/gateway.err.log 2>/dev/null || true
tail -n 120 ~/.openclaw/logs/gateway.log 2>/dev/null || true
tail -n 120 /tmp/openclaw/openclaw-2026-02-15.log

Once the gateway is actually listening, the 1006 WebSocket close will go away and RPC probe should flip to ok.

grand cradle
#

jiwoongyoo@Jis-MacBook-Pro-2 ~ % openclaw gateway restart

wait ~5 seconds

openclaw gateway status

Restarted LaunchAgent: gui/501/ai.openclaw.gateway
zsh: not enough directory stack entries.
jiwoongyoo@Jis-MacBook-Pro-2 ~ % lsof -nP -iTCP:19000 -sTCP:LISTEN || true
jiwoongyoo@Jis-MacBook-Pro-2 ~ %

{"0":"Proceeding with reset...","_meta":{"runtime":"node","runtimeVersion":"22.22.0","hostname":"unknown","name":"openclaw","date":"2026-02-14T15:23:38.667Z","logLevelId":3,"logLevelName":"INFO","path":{"fullFilePath":"file:///opt/homebrew/lib/node_modules/openclaw/dist/subsystem-QRNIBE7-.js:716:46","fileName":"subsystem-QRNIBE7-.js","fileNameWithLine":"subsystem-QRNIBE7-.js:716","fileColumn":"46","fileLine":"716","filePath":"opt/homebrew/lib/node_modules/openclaw/dist/subsystem-QRNIBE7-.js","filePathWithLine":"opt/homebrew/lib/node_modules/openclaw/dist/subsystem-QRNIBE7-.js:716","method":"console.log"}},"time":"2026-02-14T15:23:38.667Z"}
{"0":"EXECUTE_NEW","_meta":{"runtime":"node","runtimeVersion":"22.22.0","hostname":"unknown","name":"openclaw","date":"2026-02-14T15:23:38.667Z","logLevelId":3,"logLevelName":"INFO","path":{"fullFilePath":"file:///opt/homebrew/lib/node_modules/openclaw/dist/subsystem-QRNIBE7-.js:716:46","fileName":"subsystem-QRNIBE7-.js","fileNameWithLine":"subsystem-QRNIBE7-.js:716","fileColumn":"46","fileLine":"716","filePath":"opt/homebrew/lib/node_modules/openclaw/dist/subsystem-QRNIBE7-.js","filePathWithLine":"opt/homebrew/lib/node_modules/openclaw/dist/subsystem-QRNIBE7-.js:716","method":"console.log"}},"time":"2026-02-14T15:23:38.667Z"}

cobalt socketBOT
#

Yep — lsof shows nothing is listening on 19000, so the LaunchAgent process is either:

  • crash-looping very early, or
  • exiting immediately (launchd may still show a “pid” briefly)

The two JSON lines you pasted (Proceeding with reset... / EXECUTE_NEW) are not the actual failure — they’re just startup/session init noise. We need the launchd stderr to see why it never binds the port.

Run these and paste the output (last ~80–200 lines):

tail -n 200 ~/.openclaw/logs/gateway.err.log
tail -n 200 ~/.openclaw/logs/gateway.log
tail -n 200 /tmp/openclaw/openclaw-2026-02-15.log

Also, that zsh: not enough directory stack entries. is coming from your shell config/plugins, not OpenClaw — just ignore it and run the commands on separate lines (or do a real wait like sleep 5).

#

One very likely macOS cause once gateway.mode=local is fixed: LaunchAgent doesn’t inherit your shell env, so any model key you had in .zshrc won’t exist for the service. Your gateway log earlier said agent model: zai/glm-5, so if ZAI_API_KEY isn’t available to launchd, startup can fail.

If the logs mention missing env/API key, fix by putting it in:

  • ~/.openclaw/.env (recommended) e.g. ZAI_API_KEY=...
  • then:
openclaw gateway restart

Paste the gateway.err.log tail and we’ll know which exact error it is.

grand cradle
#

{"0":"⚠️ Session file not found: gateway","_meta":{"runtime":"node","runtimeVersion":"22.22.0","hostname":"unknown","name":"openclaw","date":"2026-02-14T15:26:05.607Z","logLevelId":3,"logLevelName":"INFO","path":{"fullFilePath":"file:///opt/homebrew/lib/node_modules/openclaw/dist/subsystem-QRNIBE7-.js:716:46","fileName":"subsystem-QRNIBE7-.js","fileNameWithLine":"subsystem-QRNIBE7-.js:716","fileColumn":"46","fileLine":"716","filePath":"opt/homebrew/lib/node_modules/openclaw/dist/subsystem-QRNIBE7-.js","filePathWithLine":"opt/homebrew/lib/node_modules/openclaw/dist/subsystem-QRNIBE7-.js:716","method":"console.log"}},"time":"2026-02-14T15:26:05.607Z"}
{"0":"Proceeding with reset...","_meta":{"runtime":"node","runtimeVersion":"22.22.0","hostname":"unknown","name":"openclaw","date":"2026-02-14T15:26:05.607Z","logLevelId":3,"logLevelName":"INFO","path":{"fullFilePath":"file:///opt/homebrew/lib/node_modules/openclaw/dist/subsystem-QRNIBE7-.js:716:46","fileName":"subsystem-QRNIBE7-.js","fileNameWithLine":"subsystem-QRNIBE7-.js:716","fileColumn":"46","fileLine":"716","filePath":"opt/homebrew/lib/node_modules/openclaw/dist/subsystem-QRNIBE7-.js","filePathWithLine":"opt/homebrew/lib/node_modules/openclaw/dist/subsystem-QRNIBE7-.js:716","method":"console.log"}},"time":"2026-02-14T15:26:05.607Z"}
{"0":"EXECUTE_NEW","_meta":{"runtime":"node","runtimeVersion":"22.22.0","hostname":"unknown","name":"openclaw","date":"2026-02-14T15:26:05.608Z","logLevelId":3,"logLevelName":"INFO","path":{"fullFilePath":"file:///opt/homebrew/lib/node_modules/openclaw/dist/subsystem-QRNIBE7-.js:716:46","fileName":"subsystem-QRNIBE7-.js","fileNameWithLine":"subsystem-QRNIBE7-.js:716","fileColumn":"46","fileLine":"716","filePath":"opt/homebrew/lib/node_modules/openclaw/dist/subsystem-QRNIBE7-.js","filePathWithLine":"opt/homebrew/lib/node_modules/openclaw/dist/subsystem-QRNIBE7-.js:716","method":"console.log"}},"time":"2026-02-14T15:26:05.608Z"}

cobalt socketBOT
#

Those 3 JSON lines are not the failure — they’re just startup/session-init chatter. The important tell is: there’s no later line like listening on ws://127.0.0.1:19000, and lsof confirms nothing is listening, so the launchd-run gateway is dying or getting stuck before it binds the port.

Next, we need the actual launchd stderr / gateway log, not just the last 3 lines.

Run these and paste the output:

ls -la ~/.openclaw/logs | sed -n '1,120p'
tail -n 200 ~/.openclaw/logs/gateway.err.log 2>/dev/null || echo "no gateway.err.log"
tail -n 200 ~/.openclaw/logs/gateway.log 2>/dev/null || echo "no gateway.log"
tail -n 200 /tmp/openclaw/openclaw-2026-02-15.log

Also: your zsh: not enough directory stack entries. is a shell init error (usually from a popd in .zshrc/plugin). If you have shell env import enabled, that can break the gateway when it starts under launchd.

Check:

#
openclaw config get env.shellEnv
  • If it shows enabled: true, try disabling it (and instead put keys in ~/.openclaw/.env):
openclaw config set env.shellEnv.enabled false
openclaw gateway restart

Finally, grab launchd’s view of the job (this often shows exit reason / last status):

launchctl print gui/$UID/ai.openclaw.gateway | sed -n '1,220p'
ps -p 19915 -o pid,etime,command
#

Once we see gateway.err.log (or launchctl print output), we’ll know exactly why it never reaches the “listening on …” step.

grand cradle
#

jiwoongyoo@Jis-MacBook-Pro-2 ~ % openclaw config get env.shellEnv
Config path not found: env.shellEnv

cobalt socketBOT
#

Config path not found: env.shellEnv is totally fine — it just means you haven’t enabled shell env import in your config (so that’s not what’s causing this).

Right now we still have the same core symptom: launchd says the job is “running”, but nothing is actually listening on 19000, so the gateway is either crashing very early or stuck before bind. To see why, we need the LaunchAgent stdout/stderr logs (not the little “EXECUTE_NEW” lines).

Please run these and paste the output:

ls -la ~/.openclaw/logs | sed -n '1,120p'

echo "---- gateway.err.log ----"
tail -n 200 ~/.openclaw/logs/gateway.err.log 2>/dev/null || echo "no gateway.err.log"

echo "---- gateway.log ----"
tail -n 200 ~/.openclaw/logs/gateway.log 2>/dev/null || echo "no gateway.log"

echo "---- /tmp log tail ----"
#
tail -n 200 /tmp/openclaw/openclaw-2026-02-15.log

And also launchd’s view of the job (this often shows the exit code / respawn loop):

launchctl print gui/$UID/ai.openclaw.gateway | sed -n '1,220p'

Once we have gateway.err.log (or the launchctl print snippet), we can tell exactly what’s preventing it from reaching the normal line like listening on ws://127.0.0.1:19000.

grand cradle
#

jiwoongyoo@Jis-MacBook-Pro-2 ~ % launchctl print gui/$UID/ai.openclaw.gateway | sed -n '1,220p'
ps -p 19915 -o pid,etime,command
gui/501/ai.openclaw.gateway = {
active count = 0
path = /Users/jiwoongyoo/Library/LaunchAgents/ai.openclaw.gateway.plist
type = LaunchAgent
state = spawn scheduled

program = /opt/homebrew/bin/node
arguments = {
    /opt/homebrew/bin/node
    /opt/homebrew/lib/node_modules/openclaw/dist/index.js
    gateway
    --port
    19000
}

stdout path = /Users/jiwoongyoo/.openclaw/logs/gateway.log
stderr path = /Users/jiwoongyoo/.openclaw/logs/gateway.err.log
inherited environment = {
    SSH_AUTH_SOCK => /private/tmp/com.apple.launchd.adDrmHsp60/Listeners
}

default environment = {
    PATH => /usr/bin:/bin:/usr/sbin:/sbin
}

environment = {
    OSLogRateLimit => 64
    OPENCLAW_GATEWAY_TOKEN => 6b4ed628d347085e040e90f776d6ef6ea9cfe12fda9101af
    OPENCLAW_GATEWAY_PORT => 19000
    OPENCLAW_SERVICE_VERSION => 2026.2.13
    OPENCLAW_SYSTEMD_UNIT => openclaw-gateway.service
    OPENCLAW_LAUNCHD_LABEL => ai.openclaw.gateway
    PATH => /opt/homebrew/bin:/usr/local/bin:/usr/bin:/bin
    HOME => /Users/jiwoongyoo
    OPENCLAW_SERVICE_KIND => gateway
    OPENCLAW_SERVICE_MARKER => openclaw
    XPC_SERVICE_NAME => ai.openclaw.gateway
}
#

domain = gui/501 [100022]
asid = 100022
minimum runtime = 10
exit timeout = 5
runs = 78
last exit code = 0

resource coalition = {
    ID = 2124
    type = resource
    state = active
    active count = 1
    name = ai.openclaw.gateway
}

jetsam coalition = {
    ID = 2125
    type = jetsam
    state = active
    active count = 1
    name = ai.openclaw.gateway
}

spawn type = daemon (3)
jetsam priority = 40
jetsam memory limit (active) = (unlimited)
jetsam memory limit (inactive) = (unlimited)
jetsamproperties category = daemon
jetsam thread limit = 32
cpumon = default
job state = exited

properties = partial import | keepalive | runatload | inferred program

}
PID ELAPSED COMMAND

cobalt socketBOT
#

Two important things from that launchctl print:

  1. Your Gateway token got posted (OPENCLAW_GATEWAY_TOKEN=...). That’s effectively “admin access” to your local gateway. Please delete/edit that message in Discord and rotate the token after we’re done debugging.

You can rotate it like this (don’t paste the new token here):

openclaw config set gateway.auth.token "$(openssl rand -hex 32)"
openclaw gateway restart
  1. launchd says:
  • state = spawn scheduled
  • active count = 0

That usually means the job is crash-looping and launchd is throttling restarts (or it’s failing instantly). To see why, we need the part of launchctl print that includes last exit status / throttle info, plus the stderr log.

#

Paste these outputs

# show the rest of the job info (exit code / throttle / last spawn result)
launchctl print gui/$UID/ai.openclaw.gateway | sed -n '220,520p'

# the real error is almost always here:
tail -n 200 ~/.openclaw/logs/gateway.err.log
tail -n 200 ~/.openclaw/logs/gateway.log

Quick “force start once” (optional but helpful)

launchctl kickstart -k gui/$UID/ai.openclaw.gateway
sleep 2
#
lsof -nP -iTCP:19000 -sTCP:LISTEN || true

Once we see gateway.err.log + the “last exit code” section, we’ll know exactly what’s killing it under launchd (permissions, config parse error, missing file, etc.).

#

That launchctl print + the ps output is telling:

  • job state = exited, active count = 0, runs = 78
  • ps -p 19915 … printed only the header → that PID is gone
  • so launchd is basically spawn-looping the job and it exits almost immediately (oddly with last exit code = 0).

We need the actual stdout/stderr from launchd to see why it’s exiting.

0) Security note: rotate your gateway token

You pasted OPENCLAW_GATEWAY_TOKEN earlier. Please delete/edit that Discord message, then rotate the token (don’t paste the new one):

openclaw config set gateway.auth.token "$(openssl rand -hex 32)"
openclaw gateway restart

1) Show the service error logs (this is the key)

#

Paste these (they should contain the real reason it exits):

tail -n 200 ~/.openclaw/logs/gateway.err.log
tail -n 200 ~/.openclaw/logs/gateway.log

2) Force one immediate start, then re-tail logs

launchctl kickstart -k gui/$UID/ai.openclaw.gateway
sleep 2
lsof -nP -iTCP:19000 -sTCP:LISTEN || true
tail -n 200 ~/.openclaw/logs/gateway.err.log

Once we see gateway.err.log, we can stop guessing and tell you exactly what’s making it exit before it ever reaches listening on ws://127.0.0.1:19000.

grand cradle
#

, autoRecall: true, autoCapture: true)
2026-02-14T15:36:10.484Z [canvas] host mounted at http://127.0.0.1:19000/__openclaw__/canvas/ (root /Users/jiwoongyoo/.openclaw/canvas)
2026-02-14T15:36:10.523Z [heartbeat] started
2026-02-14T15:36:10.525Z [gateway] agent model: zai/glm-5
2026-02-14T15:36:10.526Z [gateway] listening on ws://127.0.0.1:19000 (PID 21236)
2026-02-14T15:36:10.526Z [gateway] listening on ws://[::1]:19000
2026-02-14T15:36:10.527Z [gateway] log file: /tmp/openclaw/openclaw-2026-02-15.log
2026-02-14T15:36:10.536Z [browser/service] Browser control service ready (profiles=2)
2026-02-14T15:36:10.630Z [hooks:loader] Registered hook: boot-md -> gateway:startup
2026-02-14T15:36:10.642Z [hooks:loader] Registered hook: bootstrap-extra-files -> agent:bootstrap
2026-02-14T15:36:10.642Z [hooks:loader] Registered hook: command-logger -> command
2026-02-14T15:36:10.644Z [hooks:loader] Registered hook: session-memory -> command:new
2026-02-15T02:36:10.645+11:00 ⚠️ Session file not found: gateway
2026-02-15T02:36:10.646+11:00 Proceeding with reset...
2026-02-15T02:36:10.647+11:00 EXECUTE_NEW

cobalt socketBOT
#

Perfect — that log snippet shows the Gateway is now actually up:

  • [gateway] listening on ws://127.0.0.1:19000
  • browser service ready, hooks loaded, etc.

The ⚠️ Session file not found: gateway … reset … EXECUTE_NEW is normal on first boot / after a reset and not an error.

Next checks:

  1. Confirm the port is really listening now:
lsof -nP -iTCP:19000 -sTCP:LISTEN
  1. Confirm the CLI can probe it without a manual --url override:
#
openclaw gateway status
openclaw status

If gateway status still shows Source: cli --url / still fails with 1006, that usually means you’re forcing --url somewhere, and when you do that the CLI won’t fall back to stored credentials. In that case, either:

  • don’t use --url (preferred), or
  • use --url … --token … (but do not paste the token in Discord).

Important: you accidentally posted OPENCLAW_GATEWAY_TOKEN earlier. Please delete/edit that message and rotate the token:

openclaw config set gateway.auth.token "$(openssl rand -hex 32)"
openclaw gateway restart
grand cradle
#

Gateway: bind=loopback (127.0.0.1), port=19000 (service args)
Probe target: ws://127.0.0.1:19000
Dashboard: http://127.0.0.1:19000/
Probe note: Loopback-only gateway; only local clients can connect.

Runtime: stopped (state active)
RPC probe: failed
RPC target: ws://127.0.0.1:19000
gateway closed (1006 abnormal closure (no close frame)): no close reason
Gateway target: ws://127.0.0.1:19000
Source: cli --url
Config: /Users/jiwoongyoo/.openclaw/openclaw.json

Service is loaded but not running (likely exited immediately).
File logs: /tmp/openclaw/openclaw-2026-02-15.log
Launchd stdout (if installed): /Users/jiwoongyoo/.openclaw/logs/gateway.log
Launchd stderr (if installed): /Users/jiwoongyoo/.openclaw/logs/gateway.err.log

Other gateway-like services detected (best effort):

  • ai.openclaw.mac (user, plist: /Users/jiwoongyoo/Library/LaunchAgents/ai.openclaw.mac.plist)
    Cleanup hint: launchctl bootout gui/$UID/ai.openclaw.gateway
    Cleanup hint: rm ~/Library/LaunchAgents/ai.openclaw.gateway.plist

Update │ pnpm · npm latest 2026.2.13 │
│ Gateway │ local · ws://127.0.0.1:19000 (local loopback) · unreachable (connect failed: │
│ │ connect ECONNREFUSED 127.0.0.1:19000) │
│ Gateway service │ LaunchAgent installed · loaded · stopped (state active) │
│ Node service │ LaunchAgent not installed │
│ Agents │ 1 · 1 bootstrapping · sessions 30 · default main active 5h ago │
│ Memory │ enabled (plugin openclaw-mem0) │
│ Probes │ skipped (use --deep)

#

Security audit
Summary: 1 critical ¡ 2 warn ¡ 1 info
CRITICAL DANGEROUS: Control UI device auth disabled
gateway.controlUi.dangerouslyDisableDeviceAuth=true disables device identity checks for the Control UI.
Fix: Disable it unless you are in a short-lived break-glass scenario.
WARN Reverse proxy headers are not trusted
gateway.bind is loopback and gateway.trustedProxies is empty. If you expose the Control UI through a reverse proxy, configure trusted proxies so local-client c…
Fix: Set gateway.trustedProxies to your proxy IPs or keep the Control UI local-only.
WARN Extension plugin tools may be reachable under permissive tool policy
Enabled extension plugins: openclaw-mem0. Permissive tool policy contexts: - default

cobalt socketBOT
#

The snippet you pasted from gateway.log is the good part (it did bind and print listening on ws://127.0.0.1:19000). But your latest openclaw gateway status / openclaw status shows ECONNREFUSED → which means the process exited again after that.

So we need the end of the launchd logs (the lines right after it stops), not the startup lines.

0) Quick security thing (important)

You accidentally pasted your OPENCLAW_GATEWAY_TOKEN earlier. Please delete/edit that Discord message and rotate the token (don’t paste the new one):

openclaw config set gateway.auth.token "$(openssl rand -hex 32)"
openclaw gateway restart

1) Reproduce + capture the exit reason

Run this as a bundle and paste the output:

#
launchctl kickstart -k gui/$UID/ai.openclaw.gateway
sleep 2
lsof -nP -iTCP:19000 -sTCP:LISTEN || true

echo "---- ERR (last 120) ----"
tail -n 120 ~/.openclaw/logs/gateway.err.log || true

echo "---- LOG (last 200) ----"
tail -n 200 ~/.openclaw/logs/gateway.log || true

What we’re looking for is anything like “shutting down”, a stack trace, “unauthorized”, “config error”, etc. (Right now we only see it starting, not why it stops.)

2) Also: list any other OpenClaw launchd jobs (possible conflict)

#
launchctl list | grep -i openclaw || true

Once you paste the tail of gateway.err.log + the last ~200 lines of gateway.log, it’ll be obvious what’s killing it.

#

That security audit output is worth fixing ASAP — especially because you already pasted a gateway token earlier.

Fix the CRITICAL: Control UI device auth disabled

You have:

  • gateway.controlUi.dangerouslyDisableDeviceAuth=true ← break-glass only

Turn it off:

openclaw config set gateway.controlUi.dangerouslyDisableDeviceAuth false --json
openclaw gateway restart

Rotate your gateway token (since it was posted)

Please delete/edit the Discord message that contained the token, then rotate it (don’t paste the new one):

#
openclaw config set gateway.auth.token "$(openssl rand -hex 32)"
openclaw gateway restart

The WARNs

  • Reverse proxy headers not trusted: if you’re truly loopback-only (127.0.0.1) and not putting it behind a reverse proxy, you can ignore this. If you are proxying the Control UI, you should set gateway.trustedProxies to your proxy IPs.
  • Extension plugin tools reachable under permissive policy: mostly informational for local personal use. If this gateway is exposed to others, we can lock down tool policy later.

Separate issue: gateway keeps exiting (why you still get 1006 / ECONNREFUSED)

Your earlier gateway.log showed it did bind to :19000, but then later openclaw status shows ECONNREFUSED again — so it’s exiting after startup.

To find the exact reason, paste the tail of stderr, not the startup log:

#
tail -n 200 ~/.openclaw/logs/gateway.err.log
tail -n 200 ~/.openclaw/logs/gateway.log

If you want to force a fresh crash/repro right before tailing:

launchctl kickstart -k gui/$UID/ai.openclaw.gateway
sleep 2
lsof -nP -iTCP:19000 -sTCP:LISTEN || true
tail -n 200 ~/.openclaw/logs/gateway.err.log

Once we see gateway.err.log, we’ll know exactly what’s killing the service.

grand cradle
#

2026-02-14T15:43:18.583Z [gateway] openclaw-mem0: registered (mode: platform, user: ji, graph: false, autoRecall: true, autoCapture: true)
2026-02-14T15:43:18.965Z [canvas] host mounted at http://127.0.0.1:19000/__openclaw__/canvas/ (root /Users/jiwoongyoo/.openclaw/canvas)
2026-02-14T15:43:19.005Z [heartbeat] started
2026-02-14T15:43:19.007Z [gateway] agent model: zai/glm-5
2026-02-14T15:43:19.008Z [gateway] listening on ws://127.0.0.1:19000 (PID 21940)
2026-02-14T15:43:19.008Z [gateway] listening on ws://[::1]:19000
2026-02-14T15:43:19.009Z [gateway] log file: /tmp/openclaw/openclaw-2026-02-15.log
2026-02-14T15:43:19.018Z [browser/service] Browser control service ready (profiles=2)
2026-02-14T15:43:19.111Z [hooks:loader] Registered hook: boot-md -> gateway:startup
2026-02-14T15:43:19.122Z [hooks:loader] Registered hook: bootstrap-extra-files -> agent:bootstrap
2026-02-14T15:43:19.122Z [hooks:loader] Registered hook: command-logger -> command
2026-02-14T15:43:19.125Z [hooks:loader] Registered hook: session-memory -> command:new
2026-02-15T02:43:19.125+11:00 ⚠️ Session file not found: gateway
2026-02-15T02:43:19.126+11:00 Proceeding with reset...
2026-02-15T02:43:19.127+11:00 EXECUTE_NEW

cobalt socketBOT
#

Those gateway.log lines look healthy (it does bind and prints listening on ws://127.0.0.1:19000 (PID …)), but then your openclaw status immediately after shows ECONNREFUSED / “service … exited immediately” — so it’s starting and then stopping a moment later.

Right now we’re missing the one thing that explains why: ~/.openclaw/logs/gateway.err.log (launchd stderr). The stdout log you pasted won’t show crashes.

Please paste these (important: redact tokens/keys if any show up):

# after it "stops", grab the tails:
tail -n 200 ~/.openclaw/logs/gateway.err.log
tail -n 200 ~/.openclaw/logs/gateway.log

# and confirm whether anything is listening right now:
lsof -nP -iTCP:19000 -sTCP:LISTEN || true

If gateway.err.log is empty, also paste:

#
ls -la ~/.openclaw/logs

Two important side-notes:

  1. You previously pasted OPENCLAW_GATEWAY_TOKEN from launchctl print. That’s effectively admin access to your gateway. Please delete/edit that Discord message and rotate the token (don’t paste the new one):
openclaw config set gateway.auth.token "$(openssl rand -hex 32)"
openclaw gateway restart
  1. Your security audit flagged CRITICAL: gateway.controlUi.dangerouslyDisableDeviceAuth=true. Turn that off unless you really need break-glass:
#
openclaw config set gateway.controlUi.dangerouslyDisableDeviceAuth false --json
openclaw gateway restart

Once you paste the gateway.err.log tail, we should be able to point to the exact line that’s making launchd exit the gateway.

grand cradle
#

026-02-14T15:46:08.197Z [gateway] openclaw-mem0: registered (mode: platform, user: ji, graph: false, autoRecall: true, autoCapture: true)
2026-02-14T15:46:08.603Z [canvas] host mounted at http://127.0.0.1:19000/__openclaw__/canvas/ (root /Users/jiwoongyoo/.openclaw/canvas)
2026-02-14T15:46:08.643Z [heartbeat] started
2026-02-14T15:46:08.645Z [gateway] agent model: zai/glm-5
2026-02-14T15:46:08.646Z [gateway] listening on ws://127.0.0.1:19000 (PID 22419)
2026-02-14T15:46:08.646Z [gateway] listening on ws://[::1]:19000
2026-02-14T15:46:08.647Z [gateway] log file: /tmp/openclaw/openclaw-2026-02-15.log
2026-02-14T15:46:08.656Z [browser/service] Browser control service ready (profiles=2)
2026-02-14T15:46:08.751Z [hooks:loader] Registered hook: boot-md -> gateway:startup
2026-02-14T15:46:08.762Z [hooks:loader] Registered hook: bootstrap-extra-files -> agent:bootstrap
2026-02-14T15:46:08.762Z [hooks:loader] Registered hook: command-logger -> command
2026-02-14T15:46:08.764Z [hooks:loader] Registered hook: session-memory -> command:new
2026-02-15T02:46:08.765+11:00 ⚠️ Session file not found: gateway
2026-02-15T02:46:08.767+11:00 Proceeding with reset...
2026-02-15T02:46:08.767+11:00 EXECUTE_NEW
jiwoongyoo@Jis-MacBook-Pro-2 ~ % lsof -nP -iTCP:19000 -sTCP:LISTEN || true
jiwoongyoo@Jis-MacBook-Pro-2 ~ % ls -la ~/.openclaw/logs
total 64296
drwx------ 5 jiwoongyoo staff 160 14 Feb 15:56 .
drwx------@ 41 jiwoongyoo staff 1312 15 Feb 02:44 ..
-rw-------@ 1 jiwoongyoo staff 26829 15 Feb 02:42 config-audit.jsonl
-rwx------ 1 jiwoongyoo staff 27262236 15 Feb 01:36 gateway.err.log
-rwx------ 1 jiwoongyoo staff 4599414 15 Feb 02:46 gateway.log
jiwoongyoo@Jis-MacBook-Pro-2 ~ % openclaw config set gateway.controlUi.dangerouslyDisableDeviceAuth false --json

cobalt socketBOT
#

Good: your gateway.log shows it does start and bind:

  • listening on ws://127.0.0.1:19000 (PID …)

But then lsof shows nothing listening, so the process is exiting almost immediately after startup. The only place that will say why is gateway.err.log.

1) Paste the tail of stderr (redact any tokens/keys)

tail -n 120 ~/.openclaw/logs/gateway.err.log

If it’s super noisy, this often pulls the useful bits:

rg -n "ERROR|Error|FATAL|Unhandled|EADDR|ECONN|permission|ENOENT|EACCES" ~/.openclaw/logs/gateway.err.log | tail -n 60

2) Catch it “in the act” (so we know if it lives for 0.2s vs 5s)

#
launchctl kickstart -k gui/$UID/ai.openclaw.gateway
for i in {1..12}; do lsof -nP -iTCP:19000 -sTCP:LISTEN; sleep 0.25; done

3) You flipped the CRITICAL setting — now restart

You ran:
openclaw config set gateway.controlUi.dangerouslyDisableDeviceAuth false --json

Now do:

openclaw gateway restart

Also: you accidentally posted your OPENCLAW_GATEWAY_TOKEN earlier. Please delete/edit that Discord message and rotate the token (don’t paste the new one):

#
openclaw config set gateway.auth.token "$(openssl rand -hex 32)"
openclaw gateway restart

Once you paste the gateway.err.log tail, we’ll be able to tell exactly what’s killing the LaunchAgent.

grand cradle
#

jiwoongyoo@Jis-MacBook-Pro-2 ~ % launchctl kickstart -k gui/$UID/ai.openclaw.gateway
for i in {1..12}; do lsof -nP -iTCP:19000 -sTCP:LISTEN; sleep 0.25; done
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
node 23150 jiwoongyoo 16u IPv4 0x9d80409a76fdba6f 0t0 TCP 127.0.0.1:19000 (LISTEN)
node 23150 jiwoongyoo 17u IPv6 0xfcdf034f3e471dc7 0t0 TCP [::1]:19000 (LISTEN)

cobalt socketBOT
#

Nice — that loop shows the gateway is actually staying up and listening now (PID 23150 on both IPv4 + IPv6).

Next, verify the CLI can successfully RPC-probe it:

openclaw gateway status
openclaw status

If that now flips to RPC probe: ok, you’re done.

If gateway status still fails and says Source: cli --url: stop forcing --url (that bypasses normal credential fallback). Just run openclaw gateway status with no --url.

If you must use --url, you also need to pass auth explicitly (don’t paste tokens in Discord):

#
openclaw gateway status --url ws://127.0.0.1:19000 --token "<your-token>"

If it dies again after a few seconds/minutes

Then it’s crash-looping after initial bind. Grab the actual error (stderr):

tail -n 120 ~/.openclaw/logs/gateway.err.log
tail -n 60  ~/.openclaw/logs/gateway.log

Important security cleanup

You previously posted your OPENCLAW_GATEWAY_TOKEN (from launchctl print). Please delete/edit that message and rotate the token:

#
openclaw config set gateway.auth.token "$(openssl rand -hex 32)"
openclaw gateway restart

Tell me what openclaw gateway status shows right now (especially whether RPC probe is ok).

grand cradle
#

026-02-15T02:53:06.932+11:00 ⚠️ Session file not found: gateway
2026-02-15T02:53:06.933+11:00 Proceeding with reset...
2026-02-15T02:53:06.933+11:00 EXECUTE_NEW
2026-02-14T15:53:16.867Z [gateway] openclaw-mem0: registered (mode: platform, user: ji, graph: false, autoRecall: true, autoCapture: true)
2026-02-14T15:53:17.249Z [canvas] host mounted at http://127.0.0.1:19000/__openclaw__/canvas/ (root /Users/jiwoongyoo/.openclaw/canvas)
2026-02-14T15:53:17.290Z [heartbeat] started
2026-02-14T15:53:17.292Z [gateway] agent model: zai/glm-5
2026-02-14T15:53:17.293Z [gateway] listening on ws://127.0.0.1:19000 (PID 23487)
2026-02-14T15:53:17.293Z [gateway] listening on ws://[::1]:19000
2026-02-14T15:53:17.294Z [gateway] log file: /tmp/openclaw/openclaw-2026-02-15.log
2026-02-14T15:53:17.303Z [browser/service] Browser control service ready (profiles=2)
2026-02-14T15:53:17.399Z [hooks:loader] Registered hook: boot-md -> gateway:startup
2026-02-14T15:53:17.411Z [hooks:loader] Registered hook: bootstrap-extra-files -> agent:bootstrap
2026-02-14T15:53:17.412Z [hooks:loader] Registered hook: command-logger -> command
2026-02-14T15:53:17.414Z [hooks:loader] Registered hook: session-memory -> command:new
2026-02-15T02:53:17.415+11:00 ⚠️ Session file not found: gateway
2026-02-15T02:53:17.416+11:00 Proceeding with reset...
2026-02-15T02:53:17.417+11:00 EXECUTE_NEW

cobalt socketBOT
#

Those lines are just the gateway startup log (and they look fine: it is binding and printing listening on ws://127.0.0.1:19000). The ⚠️ Session file not found: gateway → reset → EXECUTE_NEW is normal on first boot / after a restart.

Now let’s confirm the current state (right now), because previously you had “listening…” in the log but ECONNREFUSED in openclaw status:

  1. Is it actually listening right now?
lsof -nP -iTCP:19000 -sTCP:LISTEN
  1. Does the CLI probe succeed without forcing --url?
openclaw gateway status

Important: your earlier status outputs kept saying Source: cli --url. If you run any command with --url …, the CLI won’t do its normal “use the service/config creds” behavior. So for debugging, run openclaw gateway status with no --url.

#

If lsof shows it’s listening but gateway status still fails, paste the output of openclaw gateway status (it won’t include secrets).

Security cleanup (please do this too):

  • You posted your OPENCLAW_GATEWAY_TOKEN earlier via launchctl print. Delete/edit that message and rotate the token:
    openclaw config set gateway.auth.token "$(openssl rand -hex 32)"
    openclaw gateway restart
    
grand cradle
#

Service: LaunchAgent (loaded)
File logs: /tmp/openclaw/openclaw-2026-02-15.log
Command: /opt/homebrew/bin/node /opt/homebrew/lib/node_modules/openclaw/dist/index.js gateway --port 19000
Service file: ~/Library/LaunchAgents/ai.openclaw.gateway.plist
Service env: OPENCLAW_GATEWAY_PORT=19000

Config (cli): ~/.openclaw/openclaw.json
Config (service): ~/.openclaw/openclaw.json

Gateway: bind=loopback (127.0.0.1), port=19000 (service args)
Probe target: ws://127.0.0.1:19000
Dashboard: http://127.0.0.1:19000/
Probe note: Loopback-only gateway; only local clients can connect.

Runtime: stopped (state active)
RPC probe: failed
RPC target: ws://127.0.0.1:19000
gateway closed (1006 abnormal closure (no close frame)): no close reason
Gateway target: ws://127.0.0.1:19000
Source: cli --url
Config: /Users/jiwoongyoo/.openclaw/openclaw.json

Service is loaded but not running (likely exited immediately).
File logs: /tmp/openclaw/openclaw-2026-02-15.log
Launchd stdout (if installed): /Users/jiwoongyoo/.openclaw/logs/gateway.log
Launchd stderr (if installed): /Users/jiwoongyoo/.openclaw/logs/gateway.err.log

cobalt socketBOT
#

The key contradiction is:

  • ~/.openclaw/logs/gateway.log shows it binds and starts (listening on ws://127.0.0.1:19000)
  • but openclaw gateway status shows ECONNREFUSED / Runtime: stopped → so it’s exiting shortly after startup

At this point the only thing that will tell us why it exits is the end of gateway.err.log (stderr). The stdout log you’re pasting won’t include crashes.

Run this to reproduce + capture the shutdown reason:

launchctl kickstart -k gui/$UID/ai.openclaw.gateway
sleep 1
lsof -nP -iTCP:19000 -sTCP:LISTEN || true

sleep 3
lsof -nP -iTCP:19000 -sTCP:LISTEN || true
#

tail -n 120 ~/.openclaw/logs/gateway.err.log
  • If the second lsof goes empty, we’ve confirmed it dies within a few seconds.
  • Then the last ~120 lines of gateway.err.log should show the exact error/stacktrace.

One more thing: your gateway status output keeps saying Source: cli --url. If you’re running commands with --url, try without it for now:

openclaw gateway status

(Just in case there’s a wrapper/alias injecting --url and confusing the probe behavior.)

grand cradle
#

(node:13520) [DEP0040] DeprecationWarning: The punycode module is deprecated. Please use a userland alternative instead.
(Use node --trace-deprecation ... to show where the warning was created)
(node:13534) [DEP0040] DeprecationWarning: The punycode module is deprecated. Please use a userland alternative instead.
(Use node --trace-deprecation ... to show where the warning was created)
(node:13614) [DEP0040] DeprecationWarning: The punycode module is deprecated. Please use a userland alternative instead.
(Use node --trace-deprecation ... to show where the warning was created)
(node:13636) [DEP0040] DeprecationWarning: The punycode module is deprecated. Please use a userland alternative instead.
(Use node --trace-deprecation ... to show where the warning was created)
(node:13651) [DEP0040] DeprecationWarning: The punycode module is deprecated. Please use a userland alternative instead.
(Use node --trace-deprecation ... to show where the warning was created)
(node:13665) [DEP0040] DeprecationWarning: The punycode module is deprecated. Please use a userland alternative instead.
(Use node --trace-deprecation ... to show where the warning was created)
(node:13681) [DEP0040] DeprecationWarning: The punycode module is deprecated. Please use a userland alternative instead.
(Use node --trace-deprecation ... to show where the warning was created)
(node:13695) [DEP0040] DeprecationWarning: The punycode module is deprecated. Please use a userland alternative instead.
(Use node --trace-deprecation ... to show where the warning was created)
(node:13709) [DEP0040] DeprecationWarning: The punycode module is deprecated. Please use a userland alternative instead.
(Use node --trace-deprecation ... to show where the warning was created)
(node:13723) [DEP0040] DeprecationWarning: The punycode module is deprecated. Please use a userland alternative instead.
(Use node --trace-deprecation ... to show where the warning was created)

cobalt socketBOT
#

Those DEP0040 punycode lines are just Node deprecation warnings (noise). They don’t explain the gateway dropping — they just spam gateway.err.log every time the process starts.

What we need now is to answer two questions:

1) Is the gateway actually up right now?

lsof -nP -iTCP:19000 -sTCP:LISTEN

2) If it is listening, can you successfully RPC into it when you include auth?

Run this (safe: it won’t print your token):

openclaw gateway call health \
  --url ws://127.0.0.1:19000 \
  --token "$(openclaw config get gateway.auth.token)" \
  --timeout 3000
#
  • If that succeeds, but openclaw gateway status still shows Source: cli --url + 1006, then you’re almost certainly forcing --url somewhere without credentials (alias/script). Quick check:

    type -a openclaw
    alias openclaw 2>/dev/null || true
    

    Fix is: don’t use --url (preferred), or always pair it with --token … like above.

  • If it’s not listening, then we need the tail end of the logs right after it exits (your pastes so far are only the startup section). Grab:

    tail -n 80 ~/.openclaw/logs/gateway.log
    tail -n 200 ~/.openclaw/logs/gateway.err.log | grep -v punycode | tail -n 80
    

Security cleanup (important): you posted OPENCLAW_GATEWAY_TOKEN earlier — please delete/edit that message and rotate it:

openclaw config set gateway.auth.token "$(openssl rand -hex 32)"
#
openclaw gateway restart
grand cradle
#

jiwoongyoo@Jis-MacBook-Pro-2 ~ % lsof -nP -iTCP:19000 -sTCP:LISTEN
jiwoongyoo@Jis-MacBook-Pro-2 ~ % openclaw gateway call health
--url ws://127.0.0.1:19000
--token "$(openclaw config get gateway.auth.token)"
--timeout 3000

◇
Gateway call failed: Error: gateway url override requires explicit credentials
Fix: pass --token or --password (or gatewayToken in tools).
Config: /Users/jiwoongyoo/.openclaw/openclaw.json

2026-02-14T16:06:11.670Z [gateway] openclaw-mem0: registered (mode: platform, user: ji, graph: false, autoRecall: true, autoCapture: true)
2026-02-14T16:06:12.060Z [canvas] host mounted at http://127.0.0.1:19000/__openclaw__/canvas/ (root /Users/jiwoongyoo/.openclaw/canvas)
2026-02-14T16:06:12.099Z [heartbeat] started
2026-02-14T16:06:12.101Z [gateway] agent model: zai/glm-5
2026-02-14T16:06:12.102Z [gateway] listening on ws://127.0.0.1:19000 (PID 24757)
2026-02-14T16:06:12.103Z [gateway] listening on ws://[::1]:19000
2026-02-14T16:06:12.104Z [gateway] log file: /tmp/openclaw/openclaw-2026-02-15.log
2026-02-14T16:06:12.112Z [browser/service] Browser control service ready (profiles=2)
2026-02-14T16:06:12.207Z [hooks:loader] Registered hook: boot-md -> gateway:startup
2026-02-14T16:06:12.219Z [hooks:loader] Registered hook: bootstrap-extra-files -> agent:bootstrap
2026-02-14T16:06:12.219Z [hooks:loader] Registered hook: command-logger -> command
2026-02-14T16:06:12.222Z [hooks:loader] Registered hook: session-memory -> command:new
2026-02-15T03:06:12.222+11:00 ⚠️ Session file not found: gateway
2026-02-15T03:06:12.223+11:00 Proceeding with reset...
2026-02-15T03:06:12.224+11:00 EXECUTE_NEW

cobalt socketBOT
#

Two separate things going on there:

1) lsof shows nothing listening

So at the exact moment you ran it, the gateway wasn’t up yet. Your gateway.log shows it came up a second later (listening on ws://127.0.0.1:19000 (PID 24757)).

Run this after you see the “listening…” line (or just wait 2s):

sleep 2
lsof -nP -iTCP:19000 -sTCP:LISTEN

2) gateway call … --url … is failing because your --token "$(openclaw config get gateway.auth.token)" is coming through empty

That error is thrown by the CLI before it even tries to connect. It only happens when --url is set and the token/password is missing/empty.

Most likely: gateway.auth.token is not set in your config, because the token is currently only stored in the LaunchAgent environment.

#

Check without printing the token:

openclaw config get gateway.auth.token >/dev/null && echo "token_in_config=yes" || echo "token_in_config=no"

Fix (make token live in config + service consistently)

This also helps because a token was pasted earlier and should be rotated anyway:

NEW="$(openssl rand -hex 32)"

openclaw gateway stop
openclaw config set gateway.auth.token "$NEW"
openclaw gateway install --port 19000 --force --token "$NEW"
openclaw gateway start
#

Then the probe should work:

openclaw gateway status
openclaw gateway call health --timeout 3000

(And you won’t need --url at all if your config/service already points at 19000.)

About the punycode warnings

Those (DEP0040) lines are just Node 22 deprecation noise; safe to ignore. They can spam gateway.err.log, but they aren’t the cause of the gateway not listening.

grand cradle
#

◇
Service: LaunchAgent (loaded)
File logs: /tmp/openclaw/openclaw-2026-02-15.log
Command: /opt/homebrew/bin/node /opt/homebrew/lib/node_modules/openclaw/dist/index.js gateway --port 19000
Service file: ~/Library/LaunchAgents/ai.openclaw.gateway.plist
Service env: OPENCLAW_GATEWAY_PORT=19000

Config (cli): ~/.openclaw/openclaw.json
Config (service): ~/.openclaw/openclaw.json

Gateway: bind=loopback (127.0.0.1), port=19000 (service args)
Probe target: ws://127.0.0.1:19000
Dashboard: http://127.0.0.1:19000/
Probe note: Loopback-only gateway; only local clients can connect.

Runtime: running (pid 25420, state active)
Warm-up: launch agents can take a few seconds. Try again shortly.
RPC probe: failed
RPC target: ws://127.0.0.1:19000
gateway closed (1006 abnormal closure (no close frame)): no close reason
Gateway target: ws://127.0.0.1:19000
Source: cli --url
Config: /Users/jiwoongyoo/.openclaw/openclaw.json

Gateway port 19000 is not listening (service appears running).
Last gateway error: 2026-02-14T22:14:53.450+11:00 Gateway start blocked: set gateway.mode=local (current: unset) or pass --allow-unconfigured.
Logs: ~/.openclaw/logs/gateway.log
Errors: ~/.openclaw/logs/gateway.err.log

Troubles: run openclaw status
Troubleshooting: https://docs.openclaw.ai/troubleshooting

Gateway call failed: Error: gateway closed (1006 abnormal closure (no close frame)): no close reason
Gateway target: ws://127.0.0.1:19000
Source: local loopback
Config: /Users/jiwoongyoo/.openclaw/openclaw.json
Bind: loopback

cobalt socketBOT
#

You’ve got two different issues mixed together in that output:

  1. Your CLI is probing with a --url override (Source: cli --url)
  2. Your Gateway is using a token (service env has OPENCLAW_GATEWAY_TOKEN), but your CLI likely doesn’t have a token in config, so the probe/auth fails and you see the generic WS 1006.

Also, that “Last gateway error: … gateway.mode=local unset” timestamp is from earlier — don’t trust it as the current reason; it’s just the last recorded failure.

Step A — stop forcing --url (this is key)

Run exactly this (no --url):

openclaw gateway status

If it still says Source: cli --url, you have an alias/wrapper injecting it. Check:

#
type -a openclaw
alias openclaw 2>/dev/null || true

Step B — ensure the token is in your config (so the CLI can auth)

Right now launchd has a token in the service environment, but your openclaw config get gateway.auth.token is probably empty (your earlier --token "$(openclaw config get …)" ended up treated as “no token”).

Don’t paste the token in Discord, just run this and tell me whether it prints yes:

openclaw config get gateway.auth.token >/dev/null && echo yes || echo no

If it prints no, fix it like this (this also rotates the token, which you should do anyway since one got pasted earlier):

#
NEW="$(openssl rand -hex 32)"

openclaw config set gateway.auth.token "$NEW"
openclaw gateway install --port 19000 --force --token "$NEW"
openclaw gateway restart

Step C — verify it’s actually listening, then do a health call

sleep 2
lsof -nP -iTCP:19000 -sTCP:LISTEN
openclaw gateway call health --timeout 3000

If lsof is empty again (flapping), then we need the actual crash reason from stderr (filtering out the punycode spam):

#
tail -n 200 ~/.openclaw/logs/gateway.err.log | grep -v punycode | tail -n 80

Reply with:

  • whether gateway.auth.token is yes/no
  • output of openclaw gateway status without --url
  • and (if flapping) the gateway.err.log tail above (with secrets redacted)
grand cradle
#

gateway.auth.token is yes

Service: LaunchAgent (loaded)
File logs: /tmp/openclaw/openclaw-2026-02-15.log
Command: /opt/homebrew/bin/node /opt/homebrew/lib/node_modules/openclaw/dist/index.js gateway --port 19000
Service file: ~/Library/LaunchAgents/ai.openclaw.gateway.plist
Service env: OPENCLAW_GATEWAY_PORT=19000

Config (cli): ~/.openclaw/openclaw.json
Config (service): ~/.openclaw/openclaw.json

Gateway: bind=loopback (127.0.0.1), port=19000 (service args)
Probe target: ws://127.0.0.1:19000
Dashboard: http://127.0.0.1:19000/
Probe note: Loopback-only gateway; only local clients can connect.

Runtime: stopped (state active)
RPC probe: failed
RPC target: ws://127.0.0.1:19000
gateway closed (1006 abnormal closure (no close frame)): no close reason
Gateway target: ws://127.0.0.1:19000
Source: cli --url
Config: /Users/jiwoongyoo/.openclaw/openclaw.json

Service is loaded but not running (likely exited immediately).
File logs: /tmp/openclaw/openclaw-2026-02-15.log
Launchd stdout (if installed): /Users/jiwoongyoo/.openclaw/logs/gateway.log
Launchd stderr (if installed): /Users/jiwoongyoo/.openclaw/logs/gateway.err.log

jiwoongyoo@Jis-MacBook-Pro-2 ~ % type -a openclaw
alias openclaw 2>/dev/null || true
openclaw is a shell function from /Users/jiwoongyoo/.zshrc
openclaw is /opt/homebrew/bin/openclaw

Gateway call failed: Error: gateway closed (1006 abnormal closure (no close frame)): no close reason
Gateway target: ws://127.0.0.1:19000
Source: local loopback
Config: /Users/jiwoongyoo/.openclaw/openclaw.json
Bind: loopback

cobalt socketBOT
#

You found the real culprit:

openclaw is a shell function from /Users/jiwoongyoo/.zshrc

That function is almost certainly injecting --url … (hence Source: cli --url) and once --url is involved the CLI won’t reliably use your saved creds unless the wrapper also passes --token/--password explicitly. So you end up with confusing 1006 probe failures even when the gateway is fine.

1) Bypass the .zshrc function (for this terminal)

Run:

unset -f openclaw
hash -r

(or just always use the full path /opt/homebrew/bin/openclaw)

Confirm you’re using the real binary:

#
type -a openclaw

2) Restart + verify it’s actually listening

/opt/homebrew/bin/openclaw gateway restart
sleep 2
lsof -nP -iTCP:19000 -sTCP:LISTEN || true

3) Probe with the real CLI (no --url)

/opt/homebrew/bin/openclaw gateway status
/opt/homebrew/bin/openclaw gateway call health --timeout 3000
#

4) If it still flaps/exits, grab the real error (stderr) minus punycode spam

tail -n 200 ~/.openclaw/logs/gateway.err.log | grep -v punycode | tail -n 80

(Optional but recommended) Fix it permanently

Show what the function is doing:

typeset -f openclaw

If it’s wrapping openclaw --url …, delete/adjust that function in ~/.zshrc (or rename it), so openclaw resolves to /opt/homebrew/bin/openclaw.

Paste:

  • output of lsof …19000… after the restart
  • output of /opt/homebrew/bin/openclaw gateway call health --timeout 3000
grand cradle
#

Service: LaunchAgent (loaded)
File logs: /tmp/openclaw/openclaw-2026-02-15.log
Command: /opt/homebrew/bin/node /opt/homebrew/lib/node_modules/openclaw/dist/index.js gateway --port 19000
Service file: ~/Library/LaunchAgents/ai.openclaw.gateway.plist
Service env: OPENCLAW_GATEWAY_PORT=19000

Config (cli): ~/.openclaw/openclaw.json
Config (service): ~/.openclaw/openclaw.json

Gateway: bind=loopback (127.0.0.1), port=19000 (service args)
Probe target: ws://127.0.0.1:19000
Dashboard: http://127.0.0.1:19000/
Probe note: Loopback-only gateway; only local clients can connect.

Runtime: stopped (state active)
RPC probe: failed
RPC target: ws://127.0.0.1:19000
gateway closed (1006 abnormal closure (no close frame)): no close reason
Gateway target: ws://127.0.0.1:19000
Source: cli --url
Config: /Users/jiwoongyoo/.openclaw/openclaw.json

Service is loaded but not running (likely exited immediately).
File logs: /tmp/openclaw/openclaw-2026-02-15.log
Launchd stdout (if installed): /Users/jiwoongyoo/.openclaw/logs/gateway.log
Launchd stderr (if installed): /Users/jiwoongyoo/.openclaw/logs/gateway.err.log

Troubles: run openclaw status
Troubleshooting: https://docs.openclaw.ai/troubleshooting

🦞 OpenClaw 2026.2.13 (203b5bd) — I read logs so you can keep pretending you don't have to.

│
◇
Gateway call failed: Error: gateway closed (1006 abnormal closure (no close frame)): no close reason
Gateway target: ws://127.0.0.1:19000
Source: local loopback
Config: /Users/jiwoongyoo/.openclaw/openclaw.json
Bind: loopback

cobalt socketBOT
#

You’re still not running the real CLI in that output:

  • Source: cli --url is coming from your .zshrc openclaw() shell function.
  • And type -a openclaw confirmed you have both a function and /opt/homebrew/bin/openclaw.

1) Bypass the function (don’t edit anything yet)

Run everything with command openclaw (this skips functions/aliases):

command openclaw gateway status

If that no longer says Source: cli --url, we’ve confirmed the wrapper was the problem.

2) Now check whether the gateway is actually staying up

Kick it, then watch the port for 3 seconds:

#
launchctl kickstart -k gui/$UID/ai.openclaw.gateway
for i in {1..12}; do lsof -nP -iTCP:19000 -sTCP:LISTEN; sleep 0.25; done

3) If it disappears (crash/exits), we need the real error (stderr)

Your gateway.err.log is huge and full of punycode warnings, so filter those out:

tail -n 400 ~/.openclaw/logs/gateway.err.log | grep -v punycode | tail -n 120

4) Fix permanently (optional): show what your wrapper does

typeset -f openclaw
#

Paste:

  1. output of command openclaw gateway status
  2. the 12-line lsof loop output
  3. the filtered gateway.err.log tail

Then we can tell if it’s (a) wrapper URL override, or (b) the LaunchAgent genuinely crash-looping and why.

grand cradle
#

it still says "source: cli --url"
Service: LaunchAgent (loaded)
File logs: /tmp/openclaw/openclaw-2026-02-15.log
Command: /opt/homebrew/bin/node /opt/homebrew/lib/node_modules/openclaw/dist/index.js gateway --port 19000
Service file: ~/Library/LaunchAgents/ai.openclaw.gateway.plist
Service env: OPENCLAW_GATEWAY_PORT=19000

Config (cli): ~/.openclaw/openclaw.json
Config (service): ~/.openclaw/openclaw.json

Gateway: bind=loopback (127.0.0.1), port=19000 (service args)
Probe target: ws://127.0.0.1:19000
Dashboard: http://127.0.0.1:19000/
Probe note: Loopback-only gateway; only local clients can connect.

Runtime: stopped (state active)
RPC probe: failed
RPC target: ws://127.0.0.1:19000
gateway closed (1006 abnormal closure (no close frame)): no close reason
Gateway target: ws://127.0.0.1:19000
Source: cli --url
Config: /Users/jiwoongyoo/.openclaw/openclaw.json

Service is loaded but not running (likely exited immediately).
File logs: /tmp/openclaw/openclaw-2026-02-15.log
Launchd stdout (if installed): /Users/jiwoongyoo/.openclaw/logs/gateway.log
Launchd stderr (if installed): /Users/jiwoongyoo/.openclaw/logs/gateway.err.log

Troubles: run openclaw status
Troubleshooting: https://docs.openclaw.ai/troubleshooting

cobalt socketBOT
#

If gateway.auth.token is set and you’re still seeing Source: cli --url, then something is still supplying a URL override, and it’s not the token problem anymore.

There are only two realistic sources:

  1. your .zshrc openclaw() function (even if you think you bypassed it), or
  2. config has gateway.remote.url set (CLI treats that as an “override URL” path)

Let’s disambiguate cleanly.

1) Run the binary by absolute path (bypasses the function 100%)

/opt/homebrew/bin/openclaw gateway status

If that still says Source: cli --url, then it’s coming from config, not your shell function.

2) Check whether you have gateway.remote.url set

#
/opt/homebrew/bin/openclaw config get gateway.remote.url
  • If it prints something (like ws://127.0.0.1:19000), unset it:
    /opt/homebrew/bin/openclaw config unset gateway.remote.url
    /opt/homebrew/bin/openclaw gateway restart
    

Then re-check:

/opt/homebrew/bin/openclaw gateway status

3) Separate issue: your Gateway service is currently stopped

To see if it’s crash-looping or just not started, do:

#
launchctl kickstart -k gui/$UID/ai.openclaw.gateway
sleep 1
lsof -nP -iTCP:19000 -sTCP:LISTEN || true

If it’s still not listening, grab the actual error (filtering out the punycode spam):

tail -n 400 ~/.openclaw/logs/gateway.err.log | grep -v punycode | tail -n 120

Paste:

  • output of /opt/homebrew/bin/openclaw config get gateway.remote.url
  • output of /opt/homebrew/bin/openclaw gateway status
  • and (if not listening) the filtered gateway.err.log tail above (redact secrets)
grand cradle
#

still says "source:cli --url"
jiwoongyoo@Jis-MacBook-Pro-2 ~ % /opt/homebrew/bin/openclaw config get gateway.remote.url

Config path not found: gateway.remote.url

jiwoongyoo@Jis-MacBook-Pro-2 ~ % launchctl kickstart -k gui/$UID/ai.openclaw.gateway
sleep 1
lsof -nP -iTCP:19000 -sTCP:LISTEN || true

#

2026-02-15T03:25:56.125+11:00 Gateway failed to start: another gateway instance is already listening on ws://127.0.0.1:19000
If the gateway is supervised, stop it with: openclaw gateway stop
2026-02-15T03:25:56.163+11:00 Port 19000 is already in use.
2026-02-15T03:25:56.164+11:00 - pid 26808 jiwoongyoo: openclaw-gateway (127.0.0.1:19000)
2026-02-15T03:25:56.164+11:00 - Gateway already running locally. Stop it (openclaw gateway stop) or use a different port.
2026-02-15T03:25:56.169+11:00 Gateway service appears loaded. Stop it first.
2026-02-15T03:25:56.169+11:00 Tip: openclaw gateway stop
2026-02-15T03:25:56.170+11:00 Or: launchctl bootout gui/$UID/ai.openclaw.gateway

cobalt socketBOT
#

gateway.remote.url being unset is good — so if you’re still seeing Source: cli --url, that means the process making the RPC call is still passing --url on the command line.

Since you confirmed you have an openclaw() function in ~/.zshrc, the fastest way to prove (and fix) this is:

1) Show what your openclaw() function is doing

Please run:

typeset -f openclaw | sed -n '1,160p'

I’m expecting to see it append something like --url ws://127.0.0.1:19000 (or similar). If so, that explains everything: the CLI treats that as a URL override, and then auth/token fallback behavior changes.

2) In this shell, disable the function and retest

unset -f openclaw
#
hash -r
type -a openclaw
openclaw gateway status

After unsetting, Source: should switch to something like local loopback (not cli --url).

3) Separate issue: your LaunchAgent is currently not listening

Your last paste didn’t include any lsof output after kickstart, so it’s likely exiting again. Run:

launchctl kickstart -k gui/$UID/ai.openclaw.gateway
for i in {1..12}; do lsof -nP -iTCP:19000 -sTCP:LISTEN || true; sleep 0.25; done

tail -n 120 ~/.openclaw/logs/gateway.err.log | grep -v punycode | tail -n 80
#
tail -n 80 ~/.openclaw/logs/gateway.log

Paste:

  • the typeset -f openclaw output
  • the 12-line lsof loop
  • the filtered gateway.err.log tail

Then we can pin down (a) the --url injection, and (b) why the LaunchAgent keeps dying.

#

There we go — this is the actual reason the LaunchAgent keeps flapping:

Gateway failed to start: another gateway instance is already listening on ws://127.0.0.1:19000
Port 19000 is already in use … pid 26808 … openclaw-gateway

So you’ve got two gateway instances fighting:

  • a manual/foreground (or leftover) gateway process already bound to 19000 (pid 26808)
  • launchd keeps trying to start its own gateway on the same port → it fails → CLI probes get weird/unstable.

Fix: pick ONE gateway and kill the other

Option A (recommended): use the LaunchAgent only

# stop both cleanly
/opt/homebrew/bin/openclaw gateway stop
#
pkill -f 'openclaw.*gateway.*--port 19000' || true   # if one is still hanging around

# then start the service
/opt/homebrew/bin/openclaw gateway start
sleep 2
lsof -nP -iTCP:19000 -sTCP:LISTEN
/opt/homebrew/bin/openclaw gateway status

Option B: keep the manual gateway, disable the LaunchAgent

/opt/homebrew/bin/openclaw gateway stop
launchctl bootout gui/$UID/ai.openclaw.gateway
# then run manually:
openclaw gateway --port 19000
#

Also: your “Source: cli --url” problem is separate

You still have an openclaw() shell function injecting --url. To stop that permanently, run:

typeset -f openclaw

Then remove/rename that function in ~/.zshrc, or in the meantime bypass it with:

unset -f openclaw
hash -r

Quick verification checklist

After you’ve stopped the duplicate gateway and have exactly one running:

#
lsof -nP -iTCP:19000 -sTCP:LISTEN
/opt/homebrew/bin/openclaw gateway status

If you paste the output of lsof …19000… and openclaw gateway status after doing Option A, we can confirm it’s stable.

grand cradle
#

Service: LaunchAgent (not loaded)
File logs: /tmp/openclaw/openclaw-2026-02-15.log
Command: /opt/homebrew/bin/node /opt/homebrew/lib/node_modules/openclaw/dist/index.js gateway --port 19000
Service file: ~/Library/LaunchAgents/ai.openclaw.gateway.plist
Service env: OPENCLAW_GATEWAY_PORT=19000

Config (cli): ~/.openclaw/openclaw.json
Config (service): ~/.openclaw/openclaw.json

Gateway: bind=loopback (127.0.0.1), port=19000 (service args)
Probe target: ws://127.0.0.1:19000
Dashboard: http://127.0.0.1:19000/
Probe note: Loopback-only gateway; only local clients can connect.

Runtime: unknown (Bad request.
Could not find service "ai.openclaw.gateway" in domain for user gui: 501)
RPC probe: failed
RPC target: ws://127.0.0.1:19000
gateway closed (1006 abnormal closure (no close frame)): no close reason
Gateway target: ws://127.0.0.1:19000
Source: cli --url
Config: /Users/jiwoongyoo/.openclaw/openclaw.json

Service unit not found.
Service not installed. Run: openclaw gateway install
File logs: /tmp/openclaw/openclaw-2026-02-15.log

cobalt socketBOT
#

Good — you’ve successfully booted out / removed the LaunchAgent, so now there’s no background service (that’s why it says “Service not installed / not loaded”). At this point you just need to choose what you want:

Option 1 (recommended): put the LaunchAgent back (one gateway, always-on)

/opt/homebrew/bin/openclaw gateway install --port 19000 --force
/opt/homebrew/bin/openclaw gateway start
sleep 2
lsof -nP -iTCP:19000 -sTCP:LISTEN
/opt/homebrew/bin/openclaw gateway status

Option 2: run the gateway manually (no LaunchAgent)

In a terminal, run:

/opt/homebrew/bin/openclaw gateway --port 19000

Leave that terminal open. In a second terminal:

#
lsof -nP -iTCP:19000 -sTCP:LISTEN
/opt/homebrew/bin/openclaw gateway call health --timeout 3000

About “Source: cli --url”

That’s still your .zshrc openclaw() function injecting --url. Fix by removing/renaming it, or in the current terminal:

unset -f openclaw
hash -r
type -a openclaw

Then rerun openclaw gateway status and it should no longer show cli --url.

If you tell me whether you want LaunchAgent (Option 1) or manual (Option 2), I’ll keep the steps tight and you’ll be stable from here.

grand cradle
#

Service: LaunchAgent (loaded)
File logs: /tmp/openclaw/openclaw-2026-02-15.log
Command: /opt/homebrew/bin/node /opt/homebrew/lib/node_modules/openclaw/dist/index.js gateway --port 19000
Service file: ~/Library/LaunchAgents/ai.openclaw.gateway.plist
Service env: OPENCLAW_GATEWAY_PORT=19000

Config (cli): ~/.openclaw/openclaw.json
Config (service): ~/.openclaw/openclaw.json

Gateway: bind=loopback (127.0.0.1), port=19000 (service args)
Probe target: ws://127.0.0.1:19000
Dashboard: http://127.0.0.1:19000/
Probe note: Loopback-only gateway; only local clients can connect.

Runtime: stopped (state active)
RPC probe: failed
RPC target: ws://127.0.0.1:19000
gateway closed (1006 abnormal closure (no close frame)): no close reason
Gateway target: ws://127.0.0.1:19000
Source: cli --url
Config: /Users/jiwoongyoo/.openclaw/openclaw.json

Service is loaded but not running (likely exited immediately).
File logs: /tmp/openclaw/openclaw-2026-02-15.log
Launchd stdout (if installed): /Users/jiwoongyoo/.openclaw/logs/gateway.log
Launchd stderr (if installed): /Users/jiwoongyoo/.openclaw/logs/gateway.err.log

Troubles: run openclaw status
Troubleshooting: https://docs.openclaw.ai/troubleshooting
jiwoongyoo@Jis-MacBook-Pro-2 ~ % unset -f openclaw
hash -r
type -a openclaw
unset: no such hash table element: openclaw
openclaw is /opt/homebrew/bin/openclaw

cobalt socketBOT
#

Good — type -a openclaw now shows you’re using the real binary (/opt/homebrew/bin/openclaw). That should eliminate the confusing “Source: cli --url” once you re-run the command.

Now we just need to get the LaunchAgent actually running (right now it’s loaded but exited).

Run these exactly and paste the outputs:

# 1) Re-run status now that the shell function is gone
/opt/homebrew/bin/openclaw gateway status

# 2) Check if something else is already holding the port
lsof -nP -iTCP:19000 -sTCP:LISTEN || true

# 3) Try starting the service again
/opt/homebrew/bin/openclaw gateway start
sleep 2
#
lsof -nP -iTCP:19000 -sTCP:LISTEN || true

# 4) If it still exits, grab the real error (filtering punycode spam)
tail -n 200 ~/.openclaw/logs/gateway.err.log | grep -v punycode | tail -n 80
tail -n 120 ~/.openclaw/logs/gateway.log | tail -n 80

What I’m expecting we’ll see in either lsof or gateway.err.log is one of:

  • port already in use (another gateway instance still running), or
  • a concrete startup error we can fix.

If lsof shows a PID listening on 19000, paste that line — then we’ll decide whether to stop that process or move the service to a different port.

grand cradle
#

jiwoongyoo@Jis-MacBook-Pro-2 ~ % /opt/homebrew/bin/openclaw gateway status

🦞 OpenClaw 2026.2.13 (203b5bd) — Ship fast, log faster.

│
◇
Service: LaunchAgent (loaded)
File logs: /tmp/openclaw/openclaw-2026-02-15.log
Command: /opt/homebrew/bin/node /opt/homebrew/lib/node_modules/openclaw/dist/index.js gateway --port 19000
Service file: ~/Library/LaunchAgents/ai.openclaw.gateway.plist
Service env: OPENCLAW_GATEWAY_PORT=19000

Config (cli): ~/.openclaw/openclaw.json
Config (service): ~/.openclaw/openclaw.json

Gateway: bind=loopback (127.0.0.1), port=19000 (service args)
Probe target: ws://127.0.0.1:19000
Dashboard: http://127.0.0.1:19000/
Probe note: Loopback-only gateway; only local clients can connect.

Runtime: stopped (state active)
RPC probe: failed
RPC target: ws://127.0.0.1:19000
gateway closed (1006 abnormal closure (no close frame)): no close reason
Gateway target: ws://127.0.0.1:19000
Source: cli --url
Config: /Users/jiwoongyoo/.openclaw/openclaw.json

Service is loaded but not running (likely exited immediately).
File logs: /tmp/openclaw/openclaw-2026-02-15.log
Launchd stdout (if installed): /Users/jiwoongyoo/.openclaw/logs/gateway.log
Launchd stderr (if installed): /Users/jiwoongyoo/.openclaw/logs/gateway.err.log

Troubles: run openclaw status
Troubleshooting: https://docs.openclaw.ai/troubleshooting

#

Service: LaunchAgent (loaded)
File logs: /tmp/openclaw/openclaw-2026-02-15.log
Command: /opt/homebrew/bin/node /opt/homebrew/lib/node_modules/openclaw/dist/index.js gateway --port 19000
Service file: ~/Library/LaunchAgents/ai.openclaw.gateway.plist
Service env: OPENCLAW_GATEWAY_PORT=19000

Config (cli): ~/.openclaw/openclaw.json
Config (service): ~/.openclaw/openclaw.json

Gateway: bind=loopback (127.0.0.1), port=19000 (service args)
Probe target: ws://127.0.0.1:19000
Dashboard: http://127.0.0.1:19000/
Probe note: Loopback-only gateway; only local clients can connect.

Runtime: stopped (state active)
RPC probe: failed
RPC target: ws://127.0.0.1:19000
gateway closed (1006 abnormal closure (no close frame)): no close reason
Gateway target: ws://127.0.0.1:19000
Source: cli --url
Config: /Users/jiwoongyoo/.openclaw/openclaw.json

Service is loaded but not running (likely exited immediately).
File logs: /tmp/openclaw/openclaw-2026-02-15.log
Launchd stdout (if installed): /Users/jiwoongyoo/.openclaw/logs/gateway.log
Launchd stderr (if installed): /Users/jiwoongyoo/.openclaw/logs/gateway.err.log

Troubles: run openclaw status
Troubleshooting: https://docs.openclaw.ai/troubleshooting
jiwoongyoo@Jis-MacBook-Pro-2 ~ % launchctl unload ~/Library/LaunchAgents/ai.openclaw.gateway.plist 2>/dev/null
jiwoongyoo@Jis-MacBook-Pro-2 ~ % launchctl enable gui/$UID/ai.openclaw.gateway
jiwoongyoo@Jis-MacBook-Pro-2 ~ % /opt/homebrew/bin/openclaw gateway install --port 19000 --force

🦞 OpenClaw 2026.2.13 (203b5bd)
WhatsApp automation without the "please accept our new privacy policy".

Installed LaunchAgent: /Users/jiwoongyoo/Library/LaunchAgents/ai.openclaw.gateway.plist
Logs: /Users/jiwoongyoo/.openclaw/logs/gateway.log
jiwoongyoo@Jis-MacBook-Pro-2 ~ % launchctl bootstrap gui/$UID ~/Library/LaunchAgents/ai.openclaw.gateway.plist
Bootstrap failed: 5: Input/output error
Try re-running the command as root for richer errors.

cobalt socketBOT
#

launchctl bootstrap … returning “Bootstrap failed: 5: Input/output error” almost always means launchd thinks there’s already a job with that label loaded/stuck, or the plist is invalid/unreadable. Let’s reset the launchd job cleanly and avoid the deprecated unload.

Run these exactly (use the real binary path):

# 1) Make sure no other gateway is still holding the port
lsof -nP -iTCP:19000 -sTCP:LISTEN || true

# 2) Boot out any existing/stuck job (ignore errors)
launchctl bootout gui/$UID/ai.openclaw.gateway 2>/dev/null || true

# 3) Sanity-check the plist
plutil -lint ~/Library/LaunchAgents/ai.openclaw.gateway.plist

# 4) Re-install + start via the CLI (preferred)
 /opt/homebrew/bin/openclaw gateway install --port 19000 --force
#
 /opt/homebrew/bin/openclaw gateway start

# 5) Verify it’s listening
sleep 2
lsof -nP -iTCP:19000 -sTCP:LISTEN || true
/opt/homebrew/bin/openclaw gateway status

If plutil -lint reports anything other than “OK”, paste that output.

If gateway start still fails, paste:

launchctl print gui/$UID/ai.openclaw.gateway | sed -n '1,140p'
tail -n 120 ~/.openclaw/logs/gateway.err.log | grep -v punycode | tail -n 80
#

One more thing: you previously had a stray gateway already listening on 19000. If lsof shows any PID on 19000 before starting the service, stop it first:

/opt/homebrew/bin/openclaw gateway stop
grand cradle
#

Service: LaunchAgent (loaded)
File logs: /tmp/openclaw/openclaw-2026-02-15.log
Command: /opt/homebrew/bin/node /opt/homebrew/lib/node_modules/openclaw/dist/index.js gateway --port 19000
Service file: ~/Library/LaunchAgents/ai.openclaw.gateway.plist
Service env: OPENCLAW_GATEWAY_PORT=19000

Config (cli): ~/.openclaw/openclaw.json
Config (service): ~/.openclaw/openclaw.json

Gateway: bind=loopback (127.0.0.1), port=19000 (service args)
Probe target: ws://127.0.0.1:19000
Dashboard: http://127.0.0.1:19000/
Probe note: Loopback-only gateway; only local clients can connect.

Runtime: stopped (state active)
RPC probe: failed
RPC target: ws://127.0.0.1:19000
gateway closed (1006 abnormal closure (no close frame)): no close reason
Gateway target: ws://127.0.0.1:19000
Source: cli --url
Config: /Users/jiwoongyoo/.openclaw/openclaw.json

Service is loaded but not running (likely exited immediately).
File logs: /tmp/openclaw/openclaw-2026-02-15.log
Launchd stdout (if installed): /Users/jiwoongyoo/.openclaw/logs/gateway.log
Launchd stderr (if installed): /Users/jiwoongyoo/.openclaw/logs/gateway.err.log

cobalt socketBOT
#

You’re good on the shell side now (type -a openclaw shows only /opt/homebrew/bin/openclaw). The output you pasted above still has Source: cli --url, but you didn’t re-run gateway status after removing the function — so let’s get a clean read, and also see why the LaunchAgent immediately exits.

Run these 3 commands and paste outputs:

# 1) Clean status read (must be the real binary)
 /opt/homebrew/bin/openclaw gateway status --no-probe

# 2) Try to start it, then check if anything is actually listening
 /opt/homebrew/bin/openclaw gateway start
sleep 2
lsof -nP -iTCP:19000 -sTCP:LISTEN || true

# 3) If it’s not listening, this tail usually contains the real reason it exited
tail -n 200 ~/.openclaw/logs/gateway.err.log | grep -v punycode | tail -n 80
#

Two common outcomes:

  • If lsof shows something listening on 19000 already → you still have another gateway instance running and the service will keep failing. Paste the lsof line (PID).
  • If lsof is empty → gateway.err.log tail will tell us the exact crash/start-block reason.

Also: you pasted a gateway token earlier in the thread. Please rotate it once things are stable (don’t paste the new one).

grand cradle
#

Service: LaunchAgent (loaded)
File logs: /tmp/openclaw/openclaw-2026-02-15.log
Command: /opt/homebrew/bin/node /opt/homebrew/lib/node_modules/openclaw/dist/index.js gateway --port 19000
Service file: ~/Library/LaunchAgents/ai.openclaw.gateway.plist
Service env: OPENCLAW_GATEWAY_PORT=19000

Config (cli): ~/.openclaw/openclaw.json
Config (service): ~/.openclaw/openclaw.json

Gateway: bind=loopback (127.0.0.1), port=19000 (service args)
Probe target: ws://127.0.0.1:19000
Dashboard: http://127.0.0.1:19000/
Probe note: Loopback-only gateway; only local clients can connect.

Runtime: stopped (state active)
Service is loaded but not running (likely exited immediately).
File logs: /tmp/openclaw/openclaw-2026-02-15.log
Launchd stdout (if installed): /Users/jiwoongyoo/.openclaw/logs/gateway.log
Launchd stderr (if installed): /Users/jiwoongyoo/.openclaw/logs/gateway.err.log

2026-02-15T03:25:56.125+11:00 Gateway failed to start: another gateway instance is already listening on ws://127.0.0.1:19000
If the gateway is supervised, stop it with: openclaw gateway stop
2026-02-15T03:25:56.163+11:00 Port 19000 is already in use.
2026-02-15T03:25:56.164+11:00 - pid 26808 jiwoongyoo: openclaw-gateway (127.0.0.1:19000)
2026-02-15T03:25:56.164+11:00 - Gateway already running locally. Stop it (openclaw gateway stop) or use a different port.
2026-02-15T03:25:56.169+11:00 Gateway service appears loaded. Stop it first.
2026-02-15T03:25:56.169+11:00 Tip: openclaw gateway stop
2026-02-15T03:25:56.170+11:00 Or: launchctl bootout gui/$UID/ai.openclaw.gateway

cobalt socketBOT
#

That log tail is the whole problem:

  • Port 19000 is already in use
  • by pid 26808 (openclaw-gateway)
  • so the LaunchAgent can’t start, and it exits immediately.

You need exactly one gateway on that port.

Fix (use LaunchAgent, kill the stray gateway process)

# confirm what’s holding the port
lsof -nP -iTCP:19000 -sTCP:LISTEN

# inspect the process (safe)
ps -p 26808 -o pid,ppid,etime,command
#

# stop it (graceful)
kill 26808
sleep 1

# verify the port is free
lsof -nP -iTCP:19000 -sTCP:LISTEN || true

# now start the LaunchAgent gateway
/opt/homebrew/bin/openclaw gateway start
sleep 2
/opt/homebrew/bin/openclaw gateway status

If kill 26808 doesn’t stop it, do:

#
kill -9 26808

After this, gateway status should flip to RPC probe: ok and lsof should show a listener on 127.0.0.1:19000.

(And separately: since a gateway token was pasted earlier, rotate it once you’re stable.)

grand cradle
#

Service: LaunchAgent (loaded)
File logs: /tmp/openclaw/openclaw-2026-02-15.log
Command: /opt/homebrew/bin/node /opt/homebrew/lib/node_modules/openclaw/dist/index.js gateway --port 19000
Service file: ~/Library/LaunchAgents/ai.openclaw.gateway.plist
Service env: OPENCLAW_GATEWAY_PORT=19000

Config (cli): ~/.openclaw/openclaw.json
Config (service): ~/.openclaw/openclaw.json

Gateway: bind=loopback (127.0.0.1), port=19000 (service args)
Probe target: ws://127.0.0.1:19000
Dashboard: http://127.0.0.1:19000/
Probe note: Loopback-only gateway; only local clients can connect.

Runtime: stopped (state active)
RPC probe: failed
RPC target: ws://127.0.0.1:19000
gateway closed (1006 abnormal closure (no close frame)): no close reason
Gateway target: ws://127.0.0.1:19000
Source: cli --url
Config: /Users/jiwoongyoo/.openclaw/openclaw.json

Service is loaded but not running (likely exited immediately).
File logs: /tmp/openclaw/openclaw-2026-02-15.log
Launchd stdout (if installed): /Users/jiwoongyoo/.openclaw/logs/gateway.log
Launchd stderr (if installed): /Users/jiwoongyoo/.openclaw/logs/gateway.err.log

Troubles: run openclaw status
Troubleshooting: https://docs.openclaw.ai/troubleshooting
jiwoongyoo@Jis-MacBook-Pro-2 ~ % kill -9 26808
kill: kill 26808 failed: no such process

cobalt socketBOT
#

Yep — that just means PID 26808 was already gone (so the “port in use” blocker is likely cleared now).

Now do this sequence (use the absolute path so we’re definitely not hitting any wrapper that adds --url):

# 1) confirm the port is actually free
lsof -nP -iTCP:19000 -sTCP:LISTEN || true

# 2) start the LaunchAgent gateway
/opt/homebrew/bin/openclaw gateway start
sleep 2

# 3) confirm it’s listening
lsof -nP -iTCP:19000 -sTCP:LISTEN || true

# 4) re-check status (fresh output)
#
/opt/homebrew/bin/openclaw gateway status

If step (3) still shows nothing listening, paste the latest stderr tail (that will contain the real reason it exited):

tail -n 200 ~/.openclaw/logs/gateway.err.log | grep -v punycode | tail -n 80

Also: if gateway status still says Source: cli --url even when you run /opt/homebrew/bin/openclaw …, then you are literally passing --url somewhere (script/alias). In that case paste:

/opt/homebrew/bin/openclaw gateway status --json | head -n 40

(That will show the resolved URL source cleanly, without depending on shell functions.)

grand cradle
#

2026-02-15T03:25:56.125+11:00 Gateway failed to start: another gateway instance is already listening on ws://127.0.0.1:19000
If the gateway is supervised, stop it with: openclaw gateway stop
2026-02-15T03:25:56.163+11:00 Port 19000 is already in use.
2026-02-15T03:25:56.164+11:00 - pid 26808 jiwoongyoo: openclaw-gateway (127.0.0.1:19000)
2026-02-15T03:25:56.164+11:00 - Gateway already running locally. Stop it (openclaw gateway stop) or use a different port.
2026-02-15T03:25:56.169+11:00 Gateway service appears loaded. Stop it first.
2026-02-15T03:25:56.169+11:00 Tip: openclaw gateway stop
2026-02-15T03:25:56.170+11:00 Or: launchctl bootout gui/$UID/ai.openclaw.gateway

"service": {
"label": "LaunchAgent",
"loaded": true,
"loadedText": "loaded",
"notLoadedText": "not loaded",
"command": {
"programArguments": [
"/opt/homebrew/bin/node",
"/opt/homebrew/lib/node_modules/openclaw/dist/index.js",
"gateway",
"--port",
"19000"
],
"environment": {
"OPENCLAW_GATEWAY_PORT": "19000"
},
"sourcePath": "/Users/jiwoongyoo/Library/LaunchAgents/ai.openclaw.gateway.plist"
},
"runtime": {
"status": "stopped",
"state": "active",
"cachedLabel": false
},
"configAudit": {
"ok": true,
"issues": []
}
},
"config": {
"cli": {
"path": "/Users/jiwoongyoo/.openclaw/openclaw.json",
"exists": true,
"valid": true,
"controlUi": {
"dangerouslyDisableDeviceAuth": false
}
},
"daemon": {
"path": "/Users/jiwoongyoo/.openclaw/openclaw.json",

cobalt socketBOT
#

The JSON confirms a few good things:

  • LaunchAgent is loaded but runtime is stopped (so it’s not currently running).
  • Your config is valid and dangerouslyDisableDeviceAuth is now false (good).
  • The “Port already in use / pid 26808” message you keep seeing is old log output — it’s not proof that the port is still in use right now.

So we need current port ownership + start attempt.

Run these (and paste output):

# 1) who is listening RIGHT NOW?
lsof -nP -iTCP:19000 -sTCP:LISTEN || true

# 2) force-restart the LaunchAgent
/opt/homebrew/bin/openclaw gateway restart
#
sleep 2

# 3) check again
lsof -nP -iTCP:19000 -sTCP:LISTEN || true

# 4) show only the newest errors (not the old 03:25 ones)
tail -n 80 ~/.openclaw/logs/gateway.err.log | grep -v punycode | tail -n 40
tail -n 80 ~/.openclaw/logs/gateway.log | tail -n 40

If lsof shows something listening on 19000 after restart, paste that line (PID + command). If it’s empty and the logs don’t show a clear error, we’ll also pull the launchd job state:

launchctl print gui/$UID/ai.openclaw.gateway | sed -n '1,220p'
#

(That will show last exit status / throttling info.)

grand cradle
#

2026-02-15T04:04:47.305+11:00 ⚠️ Session file not found: gateway
2026-02-15T04:04:47.306+11:00 Proceeding with reset...
2026-02-15T04:04:47.306+11:00 EXECUTE_NEW
2026-02-14T17:04:57.229Z [gateway] openclaw-mem0: registered (mode: platform, user: ji, graph: false, autoRecall: true, autoCapture: true)
2026-02-14T17:04:57.621Z [canvas] host mounted at http://127.0.0.1:19000/__openclaw__/canvas/ (root /Users/jiwoongyoo/.openclaw/canvas)
2026-02-14T17:04:57.661Z [heartbeat] started
2026-02-14T17:04:57.663Z [gateway] agent model: zai/glm-5
2026-02-14T17:04:57.664Z [gateway] listening on ws://127.0.0.1:19000 (PID 30807)
2026-02-14T17:04:57.664Z [gateway] listening on ws://[::1]:19000
2026-02-14T17:04:57.665Z [gateway] log file: /tmp/openclaw/openclaw-2026-02-15.log
2026-02-14T17:04:57.675Z [browser/service] Browser control service ready (profiles=2)
2026-02-14T17:04:57.768Z [hooks:loader] Registered hook: boot-md -> gateway:startup
2026-02-14T17:04:57.779Z [hooks:loader] Registered hook: bootstrap-extra-files -> agent:bootstrap
2026-02-14T17:04:57.780Z [hooks:loader] Registered hook: command-logger -> command
2026-02-14T17:04:57.782Z [hooks:loader] Registered hook: session-memory -> command:new
2026-02-15T04:04:57.783+11:00 ⚠️ Session file not found: gateway
2026-02-15T04:04:57.784+11:00 Proceeding with reset...
2026-02-15T04:04:57.785+11:00 EXECUTE_NEW

#

gui/501/ai.openclaw.gateway = {
active count = 1
path = /Users/jiwoongyoo/Library/LaunchAgents/ai.openclaw.gateway.plist
type = LaunchAgent
state = running

program = /opt/homebrew/bin/node
arguments = {
    /opt/homebrew/bin/node
    /opt/homebrew/lib/node_modules/openclaw/dist/index.js
    gateway
    --port
    19000
}

stdout path = /Users/jiwoongyoo/.openclaw/logs/gateway.log
stderr path = /Users/jiwoongyoo/.openclaw/logs/gateway.err.log
inherited environment = {
    SSH_AUTH_SOCK => /private/tmp/com.apple.launchd.adDrmHsp60/Listeners
}

default environment = {
    PATH => /usr/bin:/bin:/usr/sbin:/sbin
}

environment = {
    OSLogRateLimit => 64
    OPENCLAW_GATEWAY_TOKEN => private
    OPENCLAW_GATEWAY_PORT => 19000
    OPENCLAW_SERVICE_VERSION => 2026.2.13
    OPENCLAW_SYSTEMD_UNIT => openclaw-gateway.service
    OPENCLAW_LAUNCHD_LABEL => ai.openclaw.gateway
    PATH => /opt/homebrew/bin:/usr/local/bin:/usr/bin:/bin
    HOME => /Users/jiwoongyoo
    OPENCLAW_SERVICE_KIND => gateway
    OPENCLAW_SERVICE_MARKER => openclaw
    XPC_SERVICE_NAME => ai.openclaw.gateway
}

domain = gui/501 [100022]
asid = 100022
minimum runtime = 10
exit timeout = 5
runs = 97
pid = 30859
immediate reason = inefficient
forks = 0
execs = 1
initialized = 1
trampolined = 1
started suspended = 0
proxy started suspended = 0
checked allocations = 0 (queried = 1)
checked allocations reason = no host
checked allocations flags = 0x0
last exit code = 0

resource coalition = {
    ID = 2443
    type = resource
    state = active
    active count = 1
    name = ai.openclaw.gateway
}
cobalt socketBOT
#

Those logs are the “good” case — your Gateway is up and actually listening on 127.0.0.1:19000 (PID 30807). The Session file not found … reset … EXECUTE_NEW lines are normal.

Now we just need to confirm the CLI can reach it right now:

# should show node listening on 19000
lsof -nP -iTCP:19000 -sTCP:LISTEN

# should succeed if the gateway is reachable + auth is correct
/opt/homebrew/bin/openclaw gateway call health --timeout 3000

# should show RPC probe: ok
/opt/homebrew/bin/openclaw gateway status

If lsof shows it’s listening but gateway status still claims “Runtime stopped / probe failed”, paste the output of:

#
/opt/homebrew/bin/openclaw gateway status --json | head -n 80

That will tell us exactly what URL/auth source it’s using (and whether it’s still being forced via --url somewhere).

grand cradle
#

Service: LaunchAgent (loaded)
File logs: /tmp/openclaw/openclaw-2026-02-15.log
Command: /opt/homebrew/bin/node /opt/homebrew/lib/node_modules/openclaw/dist/index.js gateway --port 19000
Service file: ~/Library/LaunchAgents/ai.openclaw.gateway.plist
Service env: OPENCLAW_GATEWAY_PORT=19000

Config (cli): ~/.openclaw/openclaw.json
Config (service): ~/.openclaw/openclaw.json

Gateway: bind=loopback (127.0.0.1), port=19000 (service args)
Probe target: ws://127.0.0.1:19000
Dashboard: http://127.0.0.1:19000/
Probe note: Loopback-only gateway; only local clients can connect.

Runtime: stopped (state active)
RPC probe: failed
RPC target: ws://127.0.0.1:19000
gateway closed (1006 abnormal closure (no close frame)): no close reason
Gateway target: ws://127.0.0.1:19000
Source: cli --url
Config: /Users/jiwoongyoo/.openclaw/openclaw.json

Service is loaded but not running (likely exited immediately).
File logs: /tmp/openclaw/openclaw-2026-02-15.log
Launchd stdout (if installed): /Users/jiwoongyoo/.openclaw/logs/gateway.log
Launchd stderr (if installed): /Users/jiwoongyoo/.openclaw/logs/gateway.err.log

cobalt socketBOT
#

Great — that launchctl print confirms the LaunchAgent gateway is actually running now:

  • state = running
  • active count = 1
  • pid = 30859
  • OPENCLAW_GATEWAY_PORT = 19000

So the gateway service side is healthy.

Final verification from the CLI side (run these and you should see “ok”):

lsof -nP -iTCP:19000 -sTCP:LISTEN
/opt/homebrew/bin/openclaw gateway call health --timeout 3000
/opt/homebrew/bin/openclaw gateway status
#

If gateway status still shows Source: cli --url, it just means somewhere you’re still invoking the CLI with --url. It won’t prevent things from working as long as you also have credentials, but it’s confusing. Now that you removed the openclaw() function, it should go away.

One more important thing: earlier in this thread you pasted your gateway token once. Even though you redacted it now, please rotate it anyway:

openclaw config set gateway.auth.token "$(openssl rand -hex 32)"
openclaw gateway restart

(Do not paste the new token.)

#

That output is still consistent with “gateway isn’t actually up right now” (LaunchAgent loaded, but runtime stopped, and nothing is answering on :19000, hence the 1006).

Two things to keep in mind:

  • The “pid 26808” / port-in-use message you pasted earlier was from an older log line — it doesn’t prove the port is currently in use.
  • The only reliable “is it up?” check is lsof right now.

Run this exact block and paste the output:

# 1) Is anything listening right now?
lsof -nP -iTCP:19000 -sTCP:LISTEN || true

# 2) Force launchd to start it
launchctl kickstart -k gui/$UID/ai.openclaw.gateway
sleep 2
grand cradle
#

Service: LaunchAgent (loaded)
File logs: /tmp/openclaw/openclaw-2026-02-15.log
Command: /opt/homebrew/bin/node /opt/homebrew/lib/node_modules/openclaw/dist/index.js gateway --port 19000
Service file: ~/Library/LaunchAgents/ai.openclaw.gateway.plist
Service env: OPENCLAW_GATEWAY_PORT=19000

Config (cli): ~/.openclaw/openclaw.json
Config (service): ~/.openclaw/openclaw.json

Gateway: bind=loopback (127.0.0.1), port=19000 (service args)
Probe target: ws://127.0.0.1:19000
Dashboard: http://127.0.0.1:19000/
Probe note: Loopback-only gateway; only local clients can connect.

Runtime: running (pid 31397, state active)
Warm-up: launch agents can take a few seconds. Try again shortly.
RPC probe: failed
RPC target: ws://127.0.0.1:19000
gateway closed (1006 abnormal closure (no close frame)): no close reason
Gateway target: ws://127.0.0.1:19000
Source: cli --url
Config: /Users/jiwoongyoo/.openclaw/openclaw.json

Gateway port 19000 is not listening (service appears running).
Last gateway error: 2026-02-14T22:14:53.450+11:00 Gateway start blocked: set gateway.mode=local (current: unset) or pass --allow-unconfigured.
Logs: ~/.openclaw/logs/gateway.log
Errors: ~/.openclaw/logs/gateway.err.log

cobalt socketBOT
#

# 3) Is it listening now?
lsof -nP -iTCP:19000 -sTCP:LISTEN || true

# 4) What does launchd think?
launchctl print gui/$UID/ai.openclaw.gateway | sed -n '1,120p'

# 5) Show the *newest* failure reason (ignore punycode spam)
tail -n 120 ~/.openclaw/logs/gateway.err.log | grep -v punycode | tail -n 80

What we’re looking for:

  • If step (3) shows a PID listening → the gateway is up, and then we can run /opt/homebrew/bin/openclaw gateway call health --timeout 3000.
  • If step (3) is empty → step (5) should contain the real exit reason (port conflict, config/start blocked, missing deps, etc.).

One more security cleanup once things are stable: you pasted a gateway token earlier in the thread; rotate it after you’re connected again (don’t paste the new one).

grand cradle
#

2026-02-15T03:25:56.125+11:00 Gateway failed to start: another gateway instance is already listening on ws://127.0.0.1:19000
If the gateway is supervised, stop it with: openclaw gateway stop
2026-02-15T03:25:56.163+11:00 Port 19000 is already in use.
2026-02-15T03:25:56.164+11:00 - pid 26808 jiwoongyoo: openclaw-gateway (127.0.0.1:19000)
2026-02-15T03:25:56.164+11:00 - Gateway already running locally. Stop it (openclaw gateway stop) or use a different port.
2026-02-15T03:25:56.169+11:00 Gateway service appears loaded. Stop it first.
2026-02-15T03:25:56.169+11:00 Tip: openclaw gateway stop
2026-02-15T03:25:56.170+11:00 Or: launchctl bootout gui/$UID/ai.openclaw.gateway

cobalt socketBOT
#

Runtime: running (pid 31397) but “port 19000 is not listening” means launchd thinks the job is alive, but the gateway either:

  • is stuck before binding, or
  • is crashing/exiting immediately (launchd can briefly show a pid), or
  • is binding somewhere else than expected (rare)

The “Last gateway error: set gateway.mode=local … unset” line is old (timestamped) — ignore that for current diagnosis.

Run these and paste the output (this will tell us what’s actually happening with pid 31397 and why it won’t listen):

# 1) Is anything listening right now?
lsof -nP -iTCP:19000 -sTCP:LISTEN || true

# 2) Is that pid really alive?
ps -p 31397 -o pid,ppid,etime,command || echo "pid 31397 not running"
#

# 3) What did the gateway log right before it stopped / got stuck?
tail -n 80 ~/.openclaw/logs/gateway.log

# 4) Actual errors (filter out punycode spam)
tail -n 200 ~/.openclaw/logs/gateway.err.log | grep -v punycode | tail -n 80

# 5) launchd’s view often includes exit status / throttle
launchctl print gui/$UID/ai.openclaw.gateway | sed -n '1,220p'

If you want the “nuke from orbit” restart (safe, common fix) while we wait for logs:

/opt/homebrew/bin/openclaw gateway stop
#
launchctl bootout gui/$UID/ai.openclaw.gateway 2>/dev/null || true
launchctl bootstrap gui/$UID ~/Library/LaunchAgents/ai.openclaw.gateway.plist
/opt/homebrew/bin/openclaw gateway start
sleep 2
lsof -nP -iTCP:19000 -sTCP:LISTEN || true

Once you paste the gateway.err.log tail + launchctl print snippet, it’ll usually be immediately obvious (port conflict again, missing permission/key, config parse, etc.).

#

Those lines are from 03:25 and are almost certainly stale at this point. We need to see what’s holding 19000 right now (if anything), because that’s what decides whether launchd can start.

Run these and paste the output:

# 1) who is listening on 19000 RIGHT NOW?
lsof -nP -iTCP:19000 -sTCP:LISTEN || true

# 2) show the *latest* error lines (not the old 03:25 ones)
tail -n 60 ~/.openclaw/logs/gateway.err.log | grep -v punycode | tail -n 30
tail -n 60 ~/.openclaw/logs/gateway.log | tail -n 30

If lsof shows a listener (PID), do:

#
/opt/homebrew/bin/openclaw gateway stop
# re-check
lsof -nP -iTCP:19000 -sTCP:LISTEN || true

If it’s still listening after gateway stop, paste the lsof line (PID/command) and we’ll tell you the cleanest way to stop that specific process (that’s the “two gateways fighting” situation).

Once lsof is empty, starting the service should work:

/opt/homebrew/bin/openclaw gateway start
sleep 2
lsof -nP -iTCP:19000 -sTCP:LISTEN || true
/opt/homebrew/bin/openclaw gateway status
grand cradle
#

2026-02-15T03:25:56.125+11:00 Gateway failed to start: another gateway instance is already listening on ws://127.0.0.1:19000
If the gateway is supervised, stop it with: openclaw gateway stop
2026-02-15T03:25:56.163+11:00 Port 19000 is already in use.
2026-02-15T03:25:56.164+11:00 - pid 26808 jiwoongyoo: openclaw-gateway (127.0.0.1:19000)
2026-02-15T03:25:56.164+11:00 - Gateway already running locally. Stop it (openclaw gateway stop) or use a different port.
2026-02-15T03:25:56.169+11:00 Gateway service appears loaded. Stop it first.
2026-02-15T03:25:56.169+11:00 Tip: openclaw gateway stop
2026-02-15T03:25:56.170+11:00 Or: launchctl bootout gui/$UID/ai.openclaw.gateway

2026-02-14T17:16:06.967Z [gateway] openclaw-mem0: registered (mode: platform, user: ji, graph: false, autoRecall: true, autoCapture: true)
2026-02-14T17:16:07.365Z [canvas] host mounted at http://127.0.0.1:19000/__openclaw__/canvas/ (root /Users/jiwoongyoo/.openclaw/canvas)
2026-02-14T17:16:07.404Z [heartbeat] started
2026-02-14T17:16:07.407Z [gateway] agent model: zai/glm-5
2026-02-14T17:16:07.407Z [gateway] listening on ws://127.0.0.1:19000 (PID 31981)
2026-02-14T17:16:07.408Z [gateway] listening on ws://[::1]:19000
2026-02-14T17:16:07.409Z [gateway] log file: /tmp/openclaw/openclaw-2026-02-15.log
2026-02-14T17:16:07.418Z [browser/service] Browser control service ready (profiles=2)
2026-02-14T17:16:07.514Z [hooks:loader] Registered hook: boot-md -> gateway:startup
2026-02-14T17:16:07.526Z [hooks:loader] Registered hook: bootstrap-extra-files -> agent:bootstrap
2026-02-14T17:16:07.527Z [hooks:loader] Registered hook: command-logger -> command
2026-02-14T17:16:07.529Z [hooks:loader] Registered hook: session-memory -> command:new
2026-02-15T04:16:07.530+11:00 ⚠️ Session file not found: gateway
2026-02-15T04:16:07.531+11:00 Proceeding with reset...
2026-02-15T04:16:07.531+11:00 EXECUTE_NEW

#

jiwoongyoo@Jis-MacBook-Pro-2 ~ % /opt/homebrew/bin/openclaw gateway stop

re-check

lsof -nP -iTCP:19000 -sTCP:LISTEN || true

🦞 OpenClaw 2026.2.13 (203b5bd) — curl for conversations.

Stopped LaunchAgent: gui/501/ai.openclaw.gateway
zsh: command not found: #

cobalt socketBOT
#

Your latest gateway.log lines show the good state:

  • listening on ws://127.0.0.1:19000 (PID 31981)

…but your gateway status probe still sometimes says “running pid … but port not listening / 1006”. That usually happens when the Gateway is flapping (start/stop quickly) or when the service token and CLI token don’t match.

Let’s pin this down with two checks + one “make it consistent” fix.

1) Confirm what’s listening on 19000 right now

lsof -nP -iTCP:19000 -sTCP:LISTEN || true
  • If this prints a PID, the gateway is actually up at that moment.
  • If it prints nothing, it’s not actually bound (flapping/exit).

2) If it IS listening, test a direct health call (no --url)

#

Use the real binary (since you removed the zsh function):

/opt/homebrew/bin/openclaw gateway call health --timeout 3000

3) Fix the most common cause: token mismatch (and rotate token)

Since a gateway token got exposed earlier, rotate it and make the service + config match in one go:

NEW="$(openssl rand -hex 32)"

# write token into config
/opt/homebrew/bin/openclaw config set gateway.auth.token "$NEW"

# reinstall the LaunchAgent so it uses the same token + port
/opt/homebrew/bin/openclaw gateway install --port 19000 --force --token "$NEW"
#

That zsh: command not found: # just means you pasted my comment line (# re-check) into the terminal — zsh tried to run # as a command. No big deal.

Now that you’ve stopped the LaunchAgent, do the checks on separate lines:

lsof -nP -iTCP:19000 -sTCP:LISTEN || true
  • If this shows anything listening, you still have a stray/manual gateway (or something else) holding the port.
  • If it shows nothing, the port is free and you can start the service cleanly:
/opt/homebrew/bin/openclaw gateway start
sleep 2
lsof -nP -iTCP:19000 -sTCP:LISTEN || true
/opt/homebrew/bin/openclaw gateway status
#

If lsof still shows a listener even after gateway stop, paste the single lsof line (PID/command) and we’ll kill the right process (that’s the “two gateways fighting” situation that causes the 1006 errors).

#

/opt/homebrew/bin/openclaw gateway restart

Then re-test:

lsof -nP -iTCP:19000 -sTCP:LISTEN
/opt/homebrew/bin/openclaw gateway call health --timeout 3000
/opt/homebrew/bin/openclaw gateway status

If after restart lsof is empty again, paste the last ~40 non-punycode lines of stderr (that will contain the real exit reason):

tail -n 200 ~/.openclaw/logs/gateway.err.log | grep -v punycode | tail -n 40
#

Once it’s stable, you should see RPC probe: ok and the 1006 errors stop.

grand cradle
#

you're going round and round with no fix. is it possible to reset or reinstall the gateway and anything that's involved with the recent update without losing openclaw data accumulated with personal data and skills and memory?

cobalt socketBOT
#

Yes — you can do a “clean reinstall of the Gateway/service + CLI” without losing your OpenClaw data. The important thing is to not run openclaw reset --scope full (that one really does wipe state/workspace).

What counts as “your data” (the stuff you want to keep)

By default it lives under:

  • State dir: ~/.openclaw/ (config, auth profiles, sessions, device identity, etc.)
  • Workspace: often ~/.openclaw/workspace/ (your AGENTS.md, SOUL.md, USER.md, memory files, skills you’ve installed into the workspace, etc.)

Reinstalling the LaunchAgent/service does not need to delete any of that.


Safe “reinstall gateway service” (keeps all data)

Do this on the gateway Mac:

0) Backup first (strongly recommended)

#
tar -czf ~/openclaw-backup-$(date +%Y%m%d-%H%M%S).tgz ~/.openclaw

1) Stop + uninstall the LaunchAgent (service only)

/opt/homebrew/bin/openclaw gateway stop
/opt/homebrew/bin/openclaw gateway uninstall
launchctl bootout gui/$UID/ai.openclaw.gateway 2>/dev/null || true
rm -f ~/Library/LaunchAgents/ai.openclaw.gateway.plist

2) Make sure nothing else is holding the port

(Replace 19000 if you use a different port.)

lsof -nP -iTCP:19000 -sTCP:LISTEN || true
#

If that prints a PID, kill that process (it’s the “two gateways fighting” situation that caused your 1006 errors).

3) Reinstall + start the service fresh

/opt/homebrew/bin/openclaw gateway install --port 19000 --force
/opt/homebrew/bin/openclaw gateway start

4) Repair/migrate config safely

/opt/homebrew/bin/openclaw doctor --repair

If you want to reinstall the OpenClaw CLI code too (still keep data)

Your data is in ~/.openclaw, so removing/reinstalling the npm package is usually fine:

#
npm uninstall -g openclaw
npm install -g openclaw@2026.2.13   # or @latest
openclaw doctor --repair
openclaw gateway restart

(Still: keep the backup step.)


Two “don’t do this” warnings

  • Don’t run openclaw reset --scope full (that wipes state/workspace).
  • Don’t paste tokens in Discord. If you already did earlier, rotate:
    openclaw config set gateway.auth.token "$(openssl rand -hex 32)"
    
#
  openclaw gateway restart

If you run the “service reinstall” steps above and paste the output of:

/opt/homebrew/bin/openclaw gateway status
lsof -nP -iTCP:19000 -sTCP:LISTEN || true

we can confirm it’s stable and actually listening.

grand cradle
#

jiwoongyoo@Jis-MacBook-Pro-2 ~ % tar -czf ~/openclaw-backup-$(date +%Y%m%d-%H%M%S).tgz ~/.openclaw
tar: Removing leading '/' from member names
tar: Could not pack extended attributes: Operation not supported
: Users/jiwoongyoo/.openclaw/exec-approvals.sock: pax format cannot archive sockets

cobalt socketBOT
#

That’s normal-ish: tar can’t archive Unix sockets, and exec-approvals.sock is exactly that. It’s ephemeral runtime state, safe to exclude (it’ll be recreated).

Also:

  • Removing leading '/' is harmless.
  • The “extended attributes” warning is usually harmless for OpenClaw (OpenClaw doesn’t rely on xattrs for state), but if you want a “mac-native” backup that preserves them, use ditto (see below).

Option A (simple): tar backup, excluding sockets

# (optional) see any sockets under ~/.openclaw
find ~/.openclaw -type s -maxdepth 3 2>/dev/null || true

# make a tarball, excluding the socket
tar --exclude="$HOME/.openclaw/exec-approvals.sock" \
    -czf ~/openclaw-backup-$(date +%Y%m%d-%H%M%S).tgz \
    ~/.openclaw
#

If there are other .sock files, you can exclude them too (repeat --exclude=... for each).

Option B (mac recommended): ditto zip backup (keeps metadata better)

ditto -c -k --sequesterRsrc --keepParent \
  ~/.openclaw \
  ~/openclaw-backup-$(date +%Y%m%d-%H%M%S).zip

Either backup is fine for “don’t lose my OpenClaw data”.

Once you have the backup file created successfully, tell me which one you used and we’ll proceed with the safe gateway/service reinstall steps (keeps your skills/memory/sessions).

grand cradle
#

I used option b but it's still not finised backing up I think

cobalt socketBOT
#

Let it finish — ditto can take a while if ~/.openclaw has a lot of sessions/logs.

Run this to see if it’s still actively writing:

ls -lh ~/openclaw-backup-*.zip | tail -n 5

If the file size is still increasing every time you re-run that, it’s still working.

If you want a “progress-ish” view (crude but useful):

while true; do
  ls -lh ~/openclaw-backup-*.zip | tail -n 1
  sleep 2
#
done

Stop it with Ctrl+C when you’re satisfied.

If it looks stuck (size not changing for ~2–3 minutes), tell me:

  • the current size shown by ls -lh …
  • how long it’s been sitting at that size

…and we can either (a) wait, (b) redo the backup excluding large logs/transcripts, or (c) do a faster tar backup excluding sockets/logs.

grand cradle
#

what do I do after it's backed up

cobalt socketBOT
#

After the backup finishes, do this service-only reinstall. It keeps your ~/.openclaw data (memory/skills/sessions/config).

1) Stop the Gateway + remove the LaunchAgent (safe)

/opt/homebrew/bin/openclaw gateway stop
/opt/homebrew/bin/openclaw gateway uninstall
launchctl bootout gui/$UID/ai.openclaw.gateway 2>/dev/null || true
rm -f ~/Library/LaunchAgents/ai.openclaw.gateway.plist

2) Make sure nothing is still listening on your gateway port

(You’ve been using 19000.)

lsof -nP -iTCP:19000 -sTCP:LISTEN || true

If that prints a PID, kill it (it’s the “extra gateway instance” problem):

#
kill <pid>
# if it refuses:
kill -9 <pid>

Re-run the lsof check until it prints nothing.

3) Reinstall the LaunchAgent cleanly + start it

/opt/homebrew/bin/openclaw gateway install --port 19000 --force
/opt/homebrew/bin/openclaw gateway start

4) Run Doctor repair (safe migrations) + restart once

#
/opt/homebrew/bin/openclaw doctor --repair
/opt/homebrew/bin/openclaw gateway restart

5) Verify it’s healthy

lsof -nP -iTCP:19000 -sTCP:LISTEN
/opt/homebrew/bin/openclaw gateway status
/opt/homebrew/bin/openclaw gateway call health --timeout 3000

If it’s working, you should see the port listening and RPC probe: ok.

One more thing: you pasted a gateway token earlier in the thread — once everything is stable, rotate it:

#
openclaw config set gateway.auth.token "$(openssl rand -hex 32)"
openclaw gateway restart

Paste the output of openclaw gateway status if anything still says unreachable.

grand cradle
#

jiwoongyoo@Jis-MacBook-Pro-2 ~ % /opt/homebrew/bin/openclaw gateway stop
/opt/homebrew/bin/openclaw gateway uninstall
launchctl bootout gui/$UID/ai.openclaw.gateway 2>/dev/null || true
rm -f ~/Library/LaunchAgents/ai.openclaw.gateway.plist

Gateway service not loaded.

LaunchAgent remains at /Users/jiwoongyoo/Library/LaunchAgents/ai.openclaw.gateway.plist (could not move)

cobalt socketBOT
#

That message is from the uninstall step trying to “move” the plist out of the way. It’s not fatal — we just need to confirm whether the plist is actually gone now (your rm -f … line should have removed it).

Run these checks:

# 1) Is the plist still there?
ls -la ~/Library/LaunchAgents/ai.openclaw.gateway.plist || echo "plist is gone ✅"

# 2) Does launchd still think the job exists?
launchctl print gui/$UID/ai.openclaw.gateway 2>/dev/null | head -n 20 || echo "launchd job not found ✅"

# 3) Make sure nothing is listening on 19000
lsof -nP -iTCP:19000 -sTCP:LISTEN || true

If (3) shows a PID listening on 19000

That’s a stray gateway process. Kill it:

#
kill <pid>
# if needed:
kill -9 <pid>

Re-run the lsof check until it prints nothing.

Then reinstall + start the LaunchAgent fresh

/opt/homebrew/bin/openclaw gateway install --port 19000 --force
/opt/homebrew/bin/openclaw gateway start
sleep 2
lsof -nP -iTCP:19000 -sTCP:LISTEN || true
/opt/homebrew/bin/openclaw gateway status
#

Paste the output of the three checks at the top (ls …plist, launchctl print …, lsof …19000). That’ll tell us if anything is still stuck in launchd or if it’s just a leftover process on the port.

grand cradle
#

LaunchAgent remains at /Users/jiwoongyoo/Library/LaunchAgents/ai.openclaw.gateway.plist (could not move)
jiwoongyoo@Jis-MacBook-Pro-2 ~ % ls -la ~/Library/LaunchAgents/ai.openclaw.gateway.plist || echo "plist is gone ✅"
ls: /Users/jiwoongyoo/Library/LaunchAgents/ai.openclaw.gateway.plist: No such file or directory
plist is gone ✅
jiwoongyoo@Jis-MacBook-Pro-2 ~ % launchctl print gui/$UID/ai.openclaw.gateway 2>/dev/null | head -n 20 || echo "launchd job not found ✅"

jiwoongyoo@Jis-MacBook-Pro-2 ~ % lsof -nP -iTCP:19000 -sTCP:LISTEN || true
jiwoongyoo@Jis-MacBook-Pro-2 ~ %

cobalt socketBOT
#

Perfect — you’re in the clean state we want:

  • plist is gone ✅
  • nothing listening on 19000 ✅
  • (and launchd doesn’t seem to have the job anymore)

Now reinstall + start the gateway service fresh:

/opt/homebrew/bin/openclaw gateway install --port 19000 --force
/opt/homebrew/bin/openclaw gateway start
sleep 2
lsof -nP -iTCP:19000 -sTCP:LISTEN || true
/opt/homebrew/bin/openclaw gateway status

If lsof still shows nothing listening after gateway start, paste:

#
tail -n 80 ~/.openclaw/logs/gateway.err.log | grep -v punycode | tail -n 60
tail -n 80 ~/.openclaw/logs/gateway.log | tail -n 60

Once it’s up, run the safe repair/migration and restart once:

/opt/homebrew/bin/openclaw doctor --repair
/opt/homebrew/bin/openclaw gateway restart

And because a gateway token got posted earlier in the thread, rotate it when stable:

openclaw config set gateway.auth.token "$(openssl rand -hex 32)"
#
openclaw gateway restart
grand cradle
#

2026-02-15T10:16:39.855+11:00 ⚠️ Session file not found: gateway
2026-02-15T10:16:39.856+11:00 Proceeding with reset...
2026-02-15T10:16:39.857+11:00 EXECUTE_NEW
2026-02-14T23:16:49.754Z [gateway] openclaw-mem0: registered (mode: platform, user: ji, graph: false, autoRecall: true, autoCapture: true)
2026-02-14T23:16:50.182Z [canvas] host mounted at http://127.0.0.1:19000/__openclaw__/canvas/ (root /Users/jiwoongyoo/.openclaw/canvas)
2026-02-14T23:16:50.225Z [heartbeat] started
2026-02-14T23:16:50.227Z [gateway] agent model: zai/glm-5
2026-02-14T23:16:50.227Z [gateway] listening on ws://127.0.0.1:19000 (PID 36489)
2026-02-14T23:16:50.229Z [gateway] listening on ws://[::1]:19000
2026-02-14T23:16:50.230Z [gateway] log file: /tmp/openclaw/openclaw-2026-02-15.log
2026-02-14T23:16:50.239Z [browser/service] Browser control service ready (profiles=2)
2026-02-14T23:16:50.341Z [hooks:loader] Registered hook: boot-md -> gateway:startup
2026-02-14T23:16:50.352Z [hooks:loader] Registered hook: bootstrap-extra-files -> agent:bootstrap
2026-02-14T23:16:50.353Z [hooks:loader] Registered hook: command-logger -> command
2026-02-14T23:16:50.355Z [hooks:loader] Registered hook: session-memory -> command:new
2026-02-15T10:16:50.357+11:00 ⚠️ Session file not found: gateway
2026-02-15T10:16:50.358+11:00 Proceeding with reset...
2026-02-15T10:16:50.358+11:00 EXECUTE_NEW

cobalt socketBOT
#

That’s the success signal.

  • listening on ws://127.0.0.1:19000 (PID 36489) → Gateway is up.
  • The Session file not found: gateway → reset → EXECUTE_NEW lines are normal after a fresh service reinstall.

Now finish the last two “wrap up” steps:

1) Verify from the CLI

lsof -nP -iTCP:19000 -sTCP:LISTEN
/opt/homebrew/bin/openclaw gateway status
/opt/homebrew/bin/openclaw gateway call health --timeout 3000

2) Run Doctor repair + rotate token (since one was pasted earlier)

#
/opt/homebrew/bin/openclaw doctor --repair

openclaw config set gateway.auth.token "$(openssl rand -hex 32)"
openclaw gateway restart

After the restart, openclaw gateway status should show RPC probe: ok.

If it does: you’re done. If anything still fails, paste the output of openclaw gateway status and we’ll nail the last mile.

If this fixed it, please mark the solution message so Answer Overflow indexes it (right‑click the solution message → Apps → ✅ Mark Solution).

grand cradle
#

2026-02-15T03:25:56.125+11:00 Gateway failed to start: another gateway instance is already listening on ws://127.0.0.1:19000
If the gateway is supervised, stop it with: openclaw gateway stop
2026-02-15T03:25:56.163+11:00 Port 19000 is already in use.
2026-02-15T03:25:56.164+11:00 - pid 26808 jiwoongyoo: openclaw-gateway (127.0.0.1:19000)
2026-02-15T03:25:56.164+11:00 - Gateway already running locally. Stop it (openclaw gateway stop) or use a different port.
2026-02-15T03:25:56.169+11:00 Gateway service appears loaded. Stop it first.
2026-02-15T03:25:56.169+11:00 Tip: openclaw gateway stop
2026-02-15T03:25:56.170+11:00 Or: launchctl bootout gui/$UID/ai.openclaw.gateway
2026-02-14T17:16:59.292Z [gateway] openclaw-mem0: registered (mode: platform, user: ji, graph: false, autoRecall: true, autoCapture: true)
2026-02-14T17:16:59.681Z [canvas] host mounted at http://127.0.0.1:19000/__openclaw__/canvas/ (root /Users/jiwoongyoo/.openclaw/canvas)
2026-02-14T17:16:59.721Z [heartbeat] started
2026-02-14T17:16:59.723Z [gateway] agent model: zai/glm-5
2026-02-14T17:16:59.724Z [gateway] listening on ws://127.0.0.1:19000 (PID 32061)
2026-02-14T17:16:59.724Z [gateway] listening on ws://[::1]:19000
2026-02-14T17:16:59.725Z [gateway] log file: /tmp/openclaw/openclaw-2026-02-15.log
2026-02-14T17:16:59.734Z [browser/service] Browser control service ready (profiles=2)
2026-02-14T17:16:59.832Z [hooks:loader] Registered hook: boot-md -> gateway:startup
2026-02-14T17:16:59.844Z [hooks:loader] Registered hook: bootstrap-extra-files -> agent:bootstrap
2026-02-14T17:16:59.845Z [hooks:loader] Registered hook: command-logger -> command
2026-02-14T17:16:59.847Z [hooks:loader] Registered hook: session-memory -> command:new
2026-02-15T04:16:59.848+11:00 ⚠️ Session file not found: gateway

cobalt socketBOT
#

Those lines contain both:

  • an old failure at 03:25 (“port 19000 already in use, pid 26808”), and
  • a successful start later (“listening on …19000 (PID 32061)”).

So the “already in use” part is almost certainly just stale log history that’s still sitting in gateway.err.log / gateway.log — it does not mean it’s currently broken.

To know the truth right now, don’t look at old log tails; run these live checks:

# is anything listening right now?
lsof -nP -iTCP:19000 -sTCP:LISTEN || true

# does the CLI successfully RPC into the gateway?
/opt/homebrew/bin/openclaw gateway call health --timeout 3000
#
# does the status probe succeed?
/opt/homebrew/bin/openclaw gateway status

If lsof shows a listener and gateway call health works, you’re done — the gateway is healthy.

If you want to stop the old “port already in use” message from confusing you, you can optionally archive the logs so new errors are obvious:

mv ~/.openclaw/logs/gateway.err.log ~/.openclaw/logs/gateway.err.log.old
mv ~/.openclaw/logs/gateway.log ~/.openclaw/logs/gateway.log.old
/opt/homebrew/bin/openclaw gateway restart

One more important cleanup: you pasted a gateway token earlier in the thread. Once you confirm the gateway is healthy, rotate it:

#
openclaw config set gateway.auth.token "$(openssl rand -hex 32)"
openclaw gateway restart

Paste the output of openclaw gateway status if it still shows RPC probe: failed.

grand cradle
#

jiwoongyoo@Jis-MacBook-Pro-2 ~ % lsof -nP -iTCP:19000 -sTCP:LISTEN
/opt/homebrew/bin/openclaw gateway status
/opt/homebrew/bin/openclaw gateway call health --timeout 3000

🦞 OpenClaw 2026.2.13 (203b5bd) — Your config is valid, your assumptions are not.

│
◇
Service: LaunchAgent (loaded)
File logs: /tmp/openclaw/openclaw-2026-02-15.log
Command: /opt/homebrew/bin/node /opt/homebrew/lib/node_modules/openclaw/dist/index.js gateway --port 19000
Service file: ~/Library/LaunchAgents/ai.openclaw.gateway.plist
Service env: OPENCLAW_GATEWAY_PORT=19000

Config (cli): ~/.openclaw/openclaw.json
Config (service): ~/.openclaw/openclaw.json

Gateway: bind=loopback (127.0.0.1), port=19000 (service args)
Probe target: ws://127.0.0.1:19000
Dashboard: http://127.0.0.1:19000/
Probe note: Loopback-only gateway; only local clients can connect.

Runtime: stopped (state active)
RPC probe: failed
RPC target: ws://127.0.0.1:19000
gateway closed (1006 abnormal closure (no close frame)): no close reason
Gateway target: ws://127.0.0.1:19000
Source: cli --url
Config: /Users/jiwoongyoo/.openclaw/openclaw.json

Service is loaded but not running (likely exited immediately).
File logs: /tmp/openclaw/openclaw-2026-02-15.log
Launchd stdout (if installed): /Users/jiwoongyoo/.openclaw/logs/gateway.log
Launchd stderr (if installed): /Users/jiwoongyoo/.openclaw/logs/gateway.err.log

Troubles: run openclaw status
Troubleshooting: https://docs.openclaw.ai/troubleshooting

🦞 OpenClaw 2026.2.13 (203b5bd)
Welcome to the command line: where dreams compile and confidence segfaults.

│
◇
Gateway call failed: Error: gateway closed (1006 abnormal closure (no close frame)): no close reason
Gateway target: ws://127.0.0.1:19000
Source: local loopback
Config: /Users/jiwoongyoo/.openclaw/openclaw.json
Bind: loopback
jiwoongyoo@Jis-MacBook-Pro-2 ~ %

cobalt socketBOT
#

You’re not crazy — what’s been tripping you up is that the gateway log contains old failures mixed with new successes, and the gateway can also fail to start if anything is already bound to 19000. The only “truth” is: is something listening on 19000 right now, and does the process stay up?

Here’s the cleanest, “one-shot” way to get to a stable state without losing any data (you already backed up, so we can be a bit more decisive):

A) Make logs “fresh” so we stop chasing stale messages

mv ~/.openclaw/logs/gateway.log ~/.openclaw/logs/gateway.log.old.$(date +%s) 2>/dev/null || true
mv ~/.openclaw/logs/gateway.err.log ~/.openclaw/logs/gateway.err.log.old.$(date +%s) 2>/dev/null || true

B) Stop the service and ensure NOTHING is on port 19000

/opt/homebrew/bin/openclaw gateway stop

# On macOS it’s worth using sudo so you see root-owned listeners too:
sudo lsof -nP -iTCP:19000 -sTCP:LISTEN || true
#

If lsof prints a listener, only kill it if it’s actually OpenClaw / node on that port:

sudo kill <pid>
# if it won’t die:
sudo kill -9 <pid>

Re-run the sudo lsof …19000… until it prints nothing.

C) Reinstall the LaunchAgent using the SAME token your CLI uses

This prevents “service token vs config token” weirdness.

TOKEN="$(/opt/homebrew/bin/openclaw config get gateway.auth.token)"

/opt/homebrew/bin/openclaw gateway install --port 19000 --force --token "$TOKEN"
#
/opt/homebrew/bin/openclaw gateway start
sleep 2
sudo lsof -nP -iTCP:19000 -sTCP:LISTEN || true

D) Verify (this should now succeed)

/opt/homebrew/bin/openclaw gateway call health --timeout 3000
/opt/homebrew/bin/openclaw gateway status

If it still fails

Paste just these (they’ll now be “fresh” and not mixed with old stuff):

tail -n 120 ~/.openclaw/logs/gateway.err.log | grep -v punycode | tail -n 80
#
tail -n 120 ~/.openclaw/logs/gateway.log | tail -n 80

One more important cleanup: you posted a gateway token earlier in the thread. Once the gateway is stable, rotate it:

openclaw config set gateway.auth.token "$(openssl rand -hex 32)"
openclaw gateway restart

If you paste the output of the sudo lsof …19000… line after step C, I can tell immediately whether you’re stable or still colliding with another process.

grand cradle
#

jiwoongyoo@Jis-MacBook-Pro-2 ~ % tail -n 120 ~/.openclaw/logs/gateway.err.log | grep -v punycode | tail -n 80
tail -n 120 ~/.openclaw/logs/gateway.log | tail -n 80
2026-02-14T23:29:15.756Z [hooks:loader] Registered hook: command-logger -> command
2026-02-14T23:29:15.758Z [hooks:loader] Registered hook: session-memory -> command:new
2026-02-15T10:29:15.759+11:00 ⚠️ Session file not found: gateway
2026-02-15T10:29:15.760+11:00 Proceeding with reset...
2026-02-15T10:29:15.761+11:00 EXECUTE_NEW
2026-02-14T23:29:25.656Z [gateway] openclaw-mem0: registered (mode: platform, user: ji, graph: false, autoRecall: true, autoCapture: true)
2026-02-14T23:29:26.049Z [canvas] host mounted at http://127.0.0.1:19000/__openclaw__/canvas/ (root /Users/jiwoongyoo/.openclaw/canvas)
2026-02-14T23:29:26.088Z [heartbeat] started
2026-02-14T23:29:26.090Z [gateway] agent model: zai/glm-5
2026-02-14T23:29:26.091Z [gateway] listening on ws://127.0.0.1:19000 (PID 37774)
2026-02-14T23:29:26.091Z [gateway] listening on ws://[::1]:19000
2026-02-14T23:29:26.092Z [gateway] log file: /tmp/openclaw/openclaw-2026-02-15.log
2026-02-14T23:29:26.101Z [browser/service] Browser control service ready (profiles=2)
2026-02-14T23:29:26.196Z [hooks:loader] Registered hook: boot-md -> gateway:startup
2026-02-14T23:29:26.207Z [hooks:loader] Registered hook: bootstrap-extra-files -> agent:bootstrap
2026-02-14T23:29:26.208Z [hooks:loader] Registered hook: command-logger -> command
2026-02-14T23:29:26.210Z [hooks:loader] Registered hook: session-memory -> command:new
2026-02-15T10:29:26.211+11:00 ⚠️ Session file not found: gateway

jiwoongyoo@Jis-MacBook-Pro-2 ~ % sudo lsof -nP -iTCP:19000 -sTCP:LISTEN || true
jiwoongyoo@Jis-MacBook-Pro-2 ~ %

cobalt socketBOT
#

Yes — you can “reinstall the gateway/service” without losing data, and you already did the right thing by backing up ~/.openclaw.

What’s still causing the “1006 / not listening” loop is almost always one of these:

  1. Another gateway process (or the mac app) is stopping/starting it, or
  2. Two gateway processes fight over port 19000, or
  3. You’re probing a gateway that isn’t actually bound right now.

Here’s the most reliable “get me to one stable gateway” procedure (data-safe):

0) If the OpenClaw macOS app is running: quit it for now

It can manage launchd and cause confusing restarts.

1) Hard-stop all gateway instances

Run these lines one by one:

#
/opt/homebrew/bin/openclaw gateway stop || true
launchctl bootout gui/$UID/ai.openclaw.gateway 2>/dev/null || true

# show any stray gateway processes (if you see any, we’ll kill them)
ps aux | egrep 'openclaw-gateway|dist/index\.js gateway' | grep -v egrep || true

# check the port (use sudo so you don’t miss listeners)
sudo lsof -nP -iTCP:19000 -sTCP:LISTEN || true

If sudo lsof …19000… prints a PID, kill that PID:

sudo kill <pid>
# if it won't die:
#
sudo kill -9 <pid>

Re-run the sudo lsof … until it prints nothing.

2) Reinstall + start ONE launchd service

/opt/homebrew/bin/openclaw gateway install --port 19000 --force
/opt/homebrew/bin/openclaw gateway start
sleep 2
sudo lsof -nP -iTCP:19000 -sTCP:LISTEN

3) Verify with a direct RPC call

#
/opt/homebrew/bin/openclaw gateway call health --timeout 3000
/opt/homebrew/bin/openclaw gateway status

If it still fails

Paste these two outputs (they’ll show the real reason immediately):

launchctl print gui/$UID/ai.openclaw.gateway | sed -n '1,140p'
tail -n 120 ~/.openclaw/logs/gateway.err.log | grep -v punycode | tail -n 80

Once it’s stable, rotate the gateway token (since one got pasted earlier in the thread):

#
openclaw config set gateway.auth.token "$(openssl rand -hex 32)"
openclaw gateway restart

If you paste the output of sudo lsof -nP -iTCP:19000 -sTCP:LISTEN after step 2, I can tell you in one glance whether you’re finally down to one gateway or still colliding.

grand cradle
#

jiwoongyoo@Jis-MacBook-Pro-2 ~ % launchctl print gui/$UID/ai.openclaw.gateway | sed -n '1,140p'
tail -n 120 ~/.openclaw/logs/gateway.err.log | grep -v punycode | tail -n 80
gui/501/ai.openclaw.gateway = {
active count = 0
path = /Users/jiwoongyoo/Library/LaunchAgents/ai.openclaw.gateway.plist
type = LaunchAgent
state = spawn scheduled

program = /opt/homebrew/bin/node
arguments = {
    /opt/homebrew/bin/node
    /opt/homebrew/lib/node_modules/openclaw/dist/index.js
    gateway
    --port
    19000
}

stdout path = /Users/jiwoongyoo/.openclaw/logs/gateway.log
stderr path = /Users/jiwoongyoo/.openclaw/logs/gateway.err.log
inherited environment = {
    SSH_AUTH_SOCK => /private/tmp/com.apple.launchd.adDrmHsp60/Listeners
}

default environment = {
    PATH => /usr/bin:/bin:/usr/sbin:/sbin
}

environment = {
    OSLogRateLimit => 64
    OPENCLAW_GATEWAY_TOKEN => ee5d2d72f4ccc33859a759eaa9211da39dbb6e31165169660b011095135d2b17
    OPENCLAW_GATEWAY_PORT => 19000
    OPENCLAW_SERVICE_VERSION => 2026.2.13
    OPENCLAW_SYSTEMD_UNIT => openclaw-gateway.service
    OPENCLAW_LAUNCHD_LABEL => ai.openclaw.gateway
    PATH => /opt/homebrew/bin:/usr/local/bin:/usr/bin:/bin
    HOME => /Users/jiwoongyoo
    OPENCLAW_SERVICE_KIND => gateway
    OPENCLAW_SERVICE_MARKER => openclaw
    XPC_SERVICE_NAME => ai.openclaw.gateway
}

domain = gui/501 [100022]
asid = 100022
minimum runtime = 10
exit timeout = 5
runs = 5
last exit code = 0

resource coalition = {
    ID = 4643
    type = resource
    state = active
    active count = 1
    name = ai.openclaw.gateway
}

jetsam coalition = {
    ID = 4644
    type = jetsam
    state = active
    active count = 1
    name = ai.openclaw.gateway
}
cobalt socketBOT
#

Two urgent things from what you pasted:

  1. Your launchctl print … output contains your OPENCLAW_GATEWAY_TOKEN again. Please delete/edit that Discord message (anyone with that token can control your gateway). After we get you stable, rotate the token.

  2. launchctl shows the job is “spawn scheduled” with active count = 0 and last exit code = 0 → the gateway is starting and then exiting immediately (cleanly). When that happens, the reason is almost always in:

  • the rest of the launchctl print output (exit status / throttle info), and/or
  • the newest lines of gateway.err.log.

Do these 3 checks (no comments, one by one) and paste output

  1. Confirm the gateway is allowed to run (this was the earlier blocker):
/opt/homebrew/bin/openclaw config get gateway.mode
  1. Show the rest of the launchd job (this is the missing part):
#
launchctl print gui/$UID/ai.openclaw.gateway | sed -n '140,260p'
  1. Show the newest real error lines (not the old ones):
tail -n 200 ~/.openclaw/logs/gateway.err.log | grep -v punycode | tail -n 80

After it’s stable: rotate token (don’t paste it)

Once openclaw gateway status shows RPC probe: ok, rotate:

openclaw config set gateway.auth.token "$(openssl rand -hex 32)"
openclaw gateway restart

If you paste those three outputs, I can tell you exactly why launchd is exiting immediately (and the one specific fix), without going in circles.

grand cradle
#

jiwoongyoo@Jis-MacBook-Pro-2 ~ % /opt/homebrew/bin/openclaw config get gateway.mode

🦞 OpenClaw 2026.2.13 (203b5bd)
WhatsApp automation without the "please accept our new privacy policy".

local
jiwoongyoo@Jis-MacBook-Pro-2 ~ % launchctl print gui/$UID/ai.openclaw.gateway | sed -n '140,260p'
jiwoongyoo@Jis-MacBook-Pro-2 ~ % tail -n 200 ~/.openclaw/logs/gateway.err.log | grep -v punycode | tail -n 80
jiwoongyoo@Jis-MacBook-Pro-2 ~ %
all three commands showed nothing

#

I have rotated gateway token

#

can you give me alternative suggestions? It seems that you are going in circles and none of my settings change. I don't understand why openclaw doctor --fix doesn't solve the problem

cobalt socketBOT
#

That “LaunchAgent runs, then exits immediately with exit code 0” pattern usually means launchd is not actually running the gateway process — it’s running a command that returns quickly (most commonly openclaw gateway start / … status / a wrapper), so launchd thinks “cool, done” and schedules another spawn.

Two things to do next that are safe to paste here (no tokens), and will tell us exactly what’s happening:

1) Verify which LaunchAgent plist(s) you actually have

macOS docs note the label/plist can be bot.molt.gateway (legacy com.openclaw.* may exist too), so it’s easy to be looking at the wrong service.

Run:

ls -1 ~/Library/LaunchAgents | egrep -i 'openclaw|molt|gateway' || true
launchctl list | egrep -i 'openclaw|molt|gateway' || true

If you see more than one matching plist/label, that’s a big hint for the “randomly works / randomly 1006” behavior.

2) Print ONLY the ProgramArguments (no env vars → no token leaks)

#

Pick the plist you think is active (e.g. ~/Library/LaunchAgents/ai.openclaw.gateway.plist) and run:

PL=~/Library/LaunchAgents/ai.openclaw.gateway.plist

/usr/libexec/PlistBuddy -c "Print :Label" "$PL"
/usr/libexec/PlistBuddy -c "Print :ProgramArguments" "$PL"
/usr/libexec/PlistBuddy -c "Print :StandardOutPath" "$PL" 2>/dev/null || true
/usr/libexec/PlistBuddy -c "Print :StandardErrorPath" "$PL" 2>/dev/null || true

What we want to see in ProgramArguments is something like:

  • /opt/homebrew/bin/openclaw
  • gateway (or gateway run)
  • --port 19000 (and usually --bind loopback)
#

What would explain your exact symptom immediately:

  • … gateway start (returns right away → exit 0 loop)
  • ProgramArguments[0] is just openclaw (no absolute path; launchd PATH issues)
  • it’s pointing at an old nvm/global-node path that no longer exists

3) Check the actual launchd stdout/err log path

On macOS the gateway service often logs to /tmp/openclaw/openclaw-gateway.log (not always ~/.openclaw/logs/gateway.err.log).

So after you find StandardOutPath / StandardErrorPath, tail that file. If those keys aren’t present, try:

ls -t /tmp/openclaw/openclaw-*.log 2>/dev/null | head -5
tail -n 200 /tmp/openclaw/openclaw-gateway.log 2>/dev/null | tail -n 80

Security follow-up (important)

#

Since the gateway token was pasted publicly: please delete those Discord messages and rotate the token when you’re ready. (Rotating now is fine too, but it can add noise while debugging service config.)


If you paste back:

  1. the ls ~/Library/LaunchAgents | egrep … output, and
  2. the PlistBuddy :ProgramArguments output,

we can usually pinpoint the fix in one shot (either “wrong service label”, “wrong arguments”, or “launchd PATH/old nvm node”).

grand cradle
#

jiwoongyoo@Jis-MacBook-Pro-2 ~ % ls -1 ~/Library/LaunchAgents | egrep -i 'openclaw|molt|gateway' || true
launchctl list | egrep -i 'openclaw|molt|gateway' || true
ai.openclaw.gateway.plist

  • 0 ai.openclaw.gateway
    jiwoongyoo@Jis-MacBook-Pro-2 ~ % PL=~/Library/LaunchAgents/ai.openclaw.gateway.plist

/usr/libexec/PlistBuddy -c "Print :Label" "$PL"
/usr/libexec/PlistBuddy -c "Print :ProgramArguments" "$PL"
/usr/libexec/PlistBuddy -c "Print :StandardOutPath" "$PL" 2>/dev/null || true
/usr/libexec/PlistBuddy -c "Print :StandardErrorPath" "$PL" 2>/dev/null || true
ai.openclaw.gateway
Array {
/opt/homebrew/bin/node
/opt/homebrew/lib/node_modules/openclaw/dist/index.js
gateway
--port
19000
}
/Users/jiwoongyoo/.openclaw/logs/gateway.log
/Users/jiwoongyoo/.openclaw/logs/gateway.err.log
jiwoongyoo@Jis-MacBook-Pro-2 ~ %

cobalt socketBOT
#

Nice — that plist looks correct now:

  • it’s launching Node directly (/opt/homebrew/bin/node)
  • with the OpenClaw entrypoint (…/openclaw/dist/index.js gateway --port 19000)
  • and logs go to ~/.openclaw/logs/gateway*.log

So if launchd still shows “spawn scheduled / exit 0”, the next most likely cause is: it starts, immediately decides it can’t/shouldn’t bind, and exits cleanly (common reasons: port already in use or a config guardrail).

Can you run these and paste the output (they’re token-safe):

A) Is anything already listening on 19000?

sudo lsof -nP -iTCP:19000 -sTCP:LISTEN || true

B) Force launchd to start it right now, then re-check the port

#
launchctl kickstart -k gui/$UID/ai.openclaw.gateway
sleep 1
sudo lsof -nP -iTCP:19000 -sTCP:LISTEN || true

C) Tail the error log (paste last ~80 lines)

tail -n 200 ~/.openclaw/logs/gateway.err.log | tail -n 80

If (A) shows another PID on 19000, that explains the whole loop (gateway exits immediately because it can’t bind). If (C) shows EADDRINUSE / “another gateway instance is already listening”, same story.

Also: please don’t paste launchctl print … output here (it can include env vars/tokens depending on how it was installed). The commands above avoid that.

grand cradle
#

jiwoongyoo@Jis-MacBook-Pro-2 ~ % sudo lsof -nP -iTCP:19000 -sTCP:LISTEN || true
Password:
jiwoongyoo@Jis-MacBook-Pro-2 ~ % sudo lsof -nP -iTCP:19000 -sTCP:LISTEN || true
jiwoongyoo@Jis-MacBook-Pro-2 ~ % launchctl kickstart -k gui/$UID/ai.openclaw.gateway
sleep 1
sudo lsof -nP -iTCP:19000 -sTCP:LISTEN || true
jiwoongyoo@Jis-MacBook-Pro-2 ~ % tail -n 200 ~/.openclaw/logs/gateway.err.log | tail -n 80
jiwoongyoo@Jis-MacBook-Pro-2 ~ %

cobalt socketBOT
#

Cool — no listener on 19000 + empty gateway.err.log even after kickstart means launchd is most likely failing to spawn the process at all (or it spawns and exits before printing anything, which is rarer).

Let’s narrow it down with 3 very targeted, token-safe checks:

1) Confirm the exact binaries in ProgramArguments actually exist

ls -l /opt/homebrew/bin/node
ls -l /opt/homebrew/lib/node_modules/openclaw/dist/index.js
/opt/homebrew/bin/node -v

If either ls says “No such file”, that explains the silent non-start immediately (launchd can’t exec → nothing reaches the log files).

2) Run the exact same command manually (this bypasses launchd)

This is the fastest way to see the real reason if it’s exiting cleanly:

#
OPENCLAW_SKIP_CHANNELS=1 OPENCLAW_SKIP_CANVAS_HOST=1 \
/opt/homebrew/bin/node /opt/homebrew/lib/node_modules/openclaw/dist/index.js \
gateway --port 19000 --bind loopback --verbose
  • If it stays running: in another terminal run lsof -nP -iTCP:19000 -sTCP:LISTEN and we know the gateway itself is fine → launchd is the problem.
  • If it exits, copy/paste the output (it should say why).

3) Get launchd’s spawn error without printing env vars

This should show “spawn failed”, throttle, etc., but won’t leak tokens:

launchctl print gui/$UID/ai.openclaw.gateway | egrep -i 'state|pid|last exit|spawn|error|errno|reason|throttle|failed|program|arguments|disabled'

Paste that output.

#

Once we see (1)-(3), we’ll know which bucket you’re in:

  • missing path / moved install (common after node/npm changes),
  • gateway exits immediately due to config guardrail (manual run will show),
  • or launchd spawn failure/throttling (print output will show).
grand cradle
#

lrwxr-xr-x 1 jiwoongyoo admin 34 15 Feb 01:37 /opt/homebrew/bin/node -> ../Cellar/node@22/22.22.0/bin/node
-rwxr-xr-x 1 root admin 241515 14 Feb 15:54 /opt/homebrew/lib/node_modules/openclaw/dist/index.js
v22.22.0
jiwoongyoo@Jis-MacBook-Pro-2 ~ % OPENCLAW_SKIP_CHANNELS=1 OPENCLAW_SKIP_CANVAS_HOST=1
/opt/homebrew/bin/node /opt/homebrew/lib/node_modules/openclaw/dist/index.js
gateway --port 19000 --bind loopback --verbose

00:06:10 [gateway] openclaw-mem0: registered (mode: platform, user: ji, graph: false, autoRecall: true, autoCapture: true)
11:06:11 bonjour: starting (hostname=openclaw, instance="Ji’s MacBook Pro (2) (OpenClaw)", gatewayPort=19000, minimal=true)
00:06:11 [heartbeat] started
00:06:11 [gateway] agent model: zai/glm-5
00:06:11 [gateway] listening on ws://127.0.0.1:19000 (PID 41119)
00:06:11 [gateway] listening on ws://[::1]:19000
00:06:11 [gateway] log file: /tmp/openclaw/openclaw-2026-02-15.log
00:06:11 [browser/service] Browser control service ready (profiles=2)
00:06:11 [hooks:loader] Registered hook: boot-md -> gateway:startup
00:06:11 [hooks:loader] Registered hook: bootstrap-extra-files -> agent:bootstrap
00:06:11 [hooks:loader] Registered hook: command-logger -> command
00:06:11 [hooks:loader] Registered hook: session-memory -> command:new
11:06:11 ⚠️ Session file not found: gateway
11:06:11 Proceeding with reset...
11:06:11 EXECUTE_NEW

#

jiwoongyoo@Jis-MacBook-Pro-2 ~ % launchctl print gui/$UID/ai.openclaw.gateway | egrep -i 'state|pid|last exit|spawn|error|errno|reason|throttle|failed|program|arguments|disabled'
state = spawn scheduled
program = /opt/homebrew/bin/node
arguments = {
last exit code = 0
state = active
state = active
spawn type = daemon (3)
job state = exited
properties = partial import | keepalive | runatload | inferred program

cobalt socketBOT
#

Perfect signal: the gateway runs fine manually and binds ws://127.0.0.1:19000. So this is now 100% a launchd/service issue, not OpenClaw core.

Next we need to figure out why launchd can’t spawn it / or spawns then instantly kills it.

0) First: stop the manual gateway

In the terminal where it’s running: Ctrl+C (otherwise launchd can’t bind the port if it does start).


1) Check if launchd is failing to open the log files (super common)

If ~/.openclaw/logs/gateway*.log are accidentally root-owned or the dir isn’t writable, launchd will fail to start the job.

Run:

ls -ld ~/.openclaw ~/.openclaw/logs
#
ls -l ~/.openclaw/logs/gateway.log ~/.openclaw/logs/gateway.err.log 2>/dev/null || true

If you see root as owner anywhere in that chain, tell me — that’s almost certainly the bug.


2) Kickstart again, then check whether the log timestamps moved

stat -f "%m %N" ~/.openclaw/logs/gateway.log ~/.openclaw/logs/gateway.err.log 2>/dev/null || true
launchctl kickstart -k gui/$UID/ai.openclaw.gateway
sleep 1
stat -f "%m %N" ~/.openclaw/logs/gateway.log ~/.openclaw/logs/gateway.err.log 2>/dev/null || true

If timestamps don’t change at all, launchd likely failed before it could even redirect stdout/err.

#

3) Get the launchd error without leaking tokens

(Please paste output; this filtered view should be safe.)

launchctl print gui/$UID/ai.openclaw.gateway | egrep -i 'state|pid|last exit|exit|errno|error|failed|spawn|throttle|program|arguments'

That usually contains the smoking gun like “Could not open stdout path”, “bad executable”, “throttled”, etc.

Once you paste those 2–3 outputs, we can give the exact fix (often a simple chown on ~/.openclaw/logs, or a bootout/bootstrap of the job).

#

That launchctl print … snippet is the key: launchd is running /opt/homebrew/bin/node … gateway --port 19000, but the process is exiting cleanly (exit 0) almost immediately.

Since the exact same command stays up when you run it manually, the two most common differences are:

  1. launchd can’t write to stdout/err paths (~/.openclaw/logs/gateway*.log) due to ownership/permissions, or
  2. the gateway is exiting early only in “full mode” (because launchd doesn’t set your OPENCLAW_SKIP_* env vars), and the reason is in gateway.log or the /tmp/openclaw/openclaw-*.log file.

Run these (safe to paste; no tokens):

1) Check log directory/file ownership + permissions

ls -ld ~/.openclaw ~/.openclaw/logs
ls -l ~/.openclaw/logs/gateway.log ~/.openclaw/logs/gateway.err.log 2>/dev/null || true

If anything there is owned by root (or not writable), launchd jobs often “start then exit” with basically no output.

#

2) After a kickstart, see if either log got anything

launchctl kickstart -k gui/$UID/ai.openclaw.gateway
sleep 1

tail -n 80 ~/.openclaw/logs/gateway.log 2>/dev/null || true
tail -n 80 ~/.openclaw/logs/gateway.err.log 2>/dev/null || true

ls -t /tmp/openclaw/openclaw-*.log 2>/dev/null | head -3
tail -n 80 "$(ls -t /tmp/openclaw/openclaw-*.log 2>/dev/null | head -1)" 2>/dev/null || true

3) Run the manual gateway without the skip env vars (to match launchd)

Stop any running gateway first (Ctrl+C), then:

/opt/homebrew/bin/node /opt/homebrew/lib/node_modules/openclaw/dist/index.js \
#
gateway --port 19000 --bind loopback --verbose

If this version exits quickly, it’ll finally print why (channels/auth/model/etc).

Paste outputs from (1) + (2) (and (3) only if it exits). That’ll tell us whether it’s a permissions/log-path issue vs “full startup exits” issue.

grand cradle
#

state = spawn scheduled
program = /opt/homebrew/bin/node
arguments = {
last exit code = 0
state = active
state = active
spawn type = daemon (3)
job state = exited
properties = partial import | keepalive | runatload | inferred program
jiwoongyoo@Jis-MacBook-Pro-2 ~ %
jiwoongyoo@Jis-MacBook-Pro-2 ~ % ls -ld ~/.openclaw ~/.openclaw/logs
ls -l ~/.openclaw/logs/gateway.log ~/.openclaw/logs/gateway.err.log 2>/dev/null || true
drwx------@ 40 jiwoongyoo staff 1280 15 Feb 10:45 /Users/jiwoongyoo/.openclaw
drwx------ 7 jiwoongyoo staff 224 15 Feb 10:26 /Users/jiwoongyoo/.openclaw/logs
-rw-r--r-- 1 jiwoongyoo staff 0 15 Feb 10:26 /Users/jiwoongyoo/.openclaw/logs/gateway.err.log
-rw-r--r-- 1 jiwoongyoo staff 290880 15 Feb 11:09 /Users/jiwoongyoo/.openclaw/logs/gateway.log
jiwoongyoo@Jis-MacBook-Pro-2 ~ % stat -f "%m %N" ~/.openclaw/logs/gateway.log ~/.openclaw/logs/gateway.err.log 2>/dev/null || true
launchctl kickstart -k gui/$UID/ai.openclaw.gateway
sleep 1
stat -f "%m %N" ~/.openclaw/logs/gateway.log ~/.openclaw/logs/gateway.err.log 2>/dev/null || true
1771114235 /Users/jiwoongyoo/.openclaw/logs/gateway.log
1771111586 /Users/jiwoongyoo/.openclaw/logs/gateway.err.log
1771114255 /Users/jiwoongyoo/.openclaw/logs/gateway.log
1771111586 /Users/jiwoongyoo/.openclaw/logs/gateway.err.log
jiwoongyoo@Jis-MacBook-Pro-2 ~ % launchctl print gui/$UID/ai.openclaw.gateway | egrep -i 'state|pid|last exit|exit|errno|error|failed|spawn|throttle|program|arguments'
state = spawn scheduled
program = /opt/homebrew/bin/node
arguments = {
exit timeout = 5
last exit code = 0
state = active
state = active
spawn type = daemon (3)
job state = exited
properties = partial import | keepalive | runatload | inferred program

cobalt socketBOT
#

Good — permissions look fine, and gateway.log’s mtime changes when you kickstart, so launchd is starting something that writes at least a little… then exits 0.

Next step is simply: read what it wrote right before exiting.

1) Paste the last ~120 lines of gateway.log

tail -n 120 ~/.openclaw/logs/gateway.log

If it contains anything about tokens/passwords (unlikely, but just in case), redact that line before pasting.

2) Also paste the tail of the real “/tmp” log (this is often the best one)

ls -t /tmp/openclaw/openclaw-*.log 2>/dev/null | head -3
tail -n 120 "$(ls -t /tmp/openclaw/openclaw-*.log 2>/dev/null | head -1)"
#

3) Reproduce “launchd-like” startup manually (no SKIP flags)

You proved it runs with OPENCLAW_SKIP_CHANNELS=1. Now test the same as launchd:

/opt/homebrew/bin/node /opt/homebrew/lib/node_modules/openclaw/dist/index.js \
gateway --port 19000 --bind loopback --verbose
  • If this one exits quickly, paste the output (it will usually explain exactly what launchd is hitting: missing env creds, channel init failure, config guardrail, etc.).
  • If it stays running, then the difference is almost certainly launchd environment / working directory (e.g. secrets living only in a .env that launchd never loads).

Once I see the tail of gateway.log + the /tmp/openclaw/openclaw-*.log tail, we’ll know the precise reason for the clean exit.

grand cradle
#

jiwoongyoo@Jis-MacBook-Pro-2 ~ % tail -n 120 ~/.openclaw/logs/gateway.log
2026-02-15T00:13:24.428Z [gateway] openclaw-mem0: registered (mode: platform, user: ji, graph: false, autoRecall: true, autoCapture: true)
2026-02-15T00:13:24.870Z [canvas] host mounted at http://127.0.0.1:19000/__openclaw__/canvas/ (root /Users/jiwoongyoo/.openclaw/canvas)
2026-02-15T00:13:24.912Z [heartbeat] started
2026-02-15T00:13:24.914Z [gateway] agent model: zai/glm-5
2026-02-15T00:13:24.915Z [gateway] listening on ws://127.0.0.1:19000 (PID 41738)
2026-02-15T00:13:24.915Z [gateway] listening on ws://[::1]:19000
2026-02-15T00:13:24.916Z [gateway] log file: /tmp/openclaw/openclaw-2026-02-15.log
2026-02-15T00:13:24.926Z [browser/service] Browser control service ready (profiles=2)
2026-02-15T00:13:25.034Z [hooks:loader] Registered hook: boot-md -> gateway:startup
2026-02-15T00:13:25.045Z [hooks:loader] Registered hook: bootstrap-extra-files -> agent:bootstrap
2026-02-15T00:13:25.046Z [hooks:loader] Registered hook: command-logger -> command
2026-02-15T00:13:25.048Z [hooks:loader] Registered hook: session-memory -> command:new
2026-02-15T11:13:25.049+11:00 ⚠️ Session file not found: gateway
2026-02-15T11:13:25.051+11:00 Proceeding with reset...

#

{"0":"⚠️ Session file not found: gateway","_meta":{"runtime":"node","runtimeVersion":"22.22.0","hostname":"unknown","name":"openclaw","date":"2026-02-15T00:16:54.774Z","logLevelId":3,"logLevelName":"INFO","path":{"fullFilePath":"file:///opt/homebrew/lib/node_modules/openclaw/dist/subsystem-QRNIBE7-.js:716:46","fileName":"subsystem-QRNIBE7-.js","fileNameWithLine":"subsystem-QRNIBE7-.js:716","fileColumn":"46","fileLine":"716","filePath":"opt/homebrew/lib/node_modules/openclaw/dist/subsystem-QRNIBE7-.js","filePathWithLine":"opt/homebrew/lib/node_modules/openclaw/dist/subsystem-QRNIBE7-.js:716","method":"console.log"}},"time":"2026-02-15T00:16:54.774Z"}
{"0":"Proceeding with reset...","_meta":{"runtime":"node","runtimeVersion":"22.22.0","hostname":"unknown","name":"openclaw","date":"2026-02-15T00:16:54.775Z","logLevelId":3,"logLevelName":"INFO","path":{"fullFilePath":"file:///opt/homebrew/lib/node_modules/openclaw/dist/subsystem-QRNIBE7-.js:716:46","fileName":"subsystem-QRNIBE7-.js","fileNameWithLine":"subsystem-QRNIBE7-.js:716","fileColumn":"46","fileLine":"716","filePath":"opt/homebrew/lib/node_modules/openclaw/dist/subsystem-QRNIBE7-.js","filePathWithLine":"opt/homebrew/lib/node_modules/openclaw/dist/subsystem-QRNIBE7-.js:716","method":"console.log"}},"time":"2026-02-15T00:16:54.775Z"}
{"0":"EXECUTE_NEW","_meta":{"runtime":"node","runtimeVersion":"22.22.0","hostname":"unknown","name":"openclaw","date":"2026-02-15T00:16:54.775Z","logLevelId":3,"logLevelName":"INFO","path":{"fullFilePath":"file:///opt/homebrew/lib/node_modules/openclaw/dist/subsystem-QRNIBE7-.js:716:46","fileName":"subsystem-QRNIBE7-.js","fileNameWithLine":"subsystem-QRNIBE7-.js:716","fileColumn":"46","fileLine":"716","filePath":"opt/homebrew/lib/node_modules/openclaw

#

jiwoongyoo@Jis-MacBook-Pro-2 ~ % /opt/homebrew/bin/node /opt/homebrew/lib/node_modules/openclaw/dist/index.js
gateway --port 19000 --bind loopback --verbose

🦞 OpenClaw 2026.2.13 (203b5bd) — I'm the assistant your terminal demanded, not the one your sleep schedule requested.

00:17:45 [gateway] openclaw-mem0: registered (mode: platform, user: ji, graph: false, autoRecall: true, autoCapture: true)
00:17:45 [canvas] host mounted at http://127.0.0.1:19000/__openclaw__/canvas/ (root /Users/jiwoongyoo/.openclaw/canvas)
11:17:45 bonjour: starting (hostname=openclaw, instance="Ji’s MacBook Pro (2) (OpenClaw)", gatewayPort=19000, minimal=true)
00:17:45 [heartbeat] started
00:17:45 [gateway] agent model: zai/glm-5
00:17:45 [gateway] listening on ws://127.0.0.1:19000 (PID 42102)
00:17:45 [gateway] listening on ws://[::1]:19000
00:17:45 [gateway] log file: /tmp/openclaw/openclaw-2026-02-15.log
00:17:45 [browser/service] Browser control service ready (profiles=2)
00:17:45 [hooks:loader] Registered hook: boot-md -> gateway:startup
00:17:45 [hooks:loader] Registered hook: bootstrap-extra-files -> agent:bootstrap
00:17:45 [hooks:loader] Registered hook: command-logger -> command
00:17:45 [hooks:loader] Registered hook: session-memory -> command:new
11:17:45 ⚠️ Session file not found: gateway
11:17:45 Proceeding with reset...
11:17:45 EXECUTE_NEW

#

can you suggests something new, I feel that I have given you enough information and my assessment is that it can't be fixed so can we try and resolve it without further diagnosing as it doesn't seem to make any difference

#

are you still able to help me

#

are you still there

cobalt socketBOT
#

Yep — still here.

Your last paste shows launchd starts the gateway, it binds to 19000, then exits. The missing piece is the tail of /tmp/openclaw/openclaw-2026-02-15.log (that’s where the shutdown reason usually is).

Can you run + paste:

tail -n 120 /tmp/openclaw/openclaw-2026-02-15.log

(If the file name differs, do:)

tail -n 120 "$(ls -t /tmp/openclaw/openclaw-*.log | head -1)"

Also quick check (no secrets):

#
ls -la ~/.env ~/.openclaw/.env 2>/dev/null || true
grand cradle
#

{"0":"⚠️ Session file not found: gateway","_meta":{"runtime":"node","runtimeVersion":"22.22.0","hostname":"unknown","name":"openclaw","date":"2026-02-15T00:28:08.447Z","logLevelId":3,"logLevelName":"INFO","path":{"fullFilePath":"file:///opt/homebrew/lib/node_modules/openclaw/dist/subsystem-QRNIBE7-.js:716:46","fileName":"subsystem-QRNIBE7-.js","fileNameWithLine":"subsystem-QRNIBE7-.js:716","fileColumn":"46","fileLine":"716","filePath":"opt/homebrew/lib/node_modules/openclaw/dist/subsystem-QRNIBE7-.js","filePathWithLine":"opt/homebrew/lib/node_modules/openclaw/dist/subsystem-QRNIBE7-.js:716","method":"console.log"}},"time":"2026-02-15T00:28:08.447Z"}
{"0":"Proceeding with reset...","_meta":{"runtime":"node","runtimeVersion":"22.22.0","hostname":"unknown","name":"openclaw","date":"2026-02-15T00:28:08.448Z","logLevelId":3,"logLevelName":"INFO","path":

#

{"fullFilePath":"file:///opt/homebrew/lib/node_modules/openclaw/dist/subsystem-QRNIBE7-.js:716:46","fileName":"subsystem-QRNIBE7-.js","fileNameWithLine":"subsystem-QRNIBE7-.js:716","fileColumn":"46","fileLine":"716","filePath":"opt/homebrew/lib/node_modules/openclaw/dist/subsystem-QRNIBE7-.js","filePathWithLine":"opt/homebrew/lib/node_modules/openclaw/dist/subsystem-QRNIBE7-.js:716","method":"console.log"}},"time":"2026-02-15T00:28:08.448Z"}
{"0":"EXECUTE_NEW","_meta":{"runtime":"node","runtimeVersion":"22.22.0","hostname":"unknown","name":"openclaw","date":"2026-02-15T00:28:08.449Z","logLevelId":3,"logLevelName":"INFO","path":{"fullFilePath":"file:///opt/homebrew/lib/node_modules/openclaw/dist/subsystem-QRNIBE7-.js:716:46","fileName":"subsystem-QRNIBE7-.js","fileNameWithLine":"subsystem-QRNIBE7-.js:716","fileColumn":"46","fileLine":"716","filePath":"opt/homebrew/lib/node_modules/openclaw/dist/subsystem-QRNIBE7-.js","filePathWithLine":"opt/homebrew/lib/node_modules/openclaw/dist/subsystem-QRNIBE7-.js:716","method":"console.log"}},"time":"2026-02-15T00:28:08.449Z"}
jiwoongyoo@Jis-MacBook-Pro-2 ~ % ls -la ~/.env ~/.openclaw/.env 2>/dev/null || true
-rw-r--r--@ 1 jiwoongyoo staff 210 14 Feb 18:08 /Users/jiwoongyoo/.openclaw/.env
jiwoongyoo@Jis-MacBook-Pro-2 ~ %

cobalt socketBOT
#

Yep, still here.

That /tmp/openclaw/openclaw-2026-02-15.log snippet you pasted only shows the reset message, but not why the gateway exits right after. The easiest “safe to paste” thing (tokens redacted) is:

/opt/homebrew/bin/openclaw status --all

Paste that output (or at least the Gateway / service section + the log tail it includes).

Also, quick env-file check (often the difference between “works in terminal” vs “dies under launchd”):

ls -la ~/.env ~/.openclaw/.env 2>/dev/null || true

If ~/.env exists but ~/.openclaw/.env does not, copy it (don’t paste contents):

#
cp ~/.env ~/.openclaw/.env
chmod 600 ~/.openclaw/.env
launchctl kickstart -k gui/$UID/ai.openclaw.gateway

Send the results of openclaw status --all + the ls -la … and we can pin down the exact exit cause.

grand cradle
#

Diagnosis (read-only)

Gateway connection details:
Gateway target: ws://127.0.0.1:19000
Source: local loopback
Config: /Users/jiwoongyoo/.openclaw/openclaw.json
Bind: loopback

✓ Config: /Users/jiwoongyoo/.openclaw/openclaw.json
! Restart sentinel present
Gateway restart config-patch ok (config.patch) ¡ 14h ago

Gateway logs (tail, summarized): /Users/jiwoongyoo/.openclaw/logs

stderr: /Users/jiwoongyoo/.openclaw/logs/gateway.err.log

stdout: /Users/jiwoongyoo/.openclaw/logs/gateway.log

2026-02-15T00:33:02.306Z [gateway] log file: /tmp/openclaw/openclaw-2026-02-15.log
2026-02-15T00:33:02.315Z [browser/service] Browser control service ready (profiles=2)
2026-02-15T00:33:02.414Z [hooks:loader] Registered hook: boot-md -> gateway:startup
2026-02-15T00:33:02.427Z [hooks:loader] Registered hook: bootstrap-extra-files -> agent:bootstrap
2026-02-15T00:33:02.427Z [hooks:loader] Registered hook: command-logger -> command
2026-02-15T00:33:02.430Z [hooks:loader] Registered hook: session-memory -> command:new
… 18 lines omitted …
2026-02-15T00:33:22.822Z [gateway] openclaw-mem0: registered (mode: platform, user: ji, graph: false, autoRecall: true, autoCapture: true)

#

2026-02-15T00:33:23.230Z [canvas] host mounted at http://127.0.0.1:19000/__openclaw__/canvas/ (root /Users/jiwoongyoo/.openclaw/canvas)
2026-02-15T00:33:23.271Z [heartbeat] started
2026-02-15T00:33:23.273Z [gateway] agent model: zai/glm-5
2026-02-15T00:33:23.273Z [gateway] listening on ws://127.0.0.1:19000 (PID 43410)
2026-02-15T00:33:23.274Z [gateway] listening on ws://[::1]:19000
2026-02-15T00:33:23.275Z [gateway] log file: /tmp/openclaw/openclaw-2026-02-15.log
2026-02-15T00:33:23.284Z [browser/service] Browser control service ready (profiles=2)
2026-02-15T00:33:23.401Z [hooks:loader] Registered hook: boot-md -> gateway:startup
2026-02-15T00:33:23.412Z [hooks:loader] Registered hook: bootstrap-extra-files -> agent:bootstrap
2026-02-15T00:33:23.412Z [hooks:loader] Registered hook: command-logger -> command
2026-02-15T00:33:23.415Z [hooks:loader] Registered hook: session-memory -> command:new
2026-02-15T11:33:23.416+11:00 ⚠️ Session file not found: gateway
2026-02-15T11:33:23.417+11:00 Proceeding with reset...
2026-02-15T11:33:23.418+11:00 EXECUTE_NEW
! Channel issues skipped (gateway unreachable)

Gateway health:
connect failed: connect ECONNREFUSED 127.0.0.1:19000

#

jiwoongyoo@Jis-MacBook-Pro-2 ~ % ls -la ~/.env ~/.openclaw/.env 2>/dev/null || true
-rw-r--r--@ 1 jiwoongyoo staff 210 14 Feb 18:08 /Users/jiwoongyoo/.openclaw/.env
jiwoongyoo@Jis-MacBook-Pro-2 ~ %

#

jiwoongyoo@Jis-MacBook-Pro-2 ~ % ls -la ~/.env ~/.openclaw/.env 2>/dev/null || true
-rw-r--r--@ 1 jiwoongyoo staff 210 14 Feb 18:08 /Users/jiwoongyoo/.openclaw/.env
jiwoongyoo@Jis-MacBook-Pro-2 ~ % cp ~/.env ~/.openclaw/.env
chmod 600 ~/.openclaw/.env
launchctl kickstart -k gui/$UID/ai.openclaw.gateway
cp: /Users/jiwoongyoo/.env: No such file or directory
jiwoongyoo@Jis-MacBook-Pro-2 ~ %

cobalt socketBOT
#

Still here.

That /tmp/openclaw/openclaw-2026-02-15.log tail is only:

  • “Session file not found…”
  • “Proceeding with reset…”
  • “EXECUTE_NEW”

…and then nothing. So we’re not seeing a crash reason yet.

Since you do have ~/.openclaw/.env (great — launchd runs will pick it up), the cleanest next test is:

A/B test: skip channels temporarily (to see if a channel init is what makes launchd exit)

  1. Edit ~/.openclaw/.env locally and add this line (don’t paste the file contents):
OPENCLAW_SKIP_CHANNELS=1
#
  1. Restart the LaunchAgent:
launchctl kickstart -k gui/$UID/ai.openclaw.gateway
sleep 1
sudo lsof -nP -iTCP:19000 -sTCP:LISTEN || true
  1. Check service view:
/opt/homebrew/bin/openclaw gateway status --no-probe

What this tells us

  • If it stays listening on 19000 with channels skipped → something in channel startup (Discord/Telegram/etc) is causing the service to exit, and we can narrow it from there.
  • If it still exits → it’s not channels; we’ll move on to the next subsystem.

If it does stay up with OPENCLAW_SKIP_CHANNELS=1, reply with:

#
  • the output of openclaw gateway status --no-probe
  • and whether lsof shows a listener

Then we’ll re-enable channels and isolate which one triggers the exit (without leaking any tokens).

grand cradle
#

jiwoongyoo@Jis-MacBook-Pro-2 ~ % /opt/homebrew/bin/openclaw gateway status --no-probe

🦞 OpenClaw 2026.2.13 (203b5bd) — I'll do the boring stuff while you dramatically stare at the logs like it's cinema.

Service: LaunchAgent (loaded)
File logs: /tmp/openclaw/openclaw-2026-02-15.log
Command: /opt/homebrew/bin/node /opt/homebrew/lib/node_modules/openclaw/dist/index.js gateway --port 19000
Service file: ~/Library/LaunchAgents/ai.openclaw.gateway.plist
Service env: OPENCLAW_GATEWAY_PORT=19000

Config (cli): ~/.openclaw/openclaw.json
Config (service): ~/.openclaw/openclaw.json

Gateway: bind=loopback (127.0.0.1), port=19000 (service args)
Probe target: ws://127.0.0.1:19000
Dashboard: http://127.0.0.1:19000/
Probe note: Loopback-only gateway; only local clients can connect.

Runtime: stopped (state active)
Service is loaded but not running (likely exited immediately).
File logs: /tmp/openclaw/openclaw-2026-02-15.log
Launchd stdout (if installed): /Users/jiwoongyoo/.openclaw/logs/gateway.log
Launchd stderr (if installed): /Users/jiwoongyoo/.openclaw/logs/gateway.err.log

cobalt socketBOT
#

You’re good — we finally have a concrete weird thing to poke:

Your openclaw status --all shows:

  • Restart sentinel present (from a config.patch 14h ago)
  • Gateway starts and binds to 127.0.0.1:19000
  • then soon after, health is ECONNREFUSED (so the process is gone again)

A very plausible cause is: the Gateway is doing some “post-restart” bookkeeping on boot (restart sentinel / boot hooks), and something in that path is making it exit cleanly before it settles.

1) Quick, safe test: temporarily remove the restart sentinel

This does not delete your data; it’s just a restart report file.

mv ~/.openclaw/restart-sentinel.json ~/.openclaw/restart-sentinel.json.bak 2>/dev/null || true
launchctl kickstart -k gui/$UID/ai.openclaw.gateway
#
sleep 1
sudo lsof -nP -iTCP:19000 -sTCP:LISTEN || true
/opt/homebrew/bin/openclaw gateway status

If lsof shows a listener and gateway status shows RPC probe: ok, we found the culprit.

2) If it still exits: run the “skip channels” A/B test (also safe)

Edit ~/.openclaw/.env and add these lines:

OPENCLAW_SKIP_CHANNELS=1
OPENCLAW_SKIP_CANVAS_HOST=1

Then:

#
launchctl kickstart -k gui/$UID/ai.openclaw.gateway
sleep 1
sudo lsof -nP -iTCP:19000 -sTCP:LISTEN || true
/opt/homebrew/bin/openclaw gateway status

This tells us whether some provider/plugin startup is what’s killing it.

If you run step (1), paste just:

  • the lsof …19000… output (should be short), and
  • the openclaw gateway status output

(And yep: don’t paste any raw launchctl print env vars.)

#

Yeah — that openclaw gateway status --no-probe output confirms what we suspected:

  • LaunchAgent is loaded
  • but the gateway process exits immediately (cleanly), so you get ECONNREFUSED on 127.0.0.1:19000.

And your logs show it gets as far as “listening …” and then stops right after:

Session file not found: gateway → Proceeding with reset… → EXECUTE_NEW

Let’s do two quick isolation tests.

1) Clear the “restart sentinel” (safe, doesn’t delete data)

openclaw status --all says a restart sentinel is present. Move it aside and restart the agent:

ls -la ~/.openclaw/restart-sentinel.json 2>/dev/null || true
#
mv ~/.openclaw/restart-sentinel.json ~/.openclaw/restart-sentinel.json.bak 2>/dev/null || true

launchctl kickstart -k gui/$UID/ai.openclaw.gateway
sleep 1
sudo lsof -nP -iTCP:19000 -sTCP:LISTEN || true
/opt/homebrew/bin/openclaw gateway status

If this suddenly stays up (RPC probe: ok), we’ve found the trigger.

2) If it still exits: skip channels to see if a provider init is killing it

Edit ~/.openclaw/.env (you already have it) and add:

OPENCLAW_SKIP_CHANNELS=1
#
OPENCLAW_SKIP_CANVAS_HOST=1

Then:

launchctl kickstart -k gui/$UID/ai.openclaw.gateway
sleep 1
sudo lsof -nP -iTCP:19000 -sTCP:LISTEN || true
/opt/homebrew/bin/openclaw gateway status

Reply with:

  • the lsof …19000… line(s), and
  • the openclaw gateway status summary
#

and we’ll know which branch to go down next.

grand cradle
#

launchctl kickstart -k gui/$UID/ai.openclaw.gateway
jiwoongyoo@Jis-MacBook-Pro-2 ~ % sleep 1
sudo lsof -nP -iTCP:19000 -sTCP:LISTEN || true
/opt/homebrew/bin/openclaw gateway status

🦞 OpenClaw 2026.2.13 (203b5bd) — Chat automation for people who peaked at IRC.

│
◇
Service: LaunchAgent (loaded)
File logs: /tmp/openclaw/openclaw-2026-02-15.log
Command: /opt/homebrew/bin/node /opt/homebrew/lib/node_modules/openclaw/dist/index.js gateway --port 19000
Service file: ~/Library/LaunchAgents/ai.openclaw.gateway.plist
Service env: OPENCLAW_GATEWAY_PORT=19000

Config (cli): ~/.openclaw/openclaw.json
Config (service): ~/.openclaw/openclaw.json

Gateway: bind=loopback (127.0.0.1), port=19000 (service args)
Probe target: ws://127.0.0.1:19000
Dashboard: http://127.0.0.1:19000/
Probe note: Loopback-only gateway; only local clients can connect.

Runtime: stopped (state active)
RPC probe: failed
RPC target: ws://127.0.0.1:19000
gateway closed (1006 abnormal closure (no close frame)): no close reason
Gateway target: ws://127.0.0.1:19000
Source: cli --url
Config: /Users/jiwoongyoo/.openclaw/openclaw.json

Service is loaded but not running (likely exited immediately).
File logs: /tmp/openclaw/openclaw-2026-02-15.log
Launchd stdout (if installed): /Users/jiwoongyoo/.openclaw/logs/gateway.log
Launchd stderr (if installed): /Users/jiwoongyoo/.openclaw/logs/gateway.err.log

Troubles: run openclaw status
Troubleshooting: https://docs.openclaw.ai/troubleshooting
jiwoongyoo@Jis-MacBook-Pro-2 ~ % ~/.openclaw/.env
zsh: permission denied: /Users/jiwoongyoo/.openclaw/.env
jiwoongyoo@Jis-MacBook-Pro-2 ~ %

cobalt socketBOT
#

~/.openclaw/.env is a config file, not a command — that’s why you got permission denied when you typed it.

Right now the key fact is: launchd starts the gateway, it binds, then it exits almost immediately (so lsof shows nothing and gateway status ends up with 1006/ECONNREFUSED).

Let’s isolate it cleanly:

0) (Quick sanity) make sure you’re not still using a wrapper that injects --url

In the same terminal where you run openclaw …, run:

type -a openclaw
echo "OPENCLAW_GATEWAY_URL=$OPENCLAW_GATEWAY_URL"

Paste that output (it should not contain secrets).

1) Temporarily move the restart-sentinel out of the way (safe)

#
ls -la ~/.openclaw/restart-sentinel.json 2>/dev/null || true
mv ~/.openclaw/restart-sentinel.json ~/.openclaw/restart-sentinel.json.bak 2>/dev/null || true

Then restart + check if anything is listening:

launchctl kickstart -k gui/$UID/ai.openclaw.gateway
sleep 1
sudo lsof -nP -iTCP:19000 -sTCP:LISTEN || true
/opt/homebrew/bin/openclaw gateway status --no-probe

2) If it still exits: skip channels + canvas host via .env (safe, reversible)

Append two lines to ~/.openclaw/.env (don’t paste the file contents):

#
printf "\nOPENCLAW_SKIP_CHANNELS=1\nOPENCLAW_SKIP_CANVAS_HOST=1\n" >> ~/.openclaw/.env
launchctl kickstart -k gui/$UID/ai.openclaw.gateway
sleep 1
sudo lsof -nP -iTCP:19000 -sTCP:LISTEN || true
/opt/homebrew/bin/openclaw gateway status --no-probe

Reply with:

  • the type -a openclaw + OPENCLAW_GATEWAY_URL=...
  • the lsof output (even if empty)
  • the gateway status --no-probe output

If it stays up with OPENCLAW_SKIP_CHANNELS=1, we’ll know a channel/provider init is what’s killing the service, and we can narrow down which one without touching your data.

grand cradle
#

jiwoongyoo@Jis-MacBook-Pro-2 ~ % type -a openclaw
echo "OPENCLAW_GATEWAY_URL=$OPENCLAW_GATEWAY_URL"
openclaw is a shell function from /Users/jiwoongyoo/.zshrc
openclaw is /opt/homebrew/bin/openclaw
OPENCLAW_GATEWAY_URL=
jiwoongyoo@Jis-MacBook-Pro-2 ~ %

#

jiwoongyoo@Jis-MacBook-Pro-2 ~ % printf "\nOPENCLAW_SKIP_CHANNELS=1\nOPENCLAW_SKIP_CANVAS_HOST=1\n" >> ~/.openclaw/.env
launchctl kickstart -k gui/$UID/ai.openclaw.gateway
sleep 1
sudo lsof -nP -iTCP:19000 -sTCP:LISTEN || true
/opt/homebrew/bin/openclaw gateway status --no-probe

🦞 OpenClaw 2026.2.13 (203b5bd) — I can grep it, git blame it, and gently roast it—pick your coping mechanism.

Service: LaunchAgent (loaded)
File logs: /tmp/openclaw/openclaw-2026-02-15.log
Command: /opt/homebrew/bin/node /opt/homebrew/lib/node_modules/openclaw/dist/index.js gateway --port 19000
Service file: ~/Library/LaunchAgents/ai.openclaw.gateway.plist
Service env: OPENCLAW_GATEWAY_PORT=19000

Config (cli): ~/.openclaw/openclaw.json
Config (service): ~/.openclaw/openclaw.json

Gateway: bind=loopback (127.0.0.1), port=19000 (service args)
Probe target: ws://127.0.0.1:19000
Dashboard: http://127.0.0.1:19000/
Probe note: Loopback-only gateway; only local clients can connect.

Runtime: stopped (state active)
Service is loaded but not running (likely exited immediately).
File logs: /tmp/openclaw/openclaw-2026-02-15.log
Launchd stdout (if installed): /Users/jiwoongyoo/.openclaw/logs/gateway.log
Launchd stderr (if installed): /Users/jiwoongyoo/.openclaw/logs/gateway.err.log

cobalt socketBOT
#

There’s your smoking gun:

openclaw is a shell function from /Users/jiwoongyoo/.zshrc

So when you type openclaw … you are not reliably running /opt/homebrew/bin/openclaw. That also explains the weird status line:

  • Source: cli --url

Step 1 (right now, in this terminal): bypass the function

unset -f openclaw
type -a openclaw

After that, only use /opt/homebrew/bin/openclaw … (or make sure type -a no longer shows the function).

Step 2 (permanent fix): remove the function from ~/.zshrc

#

Open ~/.zshrc in an editor and delete/comment the openclaw() { … } function block.
Then restart your shell:

exec zsh
type -a openclaw

(Please don’t paste the function here — it might contain tokens/URLs.)


After the wrapper is gone: re-run the service tests (this time with the real CLI)

First check status (no probe):

#
/opt/homebrew/bin/openclaw gateway status --no-probe

Then do the 2 isolation tests:

A) Move the restart sentinel out of the way (safe)

mv ~/.openclaw/restart-sentinel.json ~/.openclaw/restart-sentinel.json.bak 2>/dev/null || true
launchctl kickstart -k gui/$UID/ai.openclaw.gateway
sleep 1
sudo lsof -nP -iTCP:19000 -sTCP:LISTEN || true
/opt/homebrew/bin/openclaw gateway status

B) If it still exits: skip channels + canvas host via .env

#
printf "\nOPENCLAW_SKIP_CHANNELS=1\nOPENCLAW_SKIP_CANVAS_HOST=1\n" >> ~/.openclaw/.env
launchctl kickstart -k gui/$UID/ai.openclaw.gateway
sleep 1
sudo lsof -nP -iTCP:19000 -sTCP:LISTEN || true
/opt/homebrew/bin/openclaw gateway status

Post back:

  • the type -a openclaw result after fixing, and
  • the lsof …19000… + openclaw gateway status output from test (A) (and (B) if needed).
#

That’s progress: even with OPENCLAW_SKIP_CHANNELS=1 + OPENCLAW_SKIP_CANVAS_HOST=1, the LaunchAgent still exits immediately. So it’s not channels/canvas killing it.

Given your earlier openclaw status --all showed “Restart sentinel present”, the most likely culprit now is:

The gateway is crashing shortly after startup while trying to process ~/.openclaw/restart-sentinel.json

There’s a “wake from restart sentinel” task that runs ~750ms after boot. If the sentinel references a session that no longer exists, it can throw before it reaches the try/catch, and (depending on runtime settings) that can take the whole gateway down.

Do this (safe, does not delete your OpenClaw data)

  1. Move the sentinel out of the way:
ls -la ~/.openclaw/restart-sentinel.json 2>/dev/null || true
mv ~/.openclaw/restart-sentinel.json ~/.openclaw/restart-sentinel.json.bak 2>/dev/null || true
  1. Restart the LaunchAgent and check if it stays up:
#
launchctl kickstart -k gui/$UID/ai.openclaw.gateway
sleep 1
sudo lsof -nP -iTCP:19000 -sTCP:LISTEN || true
/opt/homebrew/bin/openclaw gateway status

If it works

Great — then remove the temporary skip flags you appended to ~/.openclaw/.env (otherwise channels won’t start). Easiest is to edit the file and delete these lines:

  • OPENCLAW_SKIP_CHANNELS=1
  • OPENCLAW_SKIP_CANVAS_HOST=1

Then restart the agent again.

Also: please fix the openclaw shell function

You still have openclaw as a shell function in ~/.zshrc, which will keep causing “Source: cli --url” weirdness. At minimum in your current terminal do:

#
unset -f openclaw
type -a openclaw

(And then remove that function from ~/.zshrc permanently.)

Reply with the lsof output + openclaw gateway status after moving the sentinel.

grand cradle
#

jiwoongyoo@Jis-MacBook-Pro-2 ~ % ls -la ~/.openclaw/restart-sentinel.json 2>/dev/null || true
mv ~/.openclaw/restart-sentinel.json ~/.openclaw/restart-sentinel.json.bak 2>/dev/null || true
jiwoongyoo@Jis-MacBook-Pro-2 ~ % launchctl kickstart -k gui/$UID/ai.openclaw.gateway
sleep 1
sudo lsof -nP -iTCP:19000 -sTCP:LISTEN || true
/opt/homebrew/bin/openclaw gateway status
◇
Service: LaunchAgent (loaded)
File logs: /tmp/openclaw/openclaw-2026-02-15.log
Command: /opt/homebrew/bin/node /opt/homebrew/lib/node_modules/openclaw/dist/index.js gateway --port 19000
Service file: ~/Library/LaunchAgents/ai.openclaw.gateway.plist
Service env: OPENCLAW_GATEWAY_PORT=19000

Config (cli): ~/.openclaw/openclaw.json
Config (service): ~/.openclaw/openclaw.json

Gateway: bind=loopback (127.0.0.1), port=19000 (service args)
Probe target: ws://127.0.0.1:19000
Dashboard: http://127.0.0.1:19000/
Probe note: Loopback-only gateway; only local clients can connect.

Runtime: stopped (state active)
RPC probe: failed
RPC target: ws://127.0.0.1:19000
gateway closed (1006 abnormal closure (no close frame)): no close reason
Gateway target: ws://127.0.0.1:19000
Source: cli --url
Config: /Users/jiwoongyoo/.openclaw/openclaw.json

Service is loaded but not running (likely exited immediately).
File logs: /tmp/openclaw/openclaw-2026-02-15.log
Launchd stdout (if installed): /Users/jiwoongyoo/.openclaw/logs/gateway.log
Launchd stderr (if installed): /Users/jiwoongyoo/.openclaw/logs/gateway.err.log

Troubles: run openclaw status
Troubleshooting: https://docs.openclaw.ai/troubleshooting
jiwoongyoo@Jis-MacBook-Pro-2 ~ % unset -f openclaw
type -a openclaw
unset: no such hash table element: openclaw
openclaw is /opt/homebrew/bin/openclaw
jiwoongyoo@Jis-MacBook-Pro-2 ~ %

#

are you still there? I need help

cobalt socketBOT
#

Still here.

Good news: you fixed the shell-function override (now openclaw resolves to /opt/homebrew/bin/openclaw). That removes a whole class of “Source: cli --url” weirdness going forward (but you should still delete that openclaw() { … } block from ~/.zshrc so it doesn’t come back in new terminals).

Bad news: the LaunchAgent still exits immediately even with channels/canvas skipped, so the killer is something else in gateway startup.

Next isolation (super common culprit): disable sidecars

Append these to ~/.openclaw/.env (don’t run the file, just add lines):

printf "\nOPENCLAW_SKIP_BROWSER_CONTROL_SERVER=1\nOPENCLAW_SKIP_GMAIL_WATCHER=1\nOPENCLAW_SKIP_CRON=1\n" >> ~/.openclaw/.env

Then restart + check if anything is listening:

#
launchctl kickstart -k gui/$UID/ai.openclaw.gateway
sleep 1
sudo lsof -nP -iTCP:19000 -sTCP:LISTEN || true
/opt/homebrew/bin/openclaw gateway status --no-probe

Also paste this log tail (this is where the “why it exited” line usually shows up):

tail -n 200 ~/.openclaw/logs/gateway.log | tail -n 80
tail -n 200 /tmp/openclaw/openclaw-2026-02-15.log | tail -n 80

If it still exits with all those sidecars skipped, I’ll have you grab one macOS unified-log query for launchd (safe, no tokens) — but let’s try the sidecars first.

grand cradle
#

{"0":"\u001b[38;2;226;61;45mLaunchd stderr (if installed): /Users/jiwoongyoo/.openclaw/logs/gateway.err.log\u001b[39m","_meta":{"runtime":"node","runtimeVersion":"22.22.0","hostname":"unknown","name":"openclaw","date":"2026-02-15T01:16:06.909Z","logLevelId":5,"logLevelName":"ERROR","path":{"fullFilePath":"file:///opt/homebrew/lib/node_modules/openclaw/dist/entry.js:1165:68","fileName":"entry.js","fileNameWithLine":"entry.js:1165","fileColumn":"68","fileLine":"1165","filePath":"/opt/homebrew/lib/node_modules/openclaw/dist/entry.js","filePathWithLine":"/opt/homebrew/lib/node_modules/openclaw/dist/entry.js:1165","method":"console.error"}},"time":"2026-02-15T01:16:06.909Z"}

#

{"0":"","_meta":{"runtime":"node","runtimeVersion":"22.22.0","hostname":"unknown","name":"openclaw","date":"2026-02-15T01:16:06.909Z","logLevelId":3,"logLevelName":"INFO","path":{"fullFilePath":"file:///opt/homebrew/lib/node_modules/openclaw/dist/entry.js:1163:46","fileName":"entry.js","fileNameWithLine":"entry.js:1163","fileColumn":"46","fileLine":"1163","filePath":"/opt/homebrew/lib/node_modules/openclaw/dist/entry.js","filePathWithLine":"/opt/homebrew/lib/node_modules/openclaw/dist/entry.js:1163","method":"console.log"}},"time":"2026-02-15T01:16:06.909Z"}
{"0":"\u001b[38;2;139;127;119mTroubles:\u001b[39m run openclaw status","_meta":{"runtime":"node","runtimeVersion":"22.22.0","hostname":"unknown","name":"openclaw","date":"2026-02-15T01:16:06.909Z","logLevelId":3,"logLevelName":"INFO","path":{"fullFilePath":"file:///opt/homebrew/lib/node_modules/openclaw/dist/entry.js:1163:46","fileName":"entry.js","fileNameWithLine":"entry.js:1163","fileColumn":"46","fileLine":"1163","filePath":"/opt/homebrew/lib/node_modules/openclaw/dist/entry.js","filePathWithLine":"/opt/homebrew/lib/node_modules/openclaw/dist/entry.js:1163","method":"console.log"}},"time":"2026-02-15T01:16:06.909Z"}
{"0":"\u001b[38;2;139;127;119mTroubleshooting:\u001b[39m https://docs.openclaw.ai/troubleshooting","_meta":{"runtime":"node","runtimeVersion":"22.22.0","hostname":"unknown","name":"openclaw","date":"2026-02-15T01:16:06.909Z","logLevelId":3,"logLevelName":"INFO","path":

#

{"fullFilePath":"file:///opt/homebrew/lib/node_modules/openclaw/dist/entry.js:1163:46","fileName":"entry.js","fileNameWithLine":"entry.js:1163","fileColumn":"46","fileLine":"1163","filePath":"/opt/homebrew/lib/node_modules/openclaw/dist/entry.js","filePathWithLine":"/opt/homebrew/lib/node_modules/openclaw/dist/entry.js:1163","method":"console.log"}},"time":"2026-02-15T01:16:06.909Z"}

#

jiwoongyoo@Jis-MacBook-Pro-2 ~ % tail -n 200 ~/.openclaw/logs/gateway.log | tail -n 80
tail -n 200 /tmp/openclaw/openclaw-2026-02-15.log | tail -n 80
2026-02-15T01:15:00.204Z [gateway] agent model: zai/glm-5
2026-02-15T01:15:00.205Z [gateway] listening on ws://127.0.0.1:19000 (PID 47244)
2026-02-15T01:15:00.206Z [gateway] listening on ws://[::1]:19000
2026-02-15T01:15:00.207Z [gateway] log file: /tmp/openclaw/openclaw-2026-02-15.log
2026-02-15T01:15:00.216Z [browser/service] Browser control service ready (profiles=2)
2026-02-15T01:15:00.321Z [hooks:loader] Registered hook: boot-md -> gateway:startup
2026-02-15T01:15:00.332Z [hooks:loader] Registered hook: bootstrap-extra-files -> agent:bootstrap
2026-02-15T01:15:00.333Z [hooks:loader] Registered hook: command-logger -> command
2026-02-15T01:15:00.335Z [hooks:loader] Registered hook: session-memory -> command:new
2026-02-15T12:15:00.336+11:00 ⚠️ Session file not found: gateway
2026-02-15T12:15:00.337+11:00 Proceeding with reset...
2026-02-15T12:15:00.337+11:00 EXECUTE_NEW

cobalt socketBOT
#

Still here — and that JSON line you pasted is just the CLI printing an error banner (“Launchd stderr …”), not the root cause.

At this point we’ve proven:

  • the LaunchAgent can start, even binds to 127.0.0.1:19000
  • but it exits almost immediately
  • it still exits even when you skip channels + canvas (so it’s not Discord/Telegram/etc)

Now we need one decisive A/B test:

Test: does the gateway stay up when run manually for 15–30s?

  1. Stop/unload the LaunchAgent so it doesn’t fight you:
/opt/homebrew/bin/openclaw gateway stop || true
launchctl bootout gui/$UID/ai.openclaw.gateway 2>/dev/null || true
#
  1. Run the exact gateway command in the foreground:
/opt/homebrew/bin/node /opt/homebrew/lib/node_modules/openclaw/dist/index.js \
gateway --port 19000 --bind loopback --verbose
  1. While that is running, in a second terminal:
sudo lsof -nP -iTCP:19000 -sTCP:LISTEN || true

Tell me which outcome you get

  • If manual run stays up (you keep seeing logs, command doesn’t return): this is a launchd-specific kill/exit, and next we’ll pull the macOS unified logs for why launchd is terminating it.
  • If manual run also exits quickly (prompt returns): it’s OpenClaw exiting itself right after that EXECUTE_NEW, and we’ll focus on that code path / state dir.
#

Also: good catch fixing the openclaw function — keep it that way (remove it from ~/.zshrc so it doesn’t come back).

grand cradle
#

jiwoongyoo@Jis-MacBook-Pro-2 ~ % /opt/homebrew/bin/openclaw gateway stop || true
launchctl bootout gui/$UID/ai.openclaw.gateway 2>/dev/null || true

🦞 OpenClaw 2026.2.13 (203b5bd) — Your AI assistant, now without the $3,499 headset.

Stopped LaunchAgent: gui/501/ai.openclaw.gateway
jiwoongyoo@Jis-MacBook-Pro-2 ~ % /opt/homebrew/bin/node /opt/homebrew/lib/node_modules/openclaw/dist/index.js
gateway --port 19000 --bind loopback --verbose

🦞 OpenClaw 2026.2.13 (203b5bd) — Pairing codes exist because even bots believe in consent—and good security hygiene.

01:20:26 [gateway] openclaw-mem0: registered (mode: platform, user: ji, graph: false, autoRecall: true, autoCapture: true)
12:20:26 bonjour: starting (hostname=openclaw, instance="Ji’s MacBook Pro (2) (OpenClaw)", gatewayPort=19000, minimal=true)
01:20:26 [heartbeat] started
01:20:26 [gateway] agent model: zai/glm-5
01:20:26 [gateway] listening on ws://127.0.0.1:19000 (PID 47753)
01:20:26 [gateway] listening on ws://[::1]:19000
01:20:26 [gateway] log file: /tmp/openclaw/openclaw-2026-02-15.log
01:20:26 [hooks:loader] Registered hook: boot-md -> gateway:startup
01:20:26 [hooks:loader] Registered hook: bootstrap-extra-files -> agent:bootstrap
01:20:26 [hooks:loader] Registered hook: command-logger -> command
01:20:26 [hooks:loader] Registered hook: session-memory -> command:new
12:20:26 ⚠️ Session file not found: gateway
12:20:26 Proceeding with reset...
12:20:26 EXECUTE_NEW

cobalt socketBOT
#

Still here — and you’re not crazy: the logs stop at EXECUTE_NEW with no stacktrace, which strongly suggests the gateway is being terminated externally (often by launchd), or it’s instantly self-restarting in a way that doesn’t get logged.

Two things to do next that will finally tell us “who killed it”:

1) Check if your .env skip flags are actually taking effect (duplicates matter)

dotenv won’t override an already-set var, and if your .env already had OPENCLAW_SKIP_* earlier, appending new ones may do nothing.

Run:

grep -n '^OPENCLAW_SKIP' ~/.openclaw/.env

If you see duplicates, edit ~/.openclaw/.env and keep only one line per key.

2) Ask macOS launchd why it’s stopping the job (safe; no tokens)

Right after a kickstart:

#
launchctl kickstart -k gui/$UID/ai.openclaw.gateway
sleep 1

log show --style syslog --last 2m \
  --predicate '(subsystem == "com.apple.xpc.launchd") && (eventMessage CONTAINS "ai.openclaw.gateway")' \
  | tail -n 80

Paste that output. It usually contains the smoking gun like “exited due to signal”, “killed”, “throttled”, etc.

Also: good job fixing the openclaw shell function

In this terminal it’s gone (openclaw is /opt/homebrew/bin/openclaw). Make it permanent by removing the openclaw() { … } block from ~/.zshrc so it doesn’t come back in new terminals.

Send the grep output + the log show … tail and we can tell you exactly what to fix next.

#

Still here — and this is actually a useful result: you’ve now reproduced the same “stops at EXECUTE_NEW” behavior without launchd, so we can debug it like a normal process.

Right now your gateway command might be either:

  • still running (just not printing more logs), or
  • already exited right after EXECUTE_NEW.

Do this while that terminal is sitting at EXECUTE_NEW

Open a second Terminal window/tab and run:

# 1) Is the gateway process still alive?
ps -p 47753 -o pid,etime,command || echo "PID 47753 not running"

# 2) Is anything listening on the port?
sudo lsof -nP -iTCP:19000 -sTCP:LISTEN || true
#
# 3) Does the HTTP dashboard respond at all?
curl -I http://127.0.0.1:19000/ 2>/dev/null | head -20 || echo "curl failed"

(Replace 47753 if your PID changed — it’s the one printed in listening on … (PID …).)

Paste those 3 outputs.

If PID is running + port is listening

Then the gateway is actually up, and the next step is figuring out why openclaw gateway status gives 1006 (usually wrapper/URL/auth mismatch — which you’ve mostly fixed by removing the shell function).

If PID is gone / no listener

Then we need a crash reason. In that case we’ll re-run once with strict Node crash output enabled:

#
NODE_OPTIONS="--trace-uncaught --trace-warnings --unhandled-rejections=strict" \
/opt/homebrew/bin/node /opt/homebrew/lib/node_modules/openclaw/dist/index.js \
gateway --port 19000 --bind loopback --verbose

But first: run the 3 checks above so we know which branch we’re on.

grand cradle
#

jiwoongyoo@Jis-MacBook-Pro-2 ~ % NODE_OPTIONS="--trace-uncaught --trace-warnings --unhandled-rejections=strict"
/opt/homebrew/bin/node /opt/homebrew/lib/node_modules/openclaw/dist/index.js
gateway --port 19000 --bind loopback --verbose

🦞 OpenClaw 2026.2.13 (203b5bd) — IPC, but it's your phone.

01:27:56 [gateway] openclaw-mem0: registered (mode: platform, user: ji, graph: false, autoRecall: true, autoCapture: true)
12:27:57 bonjour: starting (hostname=openclaw, instance="Ji’s MacBook Pro (2) (OpenClaw)", gatewayPort=19000, minimal=true)
01:27:57 [heartbeat] started
01:27:57 [gateway] agent model: zai/glm-5
01:27:57 [gateway] listening on ws://127.0.0.1:19000 (PID 47797)
01:27:57 [gateway] listening on ws://[::1]:19000
01:27:57 [gateway] log file: /tmp/openclaw/openclaw-2026-02-15.log
01:27:57 [hooks:loader] Registered hook: boot-md -> gateway:startup
01:27:57 [hooks:loader] Registered hook: bootstrap-extra-files -> agent:bootstrap
01:27:57 [hooks:loader] Registered hook: command-logger -> command
01:27:57 [hooks:loader] Registered hook: session-memory -> command:new
12:27:57 ⚠️ Session file not found: gateway
12:27:57 Proceeding with reset...
12:27:57 EXECUTE_NEW

cobalt socketBOT
#

Still here — and the fact you see the same “EXECUTE_NEW” line even when running the gateway manually is actually good: it means this isn’t launchd doing something weird, it’s either:

  1. the gateway is still running fine (and just has no more logs), or
  2. it’s exiting cleanly right after that line.

We need to determine which one.

While that node … gateway … process is sitting there at EXECUTE_NEW

Open a second Terminal and run:

# Is the PID still alive?
ps -p 47797 -o pid,etime,command || echo "PID not running"

# Is it still listening?
sudo lsof -nP -iTCP:19000 -sTCP:LISTEN || true
#

# Does the dashboard respond at all?
curl -I http://127.0.0.1:19000/ 2>/dev/null | head -20 || echo "curl failed"

(Use the PID you see in your log: PID 47797.)

If PID is alive + lsof shows LISTEN

Then the gateway is actually up, and we’ll switch to “why does openclaw gateway status / Control UI still fail” (usually auth/wrapper/env mismatch).

If PID is not running and no LISTEN

Then it’s doing a clean exit loop. In that case the next best move is Doctor repair, because this “Session file not found: gateway → reset” smells like a busted session store/transcript reference:

/opt/homebrew/bin/openclaw doctor --repair
#

(Doctor output is designed to be shareable; secrets are redacted — but still don’t paste anything that looks like a token.)

Also: great job fixing the shell function override — type -a openclaw now points to /opt/homebrew/bin/openclaw. Make that permanent by removing the openclaw() { … } block from ~/.zshrc so it doesn’t come back in new terminals.

Paste the ps + lsof + curl outputs and we’ll go down the right branch.

grand cradle
#

◇ Gateway ────────────────────────╮
│ │
│ Gateway service not installed. │
│ │
├──────────────────────────────────╯

Installed LaunchAgent: /Users/jiwoongyoo/Library/LaunchAgents/ai.openclaw.gateway.plist
Logs: /Users/jiwoongyoo/.openclaw/logs/gateway.log
Config overwrite: /Users/jiwoongyoo/.openclaw/openclaw.json (TOKEN, backup=/Users/jiwoongyoo/.openclaw/openclaw.json.bak)
Updated ~/.openclaw/openclaw.json
Backup: ~/.openclaw/openclaw.json.bak
│
└ Doctor complete.

jiwoongyoo@Jis-MacBook-Pro-2 ~ %

cobalt socketBOT
#

Nice — openclaw doctor did the right kind of “surgical reset”:

  • re-installed the LaunchAgent (~/Library/LaunchAgents/ai.openclaw.gateway.plist)
  • rewrote ~/.openclaw/openclaw.json and saved a backup (openclaw.json.bak)
  • (and it likely generated/changed your gateway token, since it mentions TOKEN)

Now do this exact sequence to see if the gateway finally stays up:

1) Remove any “skip” flags you previously appended (important)

Those would make the gateway start “half disabled” even after doctor.

grep -n '^OPENCLAW_SKIP' ~/.openclaw/.env || true

If you see any of these, delete those lines from ~/.openclaw/.env:

  • OPENCLAW_SKIP_CHANNELS
#
  • OPENCLAW_SKIP_CANVAS_HOST
  • OPENCLAW_SKIP_BROWSER_CONTROL_SERVER
  • OPENCLAW_SKIP_GMAIL_WATCHER
  • OPENCLAW_SKIP_CRON

2) Start the service + check status

/opt/homebrew/bin/openclaw gateway restart
/opt/homebrew/bin/openclaw gateway status

What we want: Runtime: running and RPC probe: ok.

3) If it still says “exited immediately”, paste log tails

tail -n 120 ~/.openclaw/logs/gateway.err.log
#
tail -n 120 ~/.openclaw/logs/gateway.log
tail -n 120 "$(ls -t /tmp/openclaw/openclaw-*.log | head -1)"

4) One more thing: kill the old shell wrapper permanently

You previously had an openclaw() shell function in ~/.zshrc. Make sure it’s removed so it doesn’t come back in new terminals:

type -a openclaw

Token note (don’t paste it here)

Since doctor overwrote config with TOKEN, your Control UI may need the new token. Get it locally with:

/opt/homebrew/bin/openclaw config get gateway.auth.token
#

Copy/paste it into the Control UI on your Mac — but don’t post it in Discord.

Send back the output of openclaw gateway status after step (2).

grand cradle
#

Service: LaunchAgent (loaded)
File logs: /tmp/openclaw/openclaw-2026-02-15.log
Command: /opt/homebrew/bin/node /opt/homebrew/lib/node_modules/openclaw/dist/index.js gateway --port 19000
Service file: ~/Library/LaunchAgents/ai.openclaw.gateway.plist
Service env: OPENCLAW_GATEWAY_PORT=19000

Config (cli): ~/.openclaw/openclaw.json
Config (service): ~/.openclaw/openclaw.json

Gateway: bind=loopback (127.0.0.1), port=19000 (service args)
Probe target: ws://127.0.0.1:19000
Dashboard: http://127.0.0.1:19000/
Probe note: Loopback-only gateway; only local clients can connect.

Runtime: running (pid 48339, state active)
Warm-up: launch agents can take a few seconds. Try again shortly.
RPC probe: failed
RPC target: ws://127.0.0.1:19000
gateway closed (1006 abnormal closure (no close frame)): no close reason
Gateway target: ws://127.0.0.1:19000
Source: cli --url
Config: /Users/jiwoongyoo/.openclaw/openclaw.json

Gateway port 19000 is not listening (service appears running).
Last gateway error: 2026-02-15T12:37:43.909+11:00 EXECUTE_NEW
Logs: ~/.openclaw/logs/gateway.log
Errors: ~/.openclaw/logs/gateway.err.log

Troubles: run openclaw status
Troubleshooting: https://docs.openclaw.ai/troubleshooting
jiwoongyoo@Jis-MacBook-Pro-2 ~ % tail -n 120 ~/.openclaw/logs/gateway.err.log
jiwoongyoo@Jis-MacBook-Pro-2 ~ % tail -n 120 ~/.openclaw/logs/gateway.log
tail -n 120 "$(ls -t /tmp/openclaw/openclaw-*.log | head -1)"

#

2026-02-15T01:36:40.776Z [gateway] listening on ws://127.0.0.1:19000 (PID 48204)
2026-02-15T01:36:40.777Z [gateway] listening on ws://[::1]:19000
2026-02-15T01:36:40.778Z [gateway] log file: /tmp/openclaw/openclaw-2026-02-15.log
2026-02-15T01:36:40.890Z [hooks:loader] Registered hook: boot-md -> gateway:startup
2026-02-15T01:36:40.902Z [hooks:loader] Registered hook: bootstrap-extra-files -> agent:bootstrap
2026-02-15T01:36:40.903Z [hooks:loader] Registered hook: command-logger -> command
2026-02-15T01:36:40.905Z [hooks:loader] Registered hook: session-memory -> command:new

#

what else should I try, I'm getting sick of going in circles with no progress

#

jiwoongyoo@Jis-MacBook-Pro-2 ~ % rm -f ~/.openclaw/cli.json
jiwoongyoo@Jis-MacBook-Pro-2 ~ % sudo killall -9 node
Password:
No matching processes were found
jiwoongyoo@Jis-MacBook-Pro-2 ~ % /opt/homebrew/bin/node /opt/homebrew/lib/node_modules/openclaw/dist/index.js gateway --port 19000

🦞 OpenClaw 2026.2.13 (203b5bd) — iMessage green bubble energy, but for everyone.

01:44:04 [gateway] openclaw-mem0: registered (mode: platform, user: ji, graph: false, autoRecall: true, autoCapture: true)
01:44:04 [canvas] host mounted at http://127.0.0.1:19000/__openclaw__/canvas/ (root /Users/jiwoongyoo/.openclaw/canvas)
01:44:04 [heartbeat] started
01:44:04 [gateway] agent model: zai/glm-5
01:44:04 [gateway] listening on ws://127.0.0.1:19000 (PID 48929)
01:44:04 [gateway] listening on ws://[::1]:19000
01:44:04 [gateway] log file: /tmp/openclaw/openclaw-2026-02-15.log
01:44:04 [browser/service] Browser control service ready (profiles=2)
01:44:04 [hooks:loader] Registered hook: boot-md -> gateway:startup
01:44:04 [hooks:loader] Registered hook: bootstrap-extra-files -> agent:bootstrap
01:44:04 [hooks:loader] Registered hook: command-logger -> command
01:44:04 [hooks:loader] Registered hook: session-memory -> command:new
12:44:04 ⚠️ Session file not found: gateway
12:44:04 Proceeding with reset...
12:44:04 EXECUTE_NEW
jiwoongyoo@Jis-MacBook-Pro-2 ~ %

#

what should I do

#

what's happening

grand cradle
#

âœ