Title
gateway status reports unknown / staleGatewayPids on localized Chinese Windows even when Scheduled Task Gateway is running
Summary
On a Chinese-localized Windows host, OpenClaw reports the managed Gateway runtime as unknown and marks the actual listener PID as staleGatewayPids, even though the Scheduled Task is installed and the Gateway is actively listening.
This appears to be caused by parsing localized schtasks /Query /V /FO LIST output using English field names.
Environment
- OS: Windows 11, Chinese locale
- OpenClaw:
2026.3.23-2
- Gateway install mode: Scheduled Task (
\\OpenClaw Gateway)
- Listener:
ws://127.0.0.1:18789
Observed behavior
openclaw gateway status --json / openclaw status --deep reports the Gateway service runtime as unknown
- health includes
staleGatewayPids
- but the Scheduled Task exists and the Gateway is actually alive / listening
- logs repeatedly show:
gateway already running under schtasks; waiting 5000ms before retrying startup
- heartbeat / listener startup activity
What was confirmed locally
- There was an old
gateway.cmd drift issue first (old wrapper script version), but that was repaired.
- After rebuilding the managed Gateway service with the current CLI, the Gateway process was still alive and listening correctly.
- The remaining dirty status persisted even after the wrapper drift was fixed.
- Dist code inspection suggests the Windows runtime parser expects English keys from
schtasks, including:
status
last run time
last run result
- On a Chinese-localized system,
schtasks output is localized, so those fields do not parse correctly.
- Because runtime status falls through to
unknown, the health logic then treats the real listener PID as stale.
Likely cause
parseSchtasksQuery() appears to read schtasks /Query /TN <task> /V /FO LIST using English key names only.
On localized Windows hosts, that breaks runtime-state detection, which then cascades into a misleading health result (staleGatewayPids).
Expected behavior
- Localized Windows should still report the Scheduled Task runtime as
running when the task is healthy.
- A healthy listener PID should not be marked stale solely because
schtasks output was localized.
Relevant code paths observed locally
dist/service-DdJ2Qk7P.js
parseSchtasksQuery()
readScheduledTaskRuntime()
dist/status-B6f3xZ42.js
- Windows fallback logic that can classify busy-port listeners as stale when
runtime.status !== "running"
Suggested fix
One of these would likely solve it:
- Stop relying only on localized
schtasks /FO LIST text parsing.
- Use a Windows-native structured source instead, e.g. PowerShell ScheduledTasks APIs:
Get-ScheduledTask
Get-ScheduledTaskInfo
- Or add locale-aware field mapping / structured parsing.
- Avoid the stale-PID fallback when the task is confirmed alive by an alternate Windows-native task API.
Extra note
A separate local noise source also existed: bad delivery-queue items targeting channel=feishu, to=heartbeat. Those were isolated locally, but they were not the root cause of the Scheduled Task runtime being reported as unknown.
Title
gateway statusreportsunknown/staleGatewayPidson localized Chinese Windows even when Scheduled Task Gateway is runningSummary
On a Chinese-localized Windows host, OpenClaw reports the managed Gateway runtime as
unknownand marks the actual listener PID asstaleGatewayPids, even though the Scheduled Task is installed and the Gateway is actively listening.This appears to be caused by parsing localized
schtasks /Query /V /FO LISToutput using English field names.Environment
2026.3.23-2\\OpenClaw Gateway)ws://127.0.0.1:18789Observed behavior
openclaw gateway status --json/openclaw status --deepreports the Gateway service runtime asunknownstaleGatewayPidsgateway already running under schtasks; waiting 5000ms before retrying startupWhat was confirmed locally
gateway.cmddrift issue first (old wrapper script version), but that was repaired.schtasks, including:statuslast run timelast run resultschtasksoutput is localized, so those fields do not parse correctly.unknown, the health logic then treats the real listener PID as stale.Likely cause
parseSchtasksQuery()appears to readschtasks /Query /TN <task> /V /FO LISTusing English key names only.On localized Windows hosts, that breaks runtime-state detection, which then cascades into a misleading health result (
staleGatewayPids).Expected behavior
runningwhen the task is healthy.schtasksoutput was localized.Relevant code paths observed locally
dist/service-DdJ2Qk7P.jsparseSchtasksQuery()readScheduledTaskRuntime()dist/status-B6f3xZ42.jsruntime.status !== "running"Suggested fix
One of these would likely solve it:
schtasks /FO LISTtext parsing.Get-ScheduledTaskGet-ScheduledTaskInfoExtra note
A separate local noise source also existed: bad delivery-queue items targeting
channel=feishu, to=heartbeat. Those were isolated locally, but they were not the root cause of the Scheduled Task runtime being reported asunknown.