Commit 9f4d01e
fix(gateway): fall back to PowerShell when wmic is unavailable on Windows
On modern Windows (11+), Microsoft has deprecated and removed wmic.exe.
This causes resolveWindowsCommandLine() to silently fail, returning no
command line for port listeners. The health check then only sees
"node.exe" (the image name), which classifyPortListener() cannot
identify as a gateway process — it requires "openclaw" in the command
string. This results in ownsPort=false → healthy=false, and the restart
health check loops for 60s before timing out, even though the gateway
restarted successfully.
Fix: when wmic fails (non-zero exit or no output), fall back to
PowerShell Get-CimInstance Win32_Process to retrieve the full command
line. This restores correct process classification on wmic-less systems.
Related: #32620 (same class of bug on Linux when lsof is missing)
Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>1 parent 43a1067 commit 9f4d01e
1 file changed
+29
-10
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
248 | 248 | | |
249 | 249 | | |
250 | 250 | | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
251 | 267 | | |
| 268 | + | |
252 | 269 | | |
253 | 270 | | |
254 | 271 | | |
| |||
258 | 275 | | |
259 | 276 | | |
260 | 277 | | |
261 | | - | |
262 | | - | |
263 | | - | |
264 | | - | |
265 | | - | |
266 | | - | |
267 | | - | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
268 | 288 | | |
269 | | - | |
270 | | - | |
271 | 289 | | |
272 | | - | |
| 290 | + | |
| 291 | + | |
273 | 292 | | |
274 | 293 | | |
275 | 294 | | |
| |||
0 commit comments