mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-01 06:56:47 +02:00
After `gateway stop` (which runs `launchctl bootout`), `gateway start` checks `isLoaded` → false → prints "not loaded" hints and exits. The service is never re-bootstrapped, so `start` cannot recover from `stop` — only `gateway install` works. Root cause: src/cli/daemon-cli/lifecycle-core.ts:208-217 — runServiceStart calls handleServiceNotLoaded which only prints hints, never attempts service.restart() (which already handles bootstrap via bootstrapLaunchAgentOrThrow at launchd.ts:598). Fix: when service is not loaded, attempt service.restart() first (which handles re-bootstrapping on all platforms). If restart fails (e.g. plist was deleted, not just booted out), fall back to the existing hints. The restart path is already proven: restartLaunchAgent (launchd.ts:556) handles "not loaded" via bootstrapLaunchAgentOrThrow. This fix routes the start command through the same recovery path. Closes #53878 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: HCL <chenglunhu@gmail.com>