-
-
Notifications
You must be signed in to change notification settings - Fork 80.7k
[Bug]: Windows Scheduled Task gateway restart/health becomes inconsistent after ready #63491
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:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.ClawSweeper found a clear likely implementation shape for this issue.clawsweeper:needs-live-reproClawSweeper needs live local, crabbox, or manual validation to confirm this issue.ClawSweeper needs live local, crabbox, or manual validation to confirm this issue.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.impact:crash-loopCrash, hang, restart loop, or process-level availability failure.Crash, hang, restart loop, or process-level availability failure.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: 🐚 platinum hermitGood issue quality with a plausible reproduction path needing some confirmation.Good issue quality with a plausible reproduction path needing some confirmation.maturity:stableIssue affects a taxonomy feature currently scored M4/M5.Issue affects a taxonomy feature currently scored M4/M5.
Description
Metadata
Metadata
Assignees
Labels
P1High-priority user-facing bug, regression, or broken workflow.High-priority user-facing bug, regression, or broken workflow.clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.ClawSweeper found a clear likely implementation shape for this issue.clawsweeper:needs-live-reproClawSweeper needs live local, crabbox, or manual validation to confirm this issue.ClawSweeper needs live local, crabbox, or manual validation to confirm this issue.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.impact:crash-loopCrash, hang, restart loop, or process-level availability failure.Crash, hang, restart loop, or process-level availability failure.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: 🐚 platinum hermitGood issue quality with a plausible reproduction path needing some confirmation.Good issue quality with a plausible reproduction path needing some confirmation.maturity:stableIssue affects a taxonomy feature currently scored M4/M5.Issue affects a taxonomy feature currently scored M4/M5.
Type
Fields
Priority
None yet
[Bug]: Windows Scheduled Task gateway restart/health becomes inconsistent after ready; mixes known probe false negatives with cron/session stale state and post-ready HTTP loss
Bug type
Regression (worked before, now fails)
Beta release blocker
No
Summary
On Windows with the gateway installed as a Scheduled Task,
openclaw gateway restartcan repeatedly time out with:Timed out after 60s waiting for gateway port 18789 to become healthyService runtime: status=unknownPort 18789 is already in useThis environment appears to hit more than one problem at once:
ws ... code=1008 reason=connect failed/device-required)runningAtMs/ stale cron session state)readyinstability where the gateway can logready (...)and even bind18789, but/healthand/later stop responding or the port becomes free againI am filing this because the first two have close neighbors in existing issues/PRs, but I have not found a single Windows issue that covers the full combined behavior end-to-end.
OpenClaw version
OpenClaw 2026.4.8 (
9ece252)Operating system
Windows (PowerShell 5.1.22621.4249)
Install method
npm global install +
openclaw gateway install/ Scheduled TaskModel
bailian/qwen3.5-plusProvider / routing chain
Ali / Bailian
Additional provider/model setup details
v22.22.22026.4.5to2026.4.8Steps to reproduce
~/.openclaw/cron/jobs.jsonopenclaw gateway restartSequence A:
1008/connect failedSequence B:
starting HTTP server...ready (... plugins, ...s)cron: startedhttp://127.0.0.1:18789/healthand/later time out or the port becomes free againSequence C:
TypeError: Cannot read properties of undefined (reading 'runningAtMs')runningAtMs/ stale cron session state prevented clean recovery without manual interventionExpected behavior
openclaw gateway restartshould succeed when the restarted local gateway is already healthy enough to reject unauthenticated loopback probesready (...),/healthand/should remain responsive instead of later hanging or disappearingActual behavior
Observed across repeated runs on 2026-04-08 and 2026-04-09:
openclaw gateway restarttimes out after 60scode=1008 reason=connect failedcause":"device-required"18789is reported busy while runtime status isunknownready (...)and later port18789becomes free again/healthis briefly reachable, then later times outrunningAtMs-related stateRepresentative log lines:
Related issues / likely overlap
#48771and PR#48801: Windows/local restart false negative when loopback WS probe is closed with1008/connect failed/device required#44920: stale cronrunningAtMsafter restart#59511: localhttp://127.0.0.1:18789/healthnot usable after gateway run#60295: different OS, but similar “restart times out while service state/port ownership is inconsistent”What I found during local debugging
I did substantial local debugging because the machine was stuck in production use:
2026.4.5to2026.4.822.22.2ready (...)I also locally patched the CLI to treat loopback HTTP
/healthand local1008policy closes as healthy enough for restart probing, which reduced one class of false negatives, but did not eliminate the post-readyinstability.That suggests there may still be a deeper Windows gateway/runtime bug after startup, beyond the already-known restart probe issue.
Impact and severity
High for Windows users relying on Scheduled Task mode:
Logs, screenshots, and evidence
I can provide:
openclaw-2026-04-08.log/openclaw-2026-04-09.logopenclaw gateway restartterminal outputopenclaw gateway status --jsonoutput from both healthy and unhealthy moments~/.openclaw/cron/jobs.jsonand session index cleanupAdditional information
If helpful, I can also open a follow-up issue with a narrower repro focused only on:
runningAtMs/ session state after restartreadyHTTP hang / port disappearancebecause on this machine they appeared stacked together.