Skip to content

macOS update can leave manual-update loop and stale node host causing Gateway restart storm #87928

Open

Description

@Neomail2

Summary

After upgrading OpenClaw from 2026.5.22 to 2026.5.27 on macOS, the Gateway entered a restart loop every ~75 seconds.

The visible loop was:

[ws] node version mismatch ... clientVersion=2026.5.18 gatewayVersion=2026.5.27; closing for supervisor restart
[gateway] SIGTERM received
... gateway relaunch ...
[ws] node version mismatch ...

This required manual launchd intervention to recover the installation.

Environment

  • OpenClaw before update: 2026.5.22
  • OpenClaw after update: 2026.5.27 (27ae826)
  • npm package version: 2026.5.27
  • Node.js: v25.8.1
  • macOS: 26.3 build 25D125
  • Gateway service: LaunchAgent ai.openclaw.gateway
  • Gateway bind: 127.0.0.1:18789

What happened

The manual update launched on 2026-05-28 via a launchd submitted job:

ai.openclaw.manual-update-20260528-1803

The update did not settle cleanly and produced two nested failure modes:

  1. The manual update job was still submitted with KeepAlive, so it repeatedly relaunched openclaw update even though the package was already at 2026.5.27. In this installation it reached runs = 787.
  2. Each no-op update pass still did Stopping managed gateway service..., repeatedly killing/restarting the Gateway.
  3. One iteration left ai.openclaw.gateway unloaded/stopped rather than bootstrapped.
  4. Separately, ai.openclaw.node had been running since before the update and still had old 2026.5.18 code in memory.
  5. When the Gateway came back as 2026.5.27, the stale node host connected as 2026.5.18; the Gateway detected the mismatch and closed for supervisor restart, creating the visible loop.

Manual recovery that worked

launchctl bootout gui/501/ai.openclaw.manual-update-20260528-1803
launchctl kickstart -k gui/501/ai.openclaw.node
launchctl bootstrap gui/501 ~/Library/LaunchAgents/ai.openclaw.gateway.plist

After that:

  • openclaw gateway status showed LaunchAgent loaded, runtime active, connectivity probe OK.
  • CLI version and Gateway version both reported 2026.5.27.
  • No further node version mismatch or Gateway SIGTERM events were observed after the clean restart.

Expected behavior

openclaw update on macOS should leave the managed runtime in a coherent state:

  • no lingering ai.openclaw.manual-update-* submitted job relaunching after a successful/no-op update;
  • Gateway service bootstrapped/running if it was managed before the update;
  • node host service restarted or otherwise made version-compatible with the upgraded Gateway;
  • if a node/gateway version mismatch is detected after update, diagnostics should point to restarting ai.openclaw.node rather than producing a Gateway restart storm.

Related issues

This appears related to, but not fully covered by:

This field report combines all three symptoms in one post-update incident.

