fix(windows): remove findstr from restart probe#101366
Conversation
Co-authored-by: Deepak Jain <[email protected]>
|
Codex review: needs real behavior proof before merge. Reviewed July 7, 2026, 1:18 AM ET / 05:18 UTC. Summary PR surface: Source +2, Tests +2, Docs +1. Total +5 across 3 files. Reproducibility: yes. source-reproducible: current main still generates the exact PowerShell-to-findstr helper line reported, and the Windows restart path reaches that helper. I did not run a live Windows Task Scheduler repro in this read-only review. Review metrics: 1 noteworthy metric.
Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Proof guidance:
Risk before merge
Maintainer options:
Next step before merge
Maintainer decision needed
Security Review findings
Review detailsBest possible solution: Merge the source/test fix without the CHANGELOG.md change after exact-head Windows proof shows no cmd/findstr window, correct Running detection, and a successful Gateway restart. Do we have a high-confidence way to reproduce the issue? Yes, source-reproducible: current main still generates the exact PowerShell-to-findstr helper line reported, and the Windows restart path reaches that helper. I did not run a live Windows Task Scheduler repro in this read-only review. Is this the best way to solve the issue? Yes for the runtime fix: moving the Running check into PowerShell exit codes is the narrowest maintainable way to remove findstr while preserving retry, cleanup, and fallback shape. The PR should still drop the release-owned changelog edit and add native Windows proof before merge. Full review comments:
Overall correctness: patch is correct AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 6192b037bbb5. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Source +2, Tests +2, Docs +1. Total +5 across 3 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
|
|
Land-ready maintainer proof for final head
The fix is a direct PowerShell task-state exit code. It removes Proof gap: a direct Ready/Running Task Scheduler scenario was attempted twice on fresh AWS Windows Crabbox lease |
|
Merged via squash.
|
* fix(windows): remove findstr from restart probe Co-authored-by: Deepak Jain <[email protected]> * docs(changelog): note Windows restart probe fix * docs(changelog): defer release note --------- Co-authored-by: Deepak Jain <[email protected]>
* fix(windows): remove findstr from restart probe Co-authored-by: Deepak Jain <[email protected]> * docs(changelog): note Windows restart probe fix * docs(changelog): defer release note --------- Co-authored-by: Deepak Jain <[email protected]>
* fix(windows): remove findstr from restart probe Co-authored-by: Deepak Jain <[email protected]> * docs(changelog): note Windows restart probe fix * docs(changelog): defer release note --------- Co-authored-by: Deepak Jain <[email protected]>
* fix(windows): remove findstr from restart probe Co-authored-by: Deepak Jain <[email protected]> * docs(changelog): note Windows restart probe fix * docs(changelog): defer release note --------- Co-authored-by: Deepak Jain <[email protected]> (cherry picked from commit 3a482a7)
Closes #84600
Related: #91273
What Problem This Solves
Fixes an issue where Windows Gateway restart handoff could leave a visible or hung
cmd.exe/findstr.exeprocess while checking whether the scheduled task was already running. Reports show the probe delaying restart for minutes and sometimes requiring manual recovery.Why This Change Was Made
The generated restart helper now asks PowerShell to exit
0only whenGet-ScheduledTaskreportsRunning, and exits1otherwise. The existing batcherrorlevelbranch therefore keeps the same retry/fallback behavior without startingfindstr; single-quoted PowerShell literals avoid nested escaped double quotes and preserve apostrophes in custom task names.This is a maintainer replacement for #91273 because the contributor branch predates substantial current-main Windows restart hardening. The useful fix is preserved with co-author credit and applied on top of the current
getWindowsCmdExePath()behavior.User Impact
Windows Gateway restarts no longer spawn the
findstrsubprocess implicated in visible black windows and hung restart handoffs. Existing task-state detection, retry limits, fallback startup, cleanup, and hidden detached launch behavior remain in place.Evidence
v2026.6.11contain the reported PowerShell-to-findstrpipeline insrc/infra/windows-task-restart.ts.findstr, ordering beforeschtasks /Run, and apostrophe-safe task names.6326ad97f0a62b56e9426db05d5631d732c0daebpassed the full hosted CI run, including all 6 focusedsrc/infra/windows-task-restart.test.tscases: https://github.com/openclaw/openclaw/actions/runs/2884234216128843194826onfdeb981ba8549324ff3c699768a8dfcbcf7016f5passed 8 Windows CI shards (180 tests passed, 17 skipped). Final head372e75b52199d3a2db24d144025fc60b8fe355f5removes only the release-owned changelog line and restores the exact code tree from6326ad97f0a62b56e9426db05d5631d732c0daeb: https://github.com/openclaw/openclaw/actions/runs/28843194826cbx_94ba7fc425c8, but the fresh image never completed SSH bootstrap; the lease was stopped. No behavior claim relies on that blocked run.