Skip to content

[Windows] ollama launch openclaw starts duplicate gateway when Scheduled Task is already running #151

@friendfish

Description

@friendfish

Environment

  • OS: Windows 11
  • OpenClaw: 2026.4.1
  • Gateway mode: Scheduled Task

Description

On Windows, running ollama launch openclaw when the OpenClaw Gateway is already running as a Scheduled Task (Session 0) creates a second node.exe process that also binds to port 18789, instead of detecting the existing gateway and restarting it.

Root Cause

The Ollama launch integration's gateway detection doesn't recognize the existing Scheduled Task process running in Session 0. Because user-session processes can't see Session 0 processes via standard process enumeration, ollama launch openclaw believes no gateway is running and starts a new one.

Symptoms

  • Bonjour mDNS name conflict: gateway renamed to DESKTOP-xxx (OpenClaw) (2)
  • RPC probe: failed in openclaw gateway status
  • EPERM errors writing to ~/.openclaw/devices/pending.json (two processes competing for the same file)
  • Mass handshake timeout / gateway closed (1006) errors in logs
  • gateway.cmd path mismatch if OpenClaw was previously installed via Ollama with a different nvm path

Steps to Reproduce

  1. Install OpenClaw on Windows, configure gateway as Scheduled Task (openclaw gateway install)
  2. Confirm gateway is running: openclaw gateway statusRPC probe: ok
  3. Run ollama launch openclaw
  4. Check: netstat -ano | findstr 18789 — two LISTENING entries on same port

Expected Behavior

ollama launch openclaw should detect the existing gateway (by checking port 18789 or the Scheduled Task state) and either skip gateway startup or gracefully replace the existing process.

Workaround

Use ollama launch openclaw --config to change model without touching the gateway.

If a duplicate process has already occurred:

# Run as Administrator
Stop-Process -Id <duplicate_PID> -Force
openclaw gateway start

Metadata

Metadata

Assignees

No one assigned

    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