When running openclaw update on Windows, a visible CMD window with the title findstr /R /C:":18789 .*LISTENING" appears and often fails to close automatically, hanging indefinitely. This occurs during the service restart phase of the update process.
Root Cause Analysis
The issue stems from the temporary batch script generated by the update-cli subsystem (specifically in dist/update-cli-*.js and prepareRestartScript function).
- Sub-process Visibility: While the parent
cmd.exe is spawned with windowsHide: true, the sub-processes invoked inside the .bat file (like for /f ... in ('findstr ...')) do not inherit this flag and spawn new visible console windows on some Windows configurations.
- Hanging Logic: The polling loop in the generated
.bat file can enter a race condition or hang if netstat or findstr encounters a pipe error, causing the visible window to persist.
Environment
- OS: Windows (win32)
- OpenClaw Version: 2026.3.28 (and likely earlier versions)
- Node.js Version: 20.x+
Reproduction Steps
- Run
openclaw update on a Windows machine where the Gateway service is already running.
- Observe the update process reaching the "Restarting service..." step.
- A black CMD window titled
findstr ... will pop up and stay on the desktop.
Expected Behavior
The restart process should be entirely silent and backgrounded without spawning any visible console windows.
Proposed Fixes
- Use PowerShell for Windows: Replace the temporary
.bat file with a .ps1 script using native commands like Get-NetTCPConnection, which are more stable and easier to run hidden.
- Creation Flags: In
runRestartScript, use the CREATE_NO_WINDOW (0x08000000) flag in spawn options to ensure the entire process tree is hidden.
- Refactor Polling: Implement the port-wait logic directly in Node.js before spawning the detached restart process to minimize complexity in the shell script.
Temporary Workaround for Users
Run update with --no-restart: openclaw update --no-restart and then manually restart the gateway.
When running openclaw update on Windows, a visible CMD window with the title
findstr /R /C:":18789 .*LISTENING"appears and often fails to close automatically, hanging indefinitely. This occurs during the service restart phase of the update process.Root Cause Analysis
The issue stems from the temporary batch script generated by the update-cli subsystem (specifically in
dist/update-cli-*.jsandprepareRestartScriptfunction).cmd.exeis spawned withwindowsHide: true, the sub-processes invoked inside the.batfile (likefor /f ... in ('findstr ...')) do not inherit this flag and spawn new visible console windows on some Windows configurations..batfile can enter a race condition or hang if netstat or findstr encounters a pipe error, causing the visible window to persist.Environment
Reproduction Steps
openclaw updateon a Windows machine where the Gateway service is already running.findstr ...will pop up and stay on the desktop.Expected Behavior
The restart process should be entirely silent and backgrounded without spawning any visible console windows.
Proposed Fixes
.batfile with a.ps1script using native commands likeGet-NetTCPConnection, which are more stable and easier to run hidden.runRestartScript, use theCREATE_NO_WINDOW(0x08000000) flag in spawn options to ensure the entire process tree is hidden.Temporary Workaround for Users
Run update with
--no-restart:openclaw update --no-restartand then manually restart the gateway.