Activity

  1. clawsweeper commented on May 29, 2026

    @clawsweeper
    Contributor

    Codex review: this still needs some work.

    Summary
    Keep open: current main still excludes the reported updater labels from self-disarming, and Doctor deliberately leaves updater-only jobs unchanged.

    Reproducibility: Current source deterministically excludes the reported labels from self-disarming and updater-only commands from Doctor removal; no live current-main macOS restart-loop reproduction was run.

    Root-cause cluster
    Relationship: canonical
    Canonical: #87928
    Summary: This issue retains the submitted-updater recovery gap after narrower matcher and lifecycle repairs.

    Members:

    Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

    Maintainer decision needed

    • Question: Should explicit Doctor repair cover verified stale updater-only submitted jobs, including the reported manual-update label variants?
    • Recommendation: Extend verified updater recovery: Define stale-job eligibility and active-update exclusions, then extend the existing launchd owner and expose a visible Doctor/Fix action.
    • Why: The merged lifecycle repair and current documentation intentionally leave updater-only commands unchanged, so recovery eligibility needs an explicit owner decision.

    Next step
    Decide updater-only recovery eligibility, then establish failing regressions for the reported labels and implement a visible Doctor/Fix recovery path.

    Review details

    Best possible solution:

    Provide a visible Doctor/Fix recovery action for freshly verified stale updater jobs while preserving active updates and managed services.

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

    Current source deterministically excludes the reported labels from self-disarming and updater-only commands from Doctor removal; no live current-main macOS restart-loop reproduction was run.

    Is this the best way to solve the issue?

    Extend the existing metadata-verifying launchd owner after deciding updater recovery eligibility; broad label-based removal or relaxed node protocol checks would not establish safe recovery.

    AGENTS.md: found and applied where relevant.

    Remaining risk / open question:

    • Updater-only removal crosses an intentionally preserved repair boundary and needs a rule distinguishing stale submitted helpers from legitimate active updates.
    • Source proves the recovery exclusions; the complete restart storm has not been reproduced on current macOS or through a published-updater-to-candidate transition.

    Codex review notes: model internal, reasoning medium; reviewed against 961f85dc8adb.

    Label changes

    Label changes:

    No label changes.

    Label justifications:

    • P0: Corroborated update incidents repeatedly terminate the core Gateway and require manual launchd intervention to recover.
    • impact:crash-loop: Persistent submitted updater jobs repeatedly interrupt Gateway availability after each helper exit.
    • impact:ux-release-blocker: Recovery requires terminal-level service intervention, while current Doctor leaves updater-only jobs unchanged.
    • maturity:stable: The primary owner is the M4 macos-host Gateway Service Lifecycle surface, whose taxonomy includes updater cleanup and stranded-service recovery under the documented update contract.
    Evidence reviewed

    Acceptance criteria:

    • Establish regressions that fail on the reviewed base for each reported label and pass with the repair.
    • pnpm test src/daemon/launchd-service-membership.test.ts src/daemon/launchd-foreign-jobs.test.ts src/commands/doctor-foreign-launchd-jobs.test.ts
    • Run a published-updater-to-candidate macOS npm-global LaunchAgent scenario for version-changing and already-current updates; verify no helper respawn, healthy Gateway service, and local-node recovery.
    • pnpm check:changed
    • git diff --check

    What I checked:

    • Current updater matcher excludes reported labels: The matcher accepts ai.openclaw.update.*, manual-update followed by a dot and digits, and metadata-verified profile .update. labels; it rejects ai.openclaw.manual-update, ai.openclaw.manual-update-20260528-1803, and ai.openclaw.manualupdate.20260604.1780586988 before metadata inspection. (src/daemon/launchd-update-jobs.ts:18, 961f85dc8adb)
    • Update preparation consumes the restricted operation: prepareMutableUpdateRuntime invokes disableCurrentOpenClawUpdateLaunchdJob, which returns false for labels outside the matcher. (src/cli/update-cli/update-command-run.ts:671, 961f85dc8adb)
    • Doctor preserves updater-only commands: Removal requires verified Gateway lifecycle actions; Doctor filters to safeToRemove jobs, and classifier coverage explicitly gives openclaw update --yes no lifecycle actions. (src/daemon/launchd-foreign-jobs.ts:298, 961f85dc8adb)
    • Merged repair explicitly preserves the remaining boundary: fix: diagnose and repair stray macOS Gateway restart jobs #142230 is merged and explicitly says updater-only commands are reported but not removed by its lifecycle repair. (cd98a0172368)
    • Latest release retains the matcher exclusion: The v2026.10.7 source contains the same three label-matching branches, so the reported label coverage is not fixed in the latest release. (src/daemon/launchd-update-jobs.ts:18, 157d8c2bc3ea)
    • Independent shipped-version incidents: tylerbittner corroborated concurrent persistent manualupdate jobs on 2026.6.1; arcabotai supplied the bare manual-update label on 2026.7.1 and verified recovery after native job removal.
    How this review workflow works
    • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
    • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
    • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
    • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
    • Maintainers can also comment @clawsweeper review to request a fresh review only.
    • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge; those execution lanes are retired.
    • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

    Reviewed October 27, 2026, 4:41 AM ET / 08:41 UTC.

  2. added
    P1High-priority user-facing bug, regression, or broken workflow.
    impact:crash-loopCrash, hang, restart loop, or process-level availability failure.
    issue-rating: 🐚 platinum hermitGood issue quality with a plausible reproduction path needing some confirmation.
    clawsweeper:needs-live-reproClawSweeper needs live local, crabbox, or manual validation to confirm this issue.
    clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.
    clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.
    clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.
    clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.
    on May 29, 2026
  3. tylerbittner commented on Jun 4, 2026

    @tylerbittner
    Contributor

    Live repro on 2026.6.1 — still occurring, now with two concurrent loops

    Confirming this is not fixed as of 2026.6.1 (this issue's evidence stopped at 5.27, and the root-primitive issue #86104 at 5.22). Same failure shape, plus two new wrinkles: a renamed job family and no dedupe across concurrent openclaw update invocations.

    Environment

    • OpenClaw: 2026.6.1 (CLI and Gateway both report 2026.6.1)
    • macOS, Apple Silicon (M4)
    • Node: v25.9.0
    • Gateway service: LaunchAgent ai.openclaw.gateway, bind 127.0.0.1:18789

    What happened

    openclaw update was run during the 6.1 upgrade. It submitted out-of-band updater jobs via launchctl submit, and launchd inferred them as keepalive (matching #86104). Because I invoked the update twice (~21s apart), it left two independent submitted jobs, both running the same worker script and both relaunching after clean exits:

    ai.openclaw.manualupdate.20260604.1780586988   runs = 423   last exit code = 0   properties = keepalive | inferred program
    ai.openclaw.manualupdate.20260604.1780587009   runs = 311   last exit code = 0   properties = keepalive | inferred program
    

    Both run the same worker: /tmp/openclaw-update-6-1-20260604.sh, whose payload is openclaw update --yes --json --timeout 1200. The package was already at 2026.6.1, so every pass was a no-op — but the worker still stopped/restarted the Gateway each cycle.

    User-visible symptom: the Gateway dies ~1 minute after every start. Structured log shows the loop (paired entries because both jobs fire together, ~every 80s):

    [restart] killing 1 stale gateway process(es) before restart: <pid>
    [gateway] signal SIGTERM received
    [gateway] received SIGTERM; shutting down
    [shutdown] started: gateway stopping
    

    Update-worker log confirms paired no-op cycles:

    === OpenClaw 6.1 manual launchd update 2026-06-04T15:07:44-0700 ===
    === OpenClaw 6.1 manual launchd update 2026-06-04T15:07:44-0700 ===
    === OpenClaw 6.1 manual launchd update 2026-06-04T15:09:24-0700 ===
    === OpenClaw 6.1 manual launchd update 2026-06-04T15:09:24-0700 ===
    

    Recovery that worked

    launchctl bootout gui/$UID/ai.openclaw.manualupdate.20260604.1780586988
    launchctl bootout gui/$UID/ai.openclaw.manualupdate.20260604.1780587009
    rm -f /tmp/openclaw-update-6-1-20260604.sh /tmp/openclaw-update-6-1-20260604.log

    After-fix evidence: Gateway held a single stable PID across 8 samples over ~1m40s (previously it was killed every ~80s), and no SIGTERM events appeared after the bootout:

    15:15:51 gateway_pid=68928
    15:16:05 gateway_pid=68928
    ...
    15:17:29 gateway_pid=68928
    openclaw gateway status -> Runtime: running (pid 68928, state active), Listening: 127.0.0.1:18789
    

    Two additions beyond the existing report

    1. No dedupe: running openclaw update more than once produces multiple independent keepalive updater jobs that compound the restart rate. A guard against concurrent/duplicate submitted updater jobs would help.
    2. Renamed job family: these are ai.openclaw.manualupdate.<date>.<epoch>, distinct from the earlier ai.openclaw.manual-update-* (macOS update can leave manual-update loop and stale node host causing Gateway restart storm #87928) and ai.openclaw.oob-update.* (macOS: launchctl submit can relaunch one-shot update jobs after clean exit #86104). Any cleanup/detection keyed on the older names won't catch this variant.

    (Diagnosed and recovered with AI assistance; all values above are copied from live launchctl print output, the structured gateway log, and the updater worker log on the affected machine.)

  4. added
    clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.
    and removed
    clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.
    on Jun 15, 2026
  5. openclaw-barnacle commented on Jul 6, 2026

    @openclaw-barnacle

    This issue has been automatically marked as stale due to inactivity.
    Please add updates or it will be closed.

  6. 25 remaining items

  7. added
    issue-rating: 🐚 platinum hermitGood issue quality with a plausible reproduction path needing some confirmation.
    clawsweeper:needs-live-reproClawSweeper needs live local, crabbox, or manual validation to confirm this issue.
    clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.
    issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.
    and removed
    clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.
    issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.
    clawsweeper:needs-live-reproClawSweeper needs live local, crabbox, or manual validation to confirm this issue.
    issue-rating: 🐚 platinum hermitGood issue quality with a plausible reproduction path needing some confirmation.
    on Oct 5, 2026
  8. added
    clawsweeper:intake:bugPreliminary submission classification; full source review pending.
    clawsweeper:intake:needs-reproPreliminary submission classification; full source review pending.
    and removed
    clawsweeper:intake:bugPreliminary submission classification; full source review pending.
    clawsweeper:intake:needs-reproPreliminary submission classification; full source review pending.
    on Oct 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P0Emergency: data loss, security bypass, crash loop, or unusable core runtime.clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.impact:crash-loopCrash, hang, restart loop, or process-level availability failure.impact:ux-release-blockerA non-technical user is blocked without terminal, logs, config, or support.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.maturity:stableBroken existing behavior primarily owned by an M4/M5 scorecard surface.staleMarked as stale due to inactivity

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions