-
-
Notifications
You must be signed in to change notification settings - Fork 69.5k
openclaw_supervisor.ps1: unquoted paths break on Windows usernames with spaces #47484
Copy link
Copy link
Open
Description
Bug
The auto-generated openclaw_supervisor.ps1 passes .cmd file paths to cmd.exe /c without quoting them. On any Windows machine where %USERPROFILE% contains a space (e.g. C:\Users\John Smith), the supervisor cannot restart the gateway or node host after a crash.
Reproduction
- Install OpenClaw on Windows with a username containing a space (e.g. "John Smith")
- Let the gateway or node host crash (or kill the process)
- The supervisor fails to restart either service
Error in logs/node.err.log and logs/gateway.err.log:
'C:\Users\John' is not recognized as an internal or external command,
operable program or batch file.
Root cause
In openclaw_supervisor.ps1, the Start-Process calls pass the .cmd path unquoted:
# Line ~118
$startGateway = {
Start-Process -FilePath "cmd.exe" `
-ArgumentList @("/c", $gatewayCmd) ` # <-- $gatewayCmd is NOT quoted
...
}
# Line ~127
$startNode = {
Start-Process -FilePath "cmd.exe" `
-ArgumentList @("/c", $nodeCmd) ` # <-- $nodeCmd is NOT quoted
...
}When $gatewayCmd resolves to C:\Users\John Smith\.openclaw\gateway.cmd, cmd.exe interprets C:\Users\John as the command and Smith\.openclaw\gateway.cmd as an argument.
Fix
Wrap the path in escaped double quotes:
-ArgumentList @("/c", "`"$gatewayCmd`"")
-ArgumentList @("/c", "`"$nodeCmd`"")Impact
- The scheduled tasks ("OpenClaw Gateway" / "OpenClaw Node") work fine at logon because their
Task To Runpaths are quoted - The supervisor is the only recovery mechanism for mid-session crashes, so this bug means any crash is permanent until the next logon
- Affects any Windows user with a space in their username (very common)
Environment
- Windows 11 Pro
- OpenClaw 2026.3.13
- Node.js v22.16.0
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
Type
Fields
Give feedbackNo fields configured for issues without a type.