-
-
Notifications
You must be signed in to change notification settings - Fork 80.7k
Gateway self-restart on Windows fails silently when schtasks /Run cannot relaunch the scheduled task #90158
Copy link
Copy link
Open
Labels
P1High-priority user-facing bug, regression, or broken workflow.High-priority user-facing bug, regression, or broken workflow.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.ClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.impact:crash-loopCrash, hang, restart loop, or process-level availability failure.Crash, hang, restart loop, or process-level availability failure.impact:message-lossChannel message delivery can be lost, duplicated, or misrouted.Channel message delivery can be lost, duplicated, or misrouted.impact:session-stateSession, memory, transcript, context, or agent state can drift or corrupt.Session, memory, transcript, context, or agent state can drift or corrupt.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.
Description
Metadata
Metadata
Assignees
Labels
P1High-priority user-facing bug, regression, or broken workflow.High-priority user-facing bug, regression, or broken workflow.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.ClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.impact:crash-loopCrash, hang, restart loop, or process-level availability failure.Crash, hang, restart loop, or process-level availability failure.impact:message-lossChannel message delivery can be lost, duplicated, or misrouted.Channel message delivery can be lost, duplicated, or misrouted.impact:session-stateSession, memory, transcript, context, or agent state can drift or corrupt.Session, memory, transcript, context, or agent state can drift or corrupt.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.
Type
Fields
Priority
None yet
What happens
When the gateway tries to self-restart on Windows (e.g. after
openclaw config patch, or via the dashboard's restart action), the underlyingschtasks /Runcall fails. The running gateway terminates (WS close1006) and there's no graceful re-launch — the dashboard disconnects, in-flight tool/agent responses are dropped, and the gateway only comes back when something else (manualopenclaw gateway, retry, a fresh config-load cycle) revives it. In my case it recovered roughly 1m20s later via what looked like a freshloading configuration…cycle, but the gap caused visible mid-turn failures in an attached agent session.Reproduction
2026.5.28, gateway installed viaopenclaw gateway install(Scheduled Task registered under the user account, non-elevated).openclaw config patch --stdinwith a TelegramallowFromchange. CLI confirms "Applied N config update(s). Restart the gateway to apply."gatewayMCP/RPC restart method, or whatever the CLI/UI exposes for this).What the log shows
```
2026-06-04T00:08:46.139-04:00 error gateway connect failed: Error: gateway closed (1006):
2026-06-04T00:08:46.158-04:00 error gateway connect failed: Error: gateway closed (1006):
2026-06-04T00:08:46.207-04:00 error Gateway restart failed: Error: schtasks run failed:
2026-06-04T00:08:46.228-04:00 info Tip: openclaw gateway install
2026-06-04T00:08:46.232-04:00 info Tip: openclaw gateway
2026-06-04T00:08:46.235-04:00 info Tip: schtasks /Run /TN "OpenClaw Gateway"
2026-06-04T00:10:03.922-04:00 info gateway loading configuration…
```
A few things stand out:
schtasks run failed:is empty. The underlyingschtasksstderr (access denied, task already running, locked, etc.) is not surfaced, which makes self-diagnosis hard.openclaw statusimmediately after recovery reports: "Gateway service: Scheduled Task installed · registered · running (pid 46848, state Ready, Verified gateway listener detected on port 18789 even though schtasks did not report a running task.)" — that half-state where the listener is verified on port butschtaskssays not-running is its own oddity worth investigating.Asks
Gateway restart failed: Error: schtasks run failed:log line so users can self-diagnose (access denied vs. task already running vs. locked vs. something else).schtasks /Runfails, fall back to an in-process restart (or spawn the gateway directly) so a standard non-elevated install survivesconfig.patch-driven restarts without dropping all sessions.schtasksreports "not running,"openclaw statusand the restart path should agree on a canonical truth (probably "if the verified listener is alive, the gateway is up regardless of schtasks").Environment
OpenClaw Gateway(default), installed under the current user