symptoms:
after sleep/wake, the OpenClaw mac app is sometimes just gone
not merely disconnected / stale ws / “paired but not connected”
i can’t find its PID in Activity Monitor anymore
i have to manually reopen the app
also, even with Launch at Login enabled and the app allowed under Background Activity, it still won’t reliably reopen on login or after wake
i also keep seeing this log warning:
Using your own bundle identifier as an NSUserDefaults suite name does not make sense and will not work.i found some related launch-agent history in the repo:
PR #39872 — disable KeepAlive in app launch agent to allow proper quit
PR #20272 — LaunchAgent KeepAlive causes restart loop
PR #26718 — exit 0 when already running to prevent LaunchAgent restart loop
do you reckon this sounds like:the same class of mac app lifecycle / LaunchAgent bug as those
a regression in that area
or something separate, like the app cleanly exiting after wake and then not getting relaunched?
and does that NSUserDefaults suite warning look relevant, or just incidental noise?
#macOS app disappears after sleep/wake and won’t relaunch on login or wake
1 messages · Page 1 of 1 (latest)
First, can you paste openclaw --version?
My read, after checking current source, is: this looks closer to “the app exits after sleep/wake, then never gets relaunched” than to the old KeepAlive restart-loop bug.
Why I say that:
- the app’s “Launch at Login” plist currently has
RunAtLoad=truebut noKeepAlive - that was an intentional fix so manual Quit does not instantly relaunch the app
- the gateway LaunchAgent is a separate thing, and that one still uses launchd supervision
So the old PRs are definitely the same neighborhood, but the failure mode you’re seeing feels more like:
- app process disappears on wake for some reason, crash/clean exit/macOS kill
- because the app launch agent no longer uses
KeepAlive, nothing brings it back after that - login relaunch then becomes a second question, either stale launchd/login-item state or macOS not honoring that agent reliably
The NSUserDefaults suite name warning looks mostly incidental, not the cause of the vanishing PID. I found a code path that does UserDefaults(suiteName: launchdLabel), and launchdLabel is currently ai.openclaw.mac, which is also the app bundle id. That matches the warning almost exactly. It looks like a real bug/code smell, but more in the “stable defaults / nix-mode detection” area than “app disappeared after wake”.
If you want to narrow it fast, please paste:
openclaw --version
launchctl print gui/$UID/ai.openclaw.mac
log show --last 30m --predicate '(process == "OpenClaw") OR (process == "launchd") OR (subsystem == "ai.openclaw")'
That should tell us whether it is:
- a crash/termination of the app
- launchd still loaded but idle
- or the app LaunchAgent/login item state itself getting wedged
Relevant docs:
im on 2026.4.15, openclaw cli, macos app, remote gateway all on the same version. and here's part of the output: the whole output is massive so i only paste the first few lines:
gui/501/ai.openclaw.mac = {
active count = 0
path = /Users/qearl/Library/LaunchAgents/ai.openclaw.mac.plist
type = LaunchAgent
state = not running
program = /Applications/OpenClaw.app/Contents/MacOS/OpenClaw
arguments = {
/Applications/OpenClaw.app/Contents/MacOS/OpenClaw
}
working directory = /Users/qearl
stdout path = /tmp/openclaw/openclaw-stdout.log
stderr path = /tmp/openclaw/openclaw-stdout.log
inherited environment = {
SSH_AUTH_SOCK => /var/run/com.apple.launchd.qCNTSfstME/Listeners
}
default environment = {
PATH => /usr/bin:/bin:/usr/sbin:/sbin
}
environment = {
OSLogRateLimit => 64
PATH => /Users/qearl/Library/pnpm:/opt/homebrew/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
XPC_SERVICE_NAME => ai.openclaw.mac
}
domain = gui/501 [100016]
asid = 100016
minimum runtime = 10
exit timeout = 5
runs = 2
last exit code = 0
resource coalition = {
ID = 3016
type = resource
state = active
active count = 1
name = ai.openclaw.mac
}
jetsam coalition = {
ID = 3017
type = jetsam
state = active
active count = 1
name = ai.openclaw.mac
}
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 = runatload | inferred program
}
Filtering the log data using "process == "OpenClaw" OR process == "launchd" OR subsystem == "ai.openclaw""
Skipping info and debug messages, pass --info and/or --debug to include.
That launchctl output is actually pretty revealing.
The big tells are:
state = not runningjob state = exitedlast exit code = 0properties = runatload- and the app LaunchAgent has no
KeepAlive
So this looks much more like a clean/handled exit than a crash.
My current read:
- the app is probably exiting normally (or at least through a graceful path)
- launchd records that as
exit code = 0 - because the app LaunchAgent intentionally does not use
KeepAlive, launchd just leaves it dead - so the real bug is likely why the app is exiting around sleep/wake/login, not “why launchd won’t resurrect a crashed app”
So yes, it’s the same general lifecycle area, but not the old restart-loop bug itself. It looks more like:
- some wake/login path causes the app to terminate
- launchd behaves as configured and does not restart it afterward
And yep, the NSUserDefaults suite name warning still looks like incidental noise to me. It’s probably real, but it lines up with a bad UserDefaults(suiteName: "ai.openclaw.mac") usage, not with the app silently disappearing.
What I’d want next is the info/debug log around the moment it dies, plus the launchd stdout log:
log show --last 2h --info --debug --predicate '(process == "OpenClaw") OR (process == "launchd") OR (subsystem == "ai.openclaw")' | rg -i 'duplicate|signal|terminat|exit|wake|sleep|launchd'
tail -200 /tmp/openclaw/openclaw-stdout.log
I’m especially looking for:
duplicate instancereceived signalterminating
- anything right before
applicationWillTerminate
If I had to guess right now, the top suspects are:
- a SIGTERM / graceful shutdown path
- or a duplicate-instance/self-exit path
- much less likely, a crash
If you paste those filtered logs, I can probably narrow it down a lot further.
Relevant docs, for completeness:
bro that's massive!
lol fair, sorry 😅
Let’s make it tiny. Please run just these two:
log show --last 2h --info --debug --predicate '(process == "OpenClaw") OR (subsystem == "ai.openclaw")' | rg -i 'duplicate instance|received signal|terminating|willterminate|exit' | tail -50
tail -80 /tmp/openclaw/openclaw-stdout.log
If the first one comes back empty, try this slightly wider one:
log show --last 2h --info --debug --predicate '(process == "OpenClaw") OR (process == "launchd") OR (subsystem == "ai.openclaw")' | rg -i 'openclaw|launchd|duplicate|signal|terminat|exit|wake|sleep' | tail -80
That should be enough to tell whether it’s:
- self-exit,
- signal-driven quit,
- or launchd weirdness.
it's too long so I will send it to you in separate parts; I'm sending the beginning section first:
2026-04-18 03:26:42.962546+0800 0x2b567a Error 0x0 56525 0 OpenClaw: [ai.openclaw:node.service] Node service command failed (exit 1): (Did you mean restart?)
2026-04-18 03:26:52.404356+0800 0x2b5788 Default 0x0 56542 0 OpenClaw: (AppKit) [com.apple.AppKit:AutomaticTermination] void _NSDisableAutomaticTerminationAndLog(NSString *) Terminating
2026-04-18 03:26:52.411500+0800 0x2b5788 Default 0x0 56542 0 OpenClaw: (AppKit) [com.apple.AppKit:Application] Termination complete. Exiting without sudden termination.
Nice, this already tells us something important.
That is not a crash. It’s a normal AppKit shutdown:
AutomaticTermination ... TerminatingTermination complete. Exiting without sudden termination
So the theory is getting stronger:
- the app is being told to quit or is choosing to quit
- then launchd leaves it dead, because the app LaunchAgent is
RunAtLoadonly, notKeepAlive
The node.service error is interesting, but on its own I would treat it as possibly adjacent, not proven causal yet.
Can you send just the 20 to 40 lines immediately before:
2026-04-18 03:26:52.404356+0800 ... AutomaticTermination ... Terminating
That next slice is the money shot. I’m specifically looking for one of these:
received signalduplicate instanceapplicationWillTerminate- anything about mode switching, logout, sleep, wake, or node service lifecycle
So far, this is looking like clean exit + no relaunch, not crash.
still too long, send u the first part first:
2026-04-18 03:26:52.411500+0800 0x2b5788 Default 0x0 56542 0 OpenClaw: (AppKit) [com.apple.AppKit:Application] Termination complete. Exiting without sudden termination.
2026-04-18 03:26:52.411559+0800 0x2b5788 Default 0x0 56542 0 OpenClaw: (CoreAnalytics) [com.apple.CoreAnalytics:client] Entering exit handler.
2026-04-18 03:26:52.411560+0800 0x2b5788 Default 0x0 56542 0 OpenClaw: (CoreAnalytics) [com.apple.CoreAnalytics:client] Queueing exit procedure onto XPC queue. Any further messages sent will be discarded. activeSendTransactions=0
2026-04-18 03:26:52.411575+0800 0x2b5788 Default 0x0 56542 0 OpenClaw: (CoreAnalytics) [com.apple.CoreAnalytics:client] Exiting exit handler.
2026-04-18 03:49:01.279879+0800 0x2b566e Info 0x0 56525 0 OpenClaw:
Yep, that chunk is still after the quit happened.
You don’t need to manually split it. Let’s make the shell do the slicing:
log show --last 2h --info --debug --predicate '(process == "OpenClaw") OR (subsystem == "ai.openclaw") OR (process == "launchd")' | rg -C 20 '03:26:52.*Terminating|received signal|duplicate instance|node.service|applicationWillTerminate'
That should give a small context block around the interesting lines.
What we have so far still says:
- normal termination
- not a crash
- likely quit/signal/self-exit, then no relaunch because no
KeepAlive
If that command is still annoying, an even narrower one is:
log show --last 2h --info --debug --predicate '(process == "OpenClaw") OR (subsystem == "ai.openclaw")' | rg -C 15 'received signal|duplicate instance|node.service|Terminating'
Paste that output and we should finally get the line right before the quit.
still massive😭 im just giving u the last few lines:
2026-04-18 03:26:52.411560+0800 0x2b5788 Default 0x0 56542 0 OpenClaw: (CoreAnalytics) [com.apple.CoreAnalytics:client] Queueing exit procedure onto XPC queue. Any further messages sent will be discarded. activeSendTransactions=0
2026-04-18 03:26:52.411563+0800 0x2b5793 Default 0x0 56542 0 OpenClaw: (libxpc.dylib) [com.apple.xpc:connection] [0x9e506dcc0] activating connection: mach=true listener=false peer=false name=com.apple.powerlog.plxpclogger.xpc
2026-04-18 03:26:52.411568+0800 0x2b578c Default 0x0 56542 0 OpenClaw: (CoreAnalytics) [com.apple.CoreAnalytics:client] Cancelling XPC connection. Any further reply handler invocations will not retry messages
2026-04-18 03:26:52.411568+0800 0x2b578c Default 0x0 56542 0 OpenClaw: (libxpc.dylib) [com.apple.xpc:connection] [0x9e506c780] invalidated because the current process cancelled the connection by calling xpc_connection_cancel()
2026-04-18 03:26:52.411575+0800 0x2b5788 Default 0x0 56542 0 OpenClaw: (CoreAnalytics) [com.apple.CoreAnalytics:client] Exiting exit handler.
Yeah, we’ve got enough now. No need to keep wrestling the giant logs.
My take at this point:
- this is not a crash
- the app is exiting cleanly
- because the app LaunchAgent is RunAtLoad without KeepAlive, it then stays dead
- so this looks like a macOS app lifecycle bug / regression in quit handling around sleep-wake-login, not the old restart-loop bug itself
And the NSUserDefaults suite name warning still looks separate/noise for this symptom. Real bug, probably, but not the reason the PID disappears.
So the working diagnosis is basically:
something tells OpenClaw.app to terminate normally after wake/login, and launchd does not relaunch it because that agent intentionally no longer has KeepAlive
If you want one tiny next-step capture for the next repro, use this live command before sleeping the Mac:
log stream --info --debug --predicate '(process == "OpenClaw") OR (subsystem == "ai.openclaw") OR (process == "launchd")' | rg -i 'received signal|terminat|node.service|launchd'
That’ll be way easier than digging through log show afterward.
Honestly though, I think you already have enough for a bug report:
- version
2026.4.15 - app disappears after sleep/wake
launchctl print gui/$UID/ai.openclaw.macshowsjob state = exited,last exit code = 0- AppKit logs show
Termination complete. Exiting without sudden termination - Launch at Login enabled, but app does not reliably come back
If you file it, use GitHub issues: https://github.com/openclaw/openclaw/issues
Glad we narrowed it down, this definitely smells like a real bug.
ok im gonna repro it, so i run this live command and then?
Yep, exactly.
- Start the live log command in Terminal.
- Leave it running.
- Trigger the repro: sleep/wake, or log out/in, whatever usually makes the app vanish.
- When OpenClaw disappears, do not paste the whole thing 😄
Just copy the last 30 to 50 lines from that terminal. - Then run this once too:
launchctl print gui/$UID/ai.openclaw.mac | rg 'state =|job state =|last exit code =|runs ='
If you want, you can stop the live log after the repro with Ctrl-C.
So the ideal paste back is:
- the last ~30 to 50 live log lines
- plus the 4 launchctl lines above
That should be enough to catch the exact quit trigger.
got the output, but only one line after sleep/wake
Filtering the log data using "process == "OpenClaw" OR subsystem == "ai.openclaw" OR process == "launchd""
should i run this one now?
launchctl print gui/$UID/ai.openclaw.mac | rg 'state =|job state =|last exit code =|runs ='
Yep, run that now 👍
launchctl print gui/$UID/ai.openclaw.mac | rg 'state =|job state =|last exit code =|runs ='
And please paste:
- that output
- plus the one line you got from the live log
If it still shows basically the same exited / exit code 0 story, then we’ve pretty much confirmed the app is silently clean-exiting and not being relaunched.
If the live log stays useless, next round I’d switch to an even more targeted live capture.
state = not running
runs = 2
last exit code = 0
state = active
state = active
job state = exited
live log still shows that line i just pasted to u
Yep, that confirms it.
This is the clearest read now:
- not running
- job state = exited
- last exit code = 0
- no useful crash log
- no relaunch afterward
So I’m pretty comfortable calling this a silent clean-exit / lifecycle bug, not a crash. And because the app LaunchAgent no longer uses KeepAlive, once it exits, it just stays dead.
At this point, I would stop digging locally and file a GitHub issue. This looks real.
You can pretty much paste this:
macOS app exits after sleep/wake and does not relaunch
On
2026.4.15, the OpenClaw macOS app sometimes disappears after sleep/wake. It is not merely disconnected, the process is gone.
launchctl print gui/$UID/ai.openclaw.macshows:
state = not runningjob state = exitedlast exit code = 0runs = 2Unified logging does not show a crash. AppKit logs show normal termination (
Termination complete. Exiting without sudden termination.).
Launch at Loginis enabled and the app is allowed under Background Activity, but it does not reliably relaunch on login or after wake.There is also a warning:
Using your own bundle identifier as an NSUserDefaults suite name does not make sense and will not work.This looks more like a clean-exit/lifecycle regression than a crash, possibly related to the app LaunchAgent no longer using
KeepAlive.
Issue link: https://github.com/openclaw/openclaw/issues
If you want, I can help you trim that into a tighter issue title/body first.