You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
v2026.4.26: gateway restart can hang ~3-4 min before new process starts #73303
On macOS (LaunchAgent mode), restarting Gateway on v2026.4.26 can sometimes take ~3-4 minutes before the new process starts, even though normal startup is only a few seconds.
Environment
OpenClaw: 2026.4.26 (be8c246)
OS: macOS 15/26 (arm64)
LaunchAgent label: ai.openclaw.gateway
Active channel plugins include: openclaw-weixin, telegram
Observed behavior
A restart is requested (SIGTERM), but old process appears to linger for minutes before fresh startup begins.
Example timeline from logs:
12:57:37[gateway] received SIGTERM; restarting
13:01:15[gateway] loading configuration…
13:01:38[gateway] ready
So total restart wall time is ~4 min, while internal startup path is fast:
http server listening (...; 3.4s)
Additional signal
During startup there is also a silent gap before weixin provider init:
13:01:18.780 hooks loaded
13:01:38.209 weixin provider starting
(~20s no logs)
Not sure if related, but the main pain is the pre-start delay between SIGTERM and fresh config load.
Also seen in same logs
Config warning for plugin manifest metadata:
channel plugin manifest declares openclaw-weixin without channelConfigs metadata
(We tested adding channelConfigs: {} locally, but restart latency behavior still reproduced.)
Impact
Operationally painful for frequent restarts/debugging; perceived as "restart is stuck".
Request
Could you help check:
whether shutdown path in 2026.4.26 can block launchd supervisor restart;
whether plugin/channel teardown has a long timeout path without intermediate logs;
whether this is a known regression in 2026.4.26 and if a patch/workaround exists.
If useful, I can provide full redacted log slice around restart.
Thanks for the context here. I did a careful shell check against current main, and this is already implemented.
Current main has shipped the maintainer-approved restart drain controls that the earlier review said were missing: operators can now force an immediate managed restart, set a per-restart wait budget, use the safe coordinated restart path, and see active task blockers before the drain waits.
So I’m closing this as already implemented rather than keeping a duplicate issue open.
Review details
Best possible solution:
Keep the shipped restart controls and docs; if plain restart should change default semantics or Weixin/model startup remains slow, track that as a narrower follow-up with fresh logs on a current release.
Do we have a high-confidence way to reproduce the issue?
Yes for the historical mechanism: source and tests show managed restart can enter the active-work drain and wait up to the configured budget. I did not live-reproduce the exact macOS plus plugin timing from the report on current main.
Is this the best way to solve the issue?
Yes. The shipped solution preserves compatibility for plain service-manager restarts while adding explicit --force, --wait, --safe, and --safe --skip-deferral paths plus blocker logging, which is the maintainable policy split the earlier review requested.
Security review:
Security review: Non-PR issue triage; no patch security or supply-chain review applies.
What I checked:
Issue discussion: The issue body gives a v2026.4.26 SIGTERM-to-next-config-load timeline of about four minutes, and multiple independent commenters reported similar .24-.26 restart or response-latency regressions with rollbacks to .23; the prior ClawSweeper comment identified the active-work restart drain as the likely mechanism.
CLI exposes immediate and bounded restart controls:gateway restart now accepts --force to restart without waiting for active Gateway work and --wait <duration> to override the drain budget for one restart. (src/cli/daemon-cli/register-service-commands.ts:130, bf16038b5c61)
Service-manager restart intent carries the operator choice: The daemon restart path parses --force into { force: true }, parses --wait into waitMs, and writes that intent before calling the service manager restart. (src/cli/daemon-cli/lifecycle.ts:129, bf16038b5c61)
Gateway run loop implements the escape hatch: On SIGTERM/SIGUSR1 restart, current main consumes the restart intent; a forced restart skips active task and embedded-run waiting, while waitMs overrides the drain timeout. (src/cli/gateway-cli/run-loop.ts:416, bf16038b5c61)
Regression coverage locks the behavior: Tests assert service-manager intents preserve wait options, SIGTERM restart wait overrides are honored, and forced restarts do not call the active-work wait helpers while logging the blocker and forced-restart message. (src/cli/gateway-cli/run-loop.test.ts:382, bf16038b5c61)
User docs describe the supported operator paths: The Gateway and daemon docs now document plain restart compatibility, --safe, --safe --skip-deferral, --wait 30s, and --force as the immediate override path when the operator wants the Gateway back now. Public docs: docs/cli/gateway.md. (docs/cli/gateway.md:117, bf16038b5c61)
Likely related people:
vincentkoc: Authored the shipped fix(gateway): expose restart drain controls commit and also worked on the bounded default restart deferral shortly before this report. (role: implemented restart drain controls; confidence: high; commits: f6f8d74419a1, 1f41b8b44ba0; files: src/cli/gateway-cli/run-loop.ts, src/cli/daemon-cli/lifecycle.ts, src/infra/restart.ts)
NikolaFC: Merged the explicit safe restart coordinator that complements the force/wait controls and keeps default restart behavior unchanged while offering an OpenClaw-aware path. (role: safe restart follow-up contributor; confidence: medium; commits: 103cdd9d96f8; files: src/infra/restart-coordinator.ts, src/cli/daemon-cli/lifecycle.ts, docs/cli/gateway.md)
steipete: Recent commit history on src/daemon/launchd.ts and restart-related files shows repeated macOS LaunchAgent restart and release-stabilization work around this timeframe. (role: recent launchd and lifecycle contributor; confidence: medium; commits: 1ace6a0d6a0d, 1f88cb2ce5dd, fa79e9754ecc; files: src/daemon/launchd.ts, src/cli/gateway-cli/run-loop.ts, src/infra/restart.ts)
clawyouseeme: Earlier history shows the active-turn drain was added to prevent message loss on restart, which is the behavior that made slow restarts possible before the later force/wait controls. (role: introduced active-turn restart drain behavior; confidence: medium; commits: acb9cbb89834; files: src/cli/gateway-cli/run-loop.ts, src/process/command-queue.ts)
Bridgerz: Earlier history broadened restart deferral to wait for queued operations, pending replies, and embedded runs before restart, which is adjacent to the reported delay mechanism. (role: introduced broader reply restart deferral; confidence: medium; commits: ab4a08a82acc; files: src/infra/restart.ts, src/cli/gateway-cli/run-loop.ts, src/gateway/server-reload-handlers.ts)
Codex review notes: model gpt-5.5, reasoning high; reviewed against bf16038b5c61; fix evidence: release v2026.5.3, commit f6f8d74419a1.
Activity
githubdulong commentedon Apr 28, 2026
补充一个同环境现象(同一台 macOS,v2026.4.26):
如果需要我可以再提供:
sktbrd commentedon Apr 28, 2026
same thing here
Vksh07 commentedon Apr 28, 2026
same issue
raydoomed commentedon Apr 28, 2026
一样的问题,从24版本就开始了,一直没修好
SecretGuestZ commentedon Apr 28, 2026
越升级越不行 哎 江河日下
现在启动慢 active memory也有问题 每次都要卡
HakuyaSakuragi commentedon Apr 28, 2026
same
yourfei commentedon Apr 28, 2026
目前2026.4.23用起来还不错,23后面的升级直接启动不了
xifengxx commentedon Apr 28, 2026
一样的问题,gateway重启卡死要几分钟才正常,然后Web/Lark/TG Channel里聊天响应速度很慢,之前是秒级响应,现在是分钟级响应了,体验起来非常差
joyous-coder commentedon Apr 28, 2026
啊,不是我一个人感觉变得特别卡。原来的版本结合MiniMax,回答的就很快,现在就各种卡。
jsompis commentedon Apr 28, 2026
same here all .24-.26 didn't work, rolled back to .23
harold-tsui commentedon Apr 28, 2026
卡就算了,进程杀一个又出来一个,这功能太神奇了
clawsweeper commentedon Apr 30, 2026
Thanks for the context here. I did a careful shell check against current
main, and this is already implemented.Current main has shipped the maintainer-approved restart drain controls that the earlier review said were missing: operators can now force an immediate managed restart, set a per-restart wait budget, use the safe coordinated restart path, and see active task blockers before the drain waits.
So I’m closing this as already implemented rather than keeping a duplicate issue open.
Review details
Best possible solution:
Keep the shipped restart controls and docs; if plain restart should change default semantics or Weixin/model startup remains slow, track that as a narrower follow-up with fresh logs on a current release.
Do we have a high-confidence way to reproduce the issue?
Yes for the historical mechanism: source and tests show managed restart can enter the active-work drain and wait up to the configured budget. I did not live-reproduce the exact macOS plus plugin timing from the report on current main.
Is this the best way to solve the issue?
Yes. The shipped solution preserves compatibility for plain service-manager restarts while adding explicit
--force,--wait,--safe, and--safe --skip-deferralpaths plus blocker logging, which is the maintainable policy split the earlier review requested.Security review:
Security review: Non-PR issue triage; no patch security or supply-chain review applies.
What I checked:
gateway restartnow accepts--forceto restart without waiting for active Gateway work and--wait <duration>to override the drain budget for one restart. (src/cli/daemon-cli/register-service-commands.ts:130, bf16038b5c61)--forceinto{ force: true }, parses--waitintowaitMs, and writes that intent before calling the service manager restart. (src/cli/daemon-cli/lifecycle.ts:129, bf16038b5c61)waitMsoverrides the drain timeout. (src/cli/gateway-cli/run-loop.ts:416, bf16038b5c61)src/cli/gateway-cli/run-loop.test.ts:382, bf16038b5c61)--safe,--safe --skip-deferral,--wait 30s, and--forceas the immediate override path when the operator wants the Gateway back now. Public docs:docs/cli/gateway.md. (docs/cli/gateway.md:117, bf16038b5c61)Likely related people:
fix(gateway): expose restart drain controlscommit and also worked on the bounded default restart deferral shortly before this report. (role: implemented restart drain controls; confidence: high; commits: f6f8d74419a1, 1f41b8b44ba0; files:src/cli/gateway-cli/run-loop.ts,src/cli/daemon-cli/lifecycle.ts,src/infra/restart.ts)src/infra/restart-coordinator.ts,src/cli/daemon-cli/lifecycle.ts,docs/cli/gateway.md)src/daemon/launchd.tsand restart-related files shows repeated macOS LaunchAgent restart and release-stabilization work around this timeframe. (role: recent launchd and lifecycle contributor; confidence: medium; commits: 1ace6a0d6a0d, 1f88cb2ce5dd, fa79e9754ecc; files:src/daemon/launchd.ts,src/cli/gateway-cli/run-loop.ts,src/infra/restart.ts)src/cli/gateway-cli/run-loop.ts,src/process/command-queue.ts)src/infra/restart.ts,src/cli/gateway-cli/run-loop.ts,src/gateway/server-reload-handlers.ts)Codex review notes: model gpt-5.5, reasoning high; reviewed against bf16038b5c61; fix evidence: release v2026.5.3, commit f6f8d74419a1.