fix(daemon): strip schtasks backslash prefix when matching gateway task name#91181
fix(daemon): strip schtasks backslash prefix when matching gateway task name#91181425072024 wants to merge 5 commits into
Conversation
…sk name Windows schtasks /Query /FO LIST /V returns task names with a leading backslash prefix (e.g. \OpenClaw Gateway for root-folder tasks). isOpenClawGatewayTaskName() compared the raw normalized name against the configured task name, so \openclaw gateway never matched openclaw gateway, causing the live gateway task to be flagged as an extra gateway-like service and recommending schtasks /Delete cleanup. Strip the leading backslash before comparison so the live launcher task is correctly recognized and excluded from the warning. Fixes openclaw#90494
|
Codex review: needs maintainer review before merge. Reviewed June 7, 2026, 10:46 AM ET / 14:46 UTC. Summary PR surface: Source +5, Tests +4. Total +9 across 2 files. Reproducibility: yes. Source inspection shows current main preserves Review metrics: none identified. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Risk before merge
Maintainer options:
Next step before merge
Security Review detailsBest possible solution: Land the narrow normalization fix with the focused regression test, then only pursue broader task-path or parent-process correlation if stale-task false positives remain after this fix. Do we have a high-confidence way to reproduce the issue? Yes. Source inspection shows current main preserves Is this the best way to solve the issue? Yes. Stripping schtasks root-folder backslashes at the Windows task-name matcher is the narrowest maintainable fix for the proven false positive, while broader launcher correlation can remain a follow-up if separate stale-task cases persist. AGENTS.md: found and applied where relevant. Codex review notes: model gpt-5.5, reasoning high; reviewed against 66b91d78feb3. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Source +5, Tests +4. Total +9 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
|
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
Summary
\OpenClaw GatewayScheduled Task is falsely flagged as an extra gateway-like service with aschtasks /Deletecleanup hint. Following the hint removes the user's auto-start mechanism. Issue doctor/status: false positive 'Other gateway-like services detected' for active Windows Scheduled Task #90494.schtasks /Query /FO LIST /Vreturns task names with a leading\(e.g.TaskName:\OpenClaw Gateway).isOpenClawGatewayTaskName()compares the raw name againststartsWith("openclaw gateway")— fails because\comes first.normalized.replace(/^\\+/, "").src/daemon/inspect.ts(+6/-1) andsrc/daemon/inspect.test.ts(+4/-1).Real behavior proof
\OpenClaw GatewayScheduled Task falsely flagged as extra gateway service withschtasks /Deletecleanup recommendation.\OpenClaw Gatewaycanonical,\Clawdbot Legacylegacy) created viaschtasks /Create. Fullschtasks /Query /FO LIST /Vcaptured (257 tasks).schtasks /Query /FO LIST /Vvia PowerShell, applied before/after detection logic to each task. Console output captured below.\OpenClaw Gatewayis correctly identified as the canonical task and excluded from the extra-services warning.\Clawdbot Legacyis still correctly detected as a legacy extra service. No regression for the other 255 system tasks.Fixes #90494