Bug: gateway stop doesn't terminate the node.exe process on Windows
Summary
openclaw gateway stop reports "Stopped Scheduled Task: OpenClaw Gateway" but the actual node.exe gateway process continues running. The gateway remains accessible on port 18789 after stop.
Root Cause
The "OpenClaw Gateway" scheduled task runs gateway.cmd, which in turn launches node.exe:
gateway.cmd → node.exe ... gateway --port 18789
openclaw gateway stop calls schtasks /End /TN "OpenClaw Gateway", which terminates gateway.cmd (the parent batch script) but does not kill the child node.exe process. The node process is detached/orphaned and keeps running.
Reproduction
# Start gateway
openclaw gateway start
# Confirm it's running
Get-NetTCPConnection -LocalPort 18789 -State Listen
# → Shows node.exe PID
# Stop gateway
openclaw gateway stop
# → "Stopped Scheduled Task: OpenClaw Gateway"
# Check again — node.exe is still running
Get-NetTCPConnection -LocalPort 18789 -State Listen
# → STILL shows node.exe PID (same PID as before)
# Gateway still responds
Invoke-WebRequest -Uri "http://127.0.0.1:18789/" -UseBasicParsing
# → 200 OK
Expected Behavior
openclaw gateway stop should fully terminate the gateway process, not just the parent batch script. After stop, port 18789 should be free and the node.exe process should be gone.
Suggested Fix
Either:
- Use
taskkill /T /PID <pid> (with /T for tree kill) to terminate the entire process tree, OR
- Send a graceful shutdown signal to node.exe directly (e.g., via the HTTP endpoint) before calling
schtasks /End, OR
- Have
gateway.cmd use start /wait so schtasks /End kills the whole tree
Workaround
Use taskkill /F /IM node.exe to force-kill the gateway, then openclaw gateway start.
Impact
Environment
- OpenClaw v2026.3.8
- Windows 10 (build 26200)
- Node.js v24.14.0
- Gateway managed via "OpenClaw Gateway" scheduled task
- Task action:
C:\Users\Dell\.openclaw\gateway.cmd
Bug:
gateway stopdoesn't terminate the node.exe process on WindowsSummary
openclaw gateway stopreports "Stopped Scheduled Task: OpenClaw Gateway" but the actualnode.exegateway process continues running. The gateway remains accessible on port 18789 afterstop.Root Cause
The "OpenClaw Gateway" scheduled task runs
gateway.cmd, which in turn launchesnode.exe:openclaw gateway stopcallsschtasks /End /TN "OpenClaw Gateway", which terminatesgateway.cmd(the parent batch script) but does not kill the childnode.exeprocess. The node process is detached/orphaned and keeps running.Reproduction
Expected Behavior
openclaw gateway stopshould fully terminate the gateway process, not just the parent batch script. Afterstop, port 18789 should be free and the node.exe process should be gone.Suggested Fix
Either:
taskkill /T /PID <pid>(with/Tfor tree kill) to terminate the entire process tree, ORschtasks /End, ORgateway.cmdusestart /waitsoschtasks /Endkills the whole treeWorkaround
Use
taskkill /F /IM node.exeto force-kill the gateway, thenopenclaw gateway start.Impact
openclaw gateway stopfollowed byopenclaw gateway startcreates a port conflict (old process still holds 18789)gateway restart(Bug: gateway restart spawns duplicate processes on Windows (3 windows) #52044) — the "stopped" process is still alive when the new one startsEnvironment
C:\Users\Dell\.openclaw\gateway.cmd