fix(windows): remove findstr from scheduled-task restart probe (Fixes #84600)#91273
fix(windows): remove findstr from scheduled-task restart probe (Fixes #84600)#91273deepujain wants to merge 1 commit into
Conversation
Use a pure PowerShell task-state exit-code check so the scheduled-task restart helper no longer shells through findstr. Fixes openclaw#84600
|
Focused fix for the exact helper path from #84600 is up. Validation on the branch:
I kept the change narrow to the scheduled-task restart probe, preserved the existing retry loop, and added coverage that the generated helper script no longer shells through |
|
Codex review: needs real behavior proof before merge. Reviewed June 30, 2026, 2:41 PM ET / 18:41 UTC. Summary PR surface: Source +2, Tests +2. Total +4 across 2 files. Reproducibility: yes. for source-level reproduction: current main and Review metrics: 1 noteworthy metric.
Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. 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:
Proof path suggestion Risk before merge
Maintainer options:
Next step before merge
Security Review detailsBest possible solution: Land the focused PowerShell-only probe after redacted Windows proof shows no cmd/findstr window and a successful Gateway restart. Do we have a high-confidence way to reproduce the issue? Yes for source-level reproduction: current main and Is this the best way to solve the issue? Yes, this is the best narrow fix if live proof passes: it preserves retry, cleanup, and fallback shape while removing AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 66e676d29b92. Label changesLabel justifications:
Evidence reviewedPR surface: Source +2, Tests +2. Total +4 across 2 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
Review history (1 earlier review cycle)
|
|
This assigned pull request has been automatically marked as stale after being open for 27 days. |
|
Landed the maintained replacement in #101366 as The replacement keeps the PowerShell-only task-state fix, applies it on top of current Windows restart hardening, adds exact command and apostrophe-quoting regressions, and passed full hosted CI plus native Windows Server 2025 validation. @deepujain's contribution is preserved with a Thank you, @deepujain! |
Summary
Fixes #84600.
The Windows scheduled-task restart helper still probed task state with a PowerShell command piped into
findstr /I /C:"Running". That leaves a visiblecmd.exe -> findstr.exechild process shape on some Windows hosts, which matches the black heartbeat/restart window reported in the issue.This change keeps the same retry semantics but replaces the
findstrpipeline with a pure PowerShell exit-code check:0when the scheduled task is already running1otherwiseNon-goals:
Tests and validation
Real behavior proof
Behavior addressed:
findstrEnvironment tested:
main-based branchEvidence after the fix:
src/infra/windows-task-restart.test.tsnow verifies the generated helper script uses a PowerShell-only task-state probe and explicitly does not containfindstrObserved result:
Get-ScheduledTask(...).Statedirectly and redirects PowerShell output, removing thefindstrsubprocess from the helper pathWhat was not tested:
Proof limitations:
Risk
Low. This keeps the existing retry loop and scheduled-task commands intact. The only behavior change is how the helper decides whether the task is already running before attempting
/Run.