Skip to content

[Windows] scheduled task watchdog: repetition Duration=P1D expires after 1 day, loses auto-restart #81020

Description

@Ccccc-del

Problem

onboard --install-daemon on Windows registers a scheduled task (OpenClaw Gateway) with a LogonTrigger whose repetition Duration is set to P1D (1 day). Since the task's StartBoundary is the installation date, the repetition expires after 24 hours. After that:

  • The task still fires once at user logon (the LogonTrigger itself)
  • But the 3-minute repeat interval stops
  • If the gateway crashes on day 2+, there is no automatic restart

Reproduction

  1. Run openclaw onboard --install-daemon on Windows
  2. Gateway crashes 2+ days later
  3. It stays dead — the scheduled task's NextRunTime is empty

Root cause

P1D repetition duration is relative to the task's StartBoundary, not a rolling window. After 1 day, the repetition is exhausted.

Suggested fix

Change the repetition Duration to an effectively infinite value like P9999D (~27 years) so the watchdog survives the lifetime of the installation.

Alternatively, use a separate watchdog task with a -Once trigger + repetition (what we ended up deploying manually) because:

  • LogonTrigger repetition doesn't kick in if the user is already logged in when the task is modified
  • A dedicated watchdog task is cleaner to manage

Workaround we deployed

A standalone OpenClaw Watchdog task that:

  • Runs a check script via wscript.exe (no console flash)
  • Checks every 3 minutes if port 18789 is listening
  • If not, starts gateway.cmd
  • Uses IgnoreNew to skip when gateway is already running

Environment

  • OpenClaw 2026.5.7 (eeef486)
  • Windows 11 Pro 10.0.26200

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions