Skip to content

Gateway restart/stop commands fail on Windows, causing connection loss #48756

@lhcdims

Description

@lhcdims

Bug type

Regression (worked before, now fails)

Summary

On Windows 11, openclaw gateway stop/start/restart commands fail to restart Gateway properly, causing the agent to lose connection with the user.

Steps to reproduce

  1. Run openclaw gateway stop in PowerShell
  2. Run openclaw gateway start in PowerShell
  3. Observe: Gateway fails to start, shows "gateway already running" error

Expected behavior

Gateway should stop and start reliably without requiring multiple attempts.

Actual behavior

Gateway fails to start with "gateway already running" error. User has to run start multiple times. If user is not at computer, they lose connection to the agent.

OpenClaw version

2026.3.13

Operating system

Windows 11

Install method

No response

Model

minimax-portal/MiniMax-M2.5

Provider / routing chain

minimax

Config file / key location

No response

Additional provider/model setup details

No response

Logs, screenshots, and evidence

Impact and severity

No response

Additional information

Workaround (Verified Working)

Instead of using openclaw gateway stop/start/restart, use a Windows Scheduled Task:

Step 1: Create PowerShell script

Save as C:\Users\lichiukenneth\.openclaw\restart-gateway.ps1:

$ErrorActionPreference = 'SilentlyContinue'
Write-Host "Stopping OpenClaw Gateway..."
Get-Process -Name node | Where-Object { 
    (Get-CimInstance Win32_Process -Filter "ProcessId = $($_.Id)").CommandLine -match 'openclaw.*gateway' 
} | Stop-Process -Force
Start-Sleep -Seconds 5
Write-Host "Starting OpenClaw Gateway..."
Start-Process "C:\Users\lichiukenneth\.openclaw\gateway.cmd"

Step 2: Create Scheduled Task

schtasks /create /tn "OpenClaw Restart PS" /tr "powershell.exe -ExecutionPolicy Bypass -File C:\Users\lichiukenneth\.openclaw\restart-gateway.ps1" /sc once /st 00:00 /f

Step 3: To restart Gateway, use:

schtasks /run /tn "OpenClaw Restart PS"

Important: Never use openclaw gateway restart! If it fails, you will lose connection with your human!

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