Skip to content

[Bug]: Windows: Runtime: unknown due to schtasks key mismatch #47726

@wu831522-sys

Description

@wu831522-sys

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

  1. Install OpenClaw gateway as Windows Scheduled Task
  2. Start the gateway: openclaw gateway start
  3. Check status: openclaw gateway status
  4. Observe Runtime: unknown despite RPC 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

  1. Install OpenClaw gateway as Windows Scheduled Task
  2. Start the gateway: openclaw gateway start
  3. Check status: openclaw gateway status
  4. Observe Runtime: unknown despite RPC 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

  1. Install OpenClaw gateway as Windows Scheduled Task
  2. Start the gateway: openclaw gateway start
  3. Check status: openclaw gateway status
  4. Observe Runtime: unknown despite RPC 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

  1. Install OpenClaw gateway as Windows Scheduled Task
  2. Start the gateway: openclaw gateway start
  3. Check status: openclaw gateway status
  4. Observe Runtime: unknown despite RPC 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingregressionBehavior that previously worked and now fails

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions