Repository navigation
Description
Bug type
Crash + recovery path bug. The crash itself is bad; the post-crash recovery makes the install unbootable.
Beta release blocker
Yes — affects 5.2 GA users on macOS. Recovery requires manual npm i -g openclaw@latest; the supervisor's auto-recovery actively makes the situation worse.
Summary
After running openclaw 2026.5.2 (a448042) cleanly for ~12 hours, the gateway crashed with an unhandled rejection:
TypeError: consumeGatewayRestartIntentPayloadSync is not a function
The supervisor (or some recovery path I haven't been able to fully trace) then downgraded the global npm package to 2026.4.29 — but the on-disk ~/.openclaw/openclaw.json was still at 5.2 schema. Result: the older binary refuses to start ("Refusing to start the gateway service because this OpenClaw binary (2026.4.29) is older than the config last written by OpenClaw 2026.5.2"), launchd KeepAlive's it forever in a tight loop, and the gateway is permanently unreachable until the user manually npm i -g openclaw@latest.
This is not the first occurrence — the same downgrade backup pattern (openclaw.json.before-downgrade-20260429-...) appeared 12 hours earlier, suggesting the crash is reproducible at roughly the 12-hour uptime mark.
Crash signature
From ~/.openclaw/logs/stability/openclaw-stability-2026-05-03T16-31-08-909Z-82397-unhandled_rejection.json:
{
"version": 1,
"generatedAt": "2026-05-03T16:31:08.909Z",
"reason": "unhandled_rejection",
"process": {
"pid": 82397,
"platform": "darwin",
"arch": "arm64",
"node": "25.8.2",
"uptimeMs": 43208279
},
"error": {
"name": "TypeError",
"message": "consumeGatewayRestartIntentPayloadSync is not a function"
}
}uptimeMs = 43,208,279 ms ≈ 12.0 hours. Heap was at 412 MB used / 532 MB total at crash, RSS 116 MB — not memory-pressured.
Snapshot summary leading up to the crash (last 1000 events, 642 dropped):
diagnostic.heartbeat: 240
diagnostic.memory.sample: 240
exec.process.completed: 150
session.state: 119
queue.lane.enqueue/dequeue: 96 / 96
diagnostic.liveness.warning: 16
session.long_running: 5
message.queued: 11
So there had been some long-running sessions and liveness warnings, but the process was otherwise functional.
Reproduction (best inference)
- Install
openclaw@2026.5.2on macOS (Apple Silicon, Node 25.8.2). - Use it normally for ~12 hours — including agent runs that perform
gatewaytool restart actions (channels reload, plugins update, etc.). - At some point a
gatewayrestart intent payload is consumed via the synchronous code path. - Process throws
TypeError: consumeGatewayRestartIntentPayloadSync is not a functionand crashes (unhandled rejection). - Supervisor / recovery path downgrades global package to
2026.4.29. 2026.4.29binary refuses to start because~/.openclaw/openclaw.jsonmeta.lastTouchedVersionis2026.5.2.- Gateway is now in a permanent restart loop —
gateway.err.logfills with "Refusing to start the gateway service...".
I don't have a deterministic trigger for step 3 yet — it's possible the function is called on every Nth restart intent, or specifically when an intent coalesces with an in-flight one (cf. #74424, which is the same restart-intent payload subsystem with a different failure mode).
Expected behavior
- The function being called (
consumeGatewayRestartIntentPayloadSync) should exist, or the call site should use the available async variant. - The post-crash recovery should not leave the install in a state that's neither bootable nor downgrade-clean. If a downgrade is going to happen, the supervisor should also restore a config snapshot from before the schema bump, or refuse to downgrade.
Actual behavior
- Crash with
TypeError. - Supervisor downgrades binary; config left at newer schema; install unbootable.
- launchd KeepAlive churns indefinitely.
Recovery steps that worked for me
# Move the downgrade backup out of the way so future "auto repair" can't reuse it
mkdir -p ~/.openclaw/_archive
mv ~/.openclaw/openclaw.json.before-downgrade-20260429-* ~/.openclaw/_archive/
# Re-upgrade
npm i -g openclaw@latest # back to 2026.5.2
openclaw gateway restartAfter ~45s of plugin staging, gateway probe was healthy: ok=true connect=true rpcOk=true.
But the underlying ~12h crash is unresolved; this is a reset, not a fix.
Environment
- macOS Darwin 25.4.0 (Apple Silicon)
- Node v25.8.2
- npm v11.11.1
- openclaw 2026.5.2 (a448042) → auto-downgrades to 2026.4.29 on crash
- Plugins enabled: memory-core, telegram, browser, ... (full list available on request)
Related
- [Bug]: gateway restart continuationMessage is silently dropped when restart coalesces with an in-flight restart #74424 — same restart-intent payload subsystem; different symptom (silent drop of
continuationMessage) - [5.2] Upgrade path broken for users with externalized plugins in config: install location mismatch, doctor --fix unreachable, downgrade blocked by meta.lastTouchedVersion #76586 — different 5.2 upgrade-path break (externalized plugins); shows
meta.lastTouchedVersion-based downgrade-blocking has been a known footgun in 5.2
Attachments
I can attach (sanitised):
openclaw-stability-2026-05-03T16-31-08-909Z-82397-unhandled_rejection.json(262 KB, contains last 1000 telemetry events)- Last 200 lines of
gateway.err.logshowing the Refusing-to-start loop ~/.openclaw/openclaw.json.before-downgrade-20260429-20260503-105351— the config snapshot the auto-downgrade preserved (showing this isn't a one-shot — same downgrade was triggered 12 hours earlier)
Let me know what's most useful.
Metadata
Metadata
Assignees
Labels
Type
Fields
Priority
Activity
clawsweeper commentedon May 4, 2026
Thanks for the context here. I did a careful shell check against current
main, and this is already implemented.Current main and the shipped v2026.6.10 release cover the central crash/recovery path: restart intent consumption is present behind the lifecycle runtime, signal handlers catch and unstick restart failures, and supervised updates no longer replace the live Gateway package tree.
Root-cause cluster
Relationship:
canonicalCanonical: #77095
Summary: This issue is the canonical report for the missing restart-intent function plus unsafe supervised update/downgrade recovery path; related restart continuation and LaunchAgent reports overlap but do not leave the central work open.
Members:
fixed_by_candidate: fix(gateway): add .catch() to SIGTERM/SIGUSR1 signal handlers #83131 - Merged PR fixed the signal-handler rejection component that could otherwise leave restart handling stuck.partial_overlap: fix(infra/agents): session-routing guard for coalesced gateway restart continuations (#86742) #87323 - Merged PR fixed the adjacent coalesced restart-continuation session-routing path referenced by the issue cluster.partial_overlap: [Bug]: gateway restart continuationMessage is silently dropped when restart coalesces with an in-flight restart #74424 - Closed issue covered a narrower restart continuation drop, not the missing-function crash plus downgrade loop.partial_overlap: [5.2] Upgrade path broken for users with externalized plugins in config: install location mismatch, doctor --fix unreachable, downgrade blocked by meta.lastTouchedVersion #76586 - Closed issue covered a separate 5.2 externalized-plugin upgrade failure and newer-config guard recovery pain.adjacent_distinct: Restart race condition with LaunchAgent KeepAlive causes shutdown instead of restart #88309 - Open issue tracks a remaining macOS LaunchAgent KeepAlive restart race, which is separate from the missing function and managed update handoff fixes.Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.
So I’m closing this as already implemented rather than keeping a duplicate issue open.
Review details
Best possible solution:
Keep the shipped lifecycle-runtime and managed-update handoff behavior, and route any remaining macOS LaunchAgent KeepAlive restart race to #88309.
Do we have a high-confidence way to reproduce the issue?
No live 12-hour macOS reproduction was run; the original crash maps to source-level restart/update paths that are now covered by current code, tests, and release proof.
Is this the best way to solve the issue?
Yes: the current solution fixes the owner boundaries directly with an eager lifecycle runtime, signal-handler recovery, and managed-service update handoff instead of adding runtime compatibility shims.
Security review:
Security review: No patch security review applies because this is an issue triage, not a proposed diff.
AGENTS.md: found and applied where relevant.
What I checked:
src/infra/restart.ts:275, 4d292caaa429)src/cli/gateway-cli/lifecycle.runtime.ts:15, 4d292caaa429)src/cli/gateway-cli/run-loop.ts:111, 4d292caaa429)src/cli/gateway-cli/run-loop.ts:702, 4d292caaa429)src/gateway/server-methods/update.ts:188, 4d292caaa429)src/gateway/server-methods/update.ts:338, 4d292caaa429)Likely related people:
src/cli/gateway-cli/run-loop.ts,src/cli/gateway-cli/run-loop.test.ts)src/gateway/server-methods/update.ts,docs/cli/update.md)src/infra/restart.ts,src/infra/infra-runtime.test.ts)Codex review notes: model internal, reasoning high; reviewed against 4d292caaa429; fix evidence: release v2026.6.10, commit aa69b12d0086.
barnacle-openclaw commentedon May 30, 2026
This issue has been automatically marked as stale due to inactivity.
Please add updates or it will be closed.