-
-
Notifications
You must be signed in to change notification settings - Fork 69.2k
[Bug]: Windows: Runtime: unknown due to schtasks key mismatch #47726
Description
Bug type
Regression (worked before, now fails)
Summary
Issue Title
Windows: Runtime: unknown due to schtasks key mismatch ("Last Result" vs "Last Run Result")
Description
On Windows, openclaw gateway status shows Runtime: unknown even when the gateway is actually running correctly (RPC probe: ok).
Root Cause
In src/daemon/service.ts, the parseSchtasksQuery function expects the key last run result:
const lastRunResult = entries["last run result"];However, actual schtasks /Query /V /FO LIST output on Windows uses Last Result (without "Run"):
Last Run Time: 2026/3/16 8:34:15
Last Result: 267009
Status: Running
This causes parsed.lastRunResult to be undefined, which leads to normalizeTaskResultCode(undefined) returning null, and finally deriveScheduledTaskRuntimeStatus returning { status: "unknown" }.
Environment
- OS: Windows 10/11
- OpenClaw version: v2026.3.8
- Node.js: v24.14.0
Steps to Reproduce
- Install OpenClaw gateway as Windows Scheduled Task
- Start the gateway:
openclaw gateway start - Check status:
openclaw gateway status - Observe
Runtime: unknowndespiteRPC probe: ok
Suggested Fix
Update parseSchtasksQuery to also check for last result (without "run") as a fallback:
const lastRunResult = entries["last run result"] ?? entries["last result"];Steps to reproduce
Issue Title
Windows: Runtime: unknown due to schtasks key mismatch ("Last Result" vs "Last Run Result")
Description
On Windows, openclaw gateway status shows Runtime: unknown even when the gateway is actually running correctly (RPC probe: ok).
Root Cause
In src/daemon/service.ts, the parseSchtasksQuery function expects the key last run result:
const lastRunResult = entries["last run result"];However, actual schtasks /Query /V /FO LIST output on Windows uses Last Result (without "Run"):
Last Run Time: 2026/3/16 8:34:15
Last Result: 267009
Status: Running
This causes parsed.lastRunResult to be undefined, which leads to normalizeTaskResultCode(undefined) returning null, and finally deriveScheduledTaskRuntimeStatus returning { status: "unknown" }.
Environment
- OS: Windows 10/11
- OpenClaw version: v2026.3.8
- Node.js: v24.14.0
Steps to Reproduce
- Install OpenClaw gateway as Windows Scheduled Task
- Start the gateway:
openclaw gateway start - Check status:
openclaw gateway status - Observe
Runtime: unknowndespiteRPC probe: ok
Suggested Fix
Update parseSchtasksQuery to also check for last result (without "run") as a fallback:
const lastRunResult = entries["last run result"] ?? entries["last result"];Expected behavior
Issue Title
Windows: Runtime: unknown due to schtasks key mismatch ("Last Result" vs "Last Run Result")
Description
On Windows, openclaw gateway status shows Runtime: unknown even when the gateway is actually running correctly (RPC probe: ok).
Root Cause
In src/daemon/service.ts, the parseSchtasksQuery function expects the key last run result:
const lastRunResult = entries["last run result"];However, actual schtasks /Query /V /FO LIST output on Windows uses Last Result (without "Run"):
Last Run Time: 2026/3/16 8:34:15
Last Result: 267009
Status: Running
This causes parsed.lastRunResult to be undefined, which leads to normalizeTaskResultCode(undefined) returning null, and finally deriveScheduledTaskRuntimeStatus returning { status: "unknown" }.
Environment
- OS: Windows 10/11
- OpenClaw version: v2026.3.8
- Node.js: v24.14.0
Steps to Reproduce
- Install OpenClaw gateway as Windows Scheduled Task
- Start the gateway:
openclaw gateway start - Check status:
openclaw gateway status - Observe
Runtime: unknowndespiteRPC probe: ok
Suggested Fix
Update parseSchtasksQuery to also check for last result (without "run") as a fallback:
const lastRunResult = entries["last run result"] ?? entries["last result"];Actual behavior
Issue Title
Windows: Runtime: unknown due to schtasks key mismatch ("Last Result" vs "Last Run Result")
Description
On Windows, openclaw gateway status shows Runtime: unknown even when the gateway is actually running correctly (RPC probe: ok).
Root Cause
In src/daemon/service.ts, the parseSchtasksQuery function expects the key last run result:
const lastRunResult = entries["last run result"];However, actual schtasks /Query /V /FO LIST output on Windows uses Last Result (without "Run"):
Last Run Time: 2026/3/16 8:34:15
Last Result: 267009
Status: Running
This causes parsed.lastRunResult to be undefined, which leads to normalizeTaskResultCode(undefined) returning null, and finally deriveScheduledTaskRuntimeStatus returning { status: "unknown" }.
Environment
- OS: Windows 10/11
- OpenClaw version: v2026.3.8
- Node.js: v24.14.0
Steps to Reproduce
- Install OpenClaw gateway as Windows Scheduled Task
- Start the gateway:
openclaw gateway start - Check status:
openclaw gateway status - Observe
Runtime: unknowndespiteRPC probe: ok
Suggested Fix
Update parseSchtasksQuery to also check for last result (without "run") as a fallback:
const lastRunResult = entries["last run result"] ?? entries["last result"];OpenClaw version
2026.3.8
Operating system
Windows 11
Install method
No response
Model
KImi2.5
Provider / routing chain
Kimi2.5
Config file / key location
No response
Additional provider/model setup details
No response
Logs, screenshots, and evidence
Impact and severity
No response
Additional information
No response