Summary
When gateway.bind is set to lan, the Mac App periodically overwrites openclaw.json and removes the gateway.auth section. This causes the gateway to enter a crash loop because newer versions refuse to bind to LAN without auth.
Steps to reproduce
- Set
gateway.bind: "lan" and gateway.auth.token: "some-token" in ~/.openclaw/openclaw.json
- Start the gateway via LaunchAgent — it starts fine
- Open the Mac App (or wait for it to sync config)
- Mac App overwrites
openclaw.json — the gateway.auth key is gone
- Gateway detects config change, restarts, and immediately fails with
Refusing to bind gateway to lan without auth
KeepAlive: true in the plist causes launchd to restart it endlessly — crash loop
Expected behavior
Mac App should preserve unknown/user-added keys in openclaw.json when it writes config back to disk — or at minimum preserve gateway.auth.
Actual behavior
Mac App drops gateway.auth entirely on every config write. The gateway then enters an infinite crash loop:
2026-02-19T22:20:06.944+08:00 Refusing to bind gateway to lan without auth.
Set gateway.auth.token/password (or OPENCLAW_GATEWAY_TOKEN/OPENCLAW_GATEWAY_PASSWORD) or pass --token/--password.
This repeats every ~10 seconds indefinitely. The feishu channel also goes down as a result.
Setting OPENCLAW_GATEWAY_TOKEN in the plist's EnvironmentVariables does work as a workaround for the initial startup, but the Mac App's config overwrite still triggers a gateway restart (it detects gateway.auth changed), causing brief outages each time.
Version
2026.2.17
Operating system
macOS 26.3 (Apple Silicon)
Install method
npm global + Mac App (both running simultaneously)
Logs, screenshots, and evidence
gateway.err.log after Mac App overwrites config — this pattern repeats hundreds of times:
2026-02-19T22:20:06.944+08:00 Refusing to bind gateway to lan without auth.
2026-02-19T22:20:17.822+08:00 Refusing to bind gateway to lan without auth.
2026-02-19T22:20:37.233+08:00 Refusing to bind gateway to lan without auth.
...
From /tmp/openclaw/openclaw-2026-02-19.log, the Mac App overwrite is visible:
Config overwrite: /Users/doomsday616/.openclaw/openclaw.json
config change detected; evaluating reload (gateway.auth)
config change requires gateway restart (gateway.auth)
Also: openclaw doctor reports feishu channel as failed (unknown) - Request failed with status code 400 after the crash loop.
Impact and severity
- Affected: Anyone using
bind=lan with both the Mac App and CLI gateway running
- Severity: High — gateway is completely down until manually fixed
- Frequency: 100% repro, happens every time Mac App writes config
- Consequence: All channels (feishu, etc.) go offline. The crash loop also generates a 3GB+
gateway.log from repeated startup attempts.
Additional information
Workaround: switch gateway.bind to loopback so auth is not required. This avoids the crash but means LAN devices can't connect to the gateway.
openclaw doctor --fix partially helps — it regenerates a token — but the Mac App will overwrite it again on next config sync.
The root issue seems to be that the Mac App maintains its own in-memory copy of openclaw.json and does full overwrites without merging user-added keys.
Summary
When
gateway.bindis set tolan, the Mac App periodically overwritesopenclaw.jsonand removes thegateway.authsection. This causes the gateway to enter a crash loop because newer versions refuse to bind to LAN without auth.Steps to reproduce
gateway.bind: "lan"andgateway.auth.token: "some-token"in~/.openclaw/openclaw.jsonopenclaw.json— thegateway.authkey is goneRefusing to bind gateway to lan without authKeepAlive: truein the plist causes launchd to restart it endlessly — crash loopExpected behavior
Mac App should preserve unknown/user-added keys in
openclaw.jsonwhen it writes config back to disk — or at minimum preservegateway.auth.Actual behavior
Mac App drops
gateway.authentirely on every config write. The gateway then enters an infinite crash loop:This repeats every ~10 seconds indefinitely. The feishu channel also goes down as a result.
Setting
OPENCLAW_GATEWAY_TOKENin the plist'sEnvironmentVariablesdoes work as a workaround for the initial startup, but the Mac App's config overwrite still triggers a gateway restart (it detectsgateway.authchanged), causing brief outages each time.Version
2026.2.17
Operating system
macOS 26.3 (Apple Silicon)
Install method
npm global + Mac App (both running simultaneously)
Logs, screenshots, and evidence
gateway.err.logafter Mac App overwrites config — this pattern repeats hundreds of times:From
/tmp/openclaw/openclaw-2026-02-19.log, the Mac App overwrite is visible:Also:
openclaw doctorreports feishu channel asfailed (unknown) - Request failed with status code 400after the crash loop.Impact and severity
bind=lanwith both the Mac App and CLI gateway runninggateway.logfrom repeated startup attempts.Additional information
Workaround: switch
gateway.bindtoloopbackso auth is not required. This avoids the crash but means LAN devices can't connect to the gateway.openclaw doctor --fixpartially helps — it regenerates a token — but the Mac App will overwrite it again on next config sync.The root issue seems to be that the Mac App maintains its own in-memory copy of
openclaw.jsonand does full overwrites without merging user-added keys.