Skip to content

doctor/status: false positive 'Other gateway-like services detected' for active Windows Scheduled Task #90494

@Darnellicious

Description

@Darnellicious

Bug Description

The dashboard / openclaw status "Other gateway-like services detected" check produces a false positive on Windows: it flags the Scheduled Task that launched the currently running gateway as if it were a separate, duplicate service. The suggested cleanup hint (schtasks /Delete /TN "OpenClaw Gateway" /F) would, if followed, remove the user's auto-start on logon mechanism — which is exactly what the recommended Windows install creates.

This is the Windows analogue of #52510 (which covered the macOS LaunchAgent variant of the same false-positive class).

Steps to Reproduce

  1. Install OpenClaw on Windows with the standard Scheduled Task setup (task name \OpenClaw Gateway, runs C:\Users\<user>\.openclaw\gateway.cmd at logon — what the doctor's --fix flow installs, when it works).
  2. Log in and let the scheduled task start the gateway as normal.
  3. Open the dashboard status panel (or run the equivalent status query). Observe output similar to:
Runtime: running (last run 267009, last run time 6/4/2026 8:43:47 PM)
Connectivity probe: ok
Capability: admin-capable

Listening: 0.0.0.0:18789
Other gateway-like services detected (best effort):
- \OpenClaw Gateway (system, task: \OpenClaw Gateway, run: C:\Users\dlmcm\.openclaw\gateway.cmd)
Cleanup hint: schtasks /Delete /TN "OpenClaw Gateway" /F
  1. The "detected" task is the same task that launched the running gateway process (pid currently listening on :18789). Confirm via:
schtasks /Query /TN "OpenClaw Gateway" /V /FO LIST

The task's status will read Running, with a Last Run Time matching the gateway start, and Task To Run pointing at the install's gateway.cmd.

Expected Behavior

The detector should correlate the listed Scheduled Task with the currently running gateway process. If the task's command line / executed script matches the parent process of the listening gateway (or matches the canonical install's gateway.cmd path), it should be treated as the live launcher, not as a separate gateway-like service. No "Other gateway-like services detected" warning, and no schtasks /Delete cleanup hint, when the task is the active launcher.

The cleanup hint should only surface for genuinely orphaned tasks — e.g.:

  • A task whose Task To Run points to a stale path (different user profile, removed install, etc.)
  • A task that is Disabled or Ready but whose target no longer exists
  • A task pointing at a different gateway port / install root than the running gateway

Actual Behavior

The detector lists the task that launched the live gateway as "another gateway-like thing," and recommends deleting it. A user who follows the hint will:

  1. Silently lose auto-start on next logon.
  2. Be left with a gateway that only runs in the current login session (and won't be brought back by the documented Windows install path).
  3. Conflate this with the cluster of related Windows gateway start/install issues already on the tracker ([Bug]: Windows doctor update leaves Startup-folder gateway fallback stale and does not install Scheduled Task #87156, Gateway self-restart on Windows fails silently when schtasks /Run cannot relaunch the scheduled task #90158).

Suggested Fix

In the Windows detection path, before listing a task:

  • Resolve the task's Task To Run (with environment expansion) to an absolute script path.
  • Compare against the install's known gateway.cmd path and/or walk up from the running gateway PID to confirm whether the task is its launcher (via parent process or PPID chain — cmd.exegateway.cmd → gateway process).
  • If correlated, skip the entry (or downgrade to an info line: Active launcher: \OpenClaw Gateway (scheduled task)), and suppress the schtasks /Delete cleanup hint.

A minimal, lower-risk version: simply suppress the hint (but still log the task as info) when the task's command line resolves to the canonical install's gateway.cmd and the gateway is currently running per the runtime probe.

Environment

  • OpenClaw: 2026.5.28 (e932160)
  • OS: Windows 10.0.26200 (arm64), mcwindev
  • Gateway: running, pid 47220, listening 0.0.0.0:18789, bind=lan
  • Scheduled Task: \OpenClaw Gateway, At-logon, runs C:\Users\dlmcm\.openclaw\gateway.cmd, Status: Running, Last Run Time 6/4/2026 8:43:47 PM

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Normal backlog priority with limited blast radius.clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.clawsweeper:queueable-fixClawSweeper marked this issue as an existing queue_fix_pr work candidate.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.impact:crash-loopCrash, hang, restart loop, or process-level availability failure.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.

    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