fix(daemon): clean stale Windows startup fallback#88361
Conversation
|
Codex review: needs maintainer review before merge. Reviewed June 21, 2026, 4:59 AM ET / 08:59 UTC. Summary PR surface: Source +35, Tests +39. Total +74 across 4 files. Reproducibility: yes. Current main and v2026.6.9 still run the Scheduled Task install/update path without removing Startup-folder entries, and the linked Windows issue contains live stale-fallback evidence; I did not run a fresh native Windows repro in this read-only review. Review metrics: 3 noteworthy metrics.
Stored data model 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:
Risk before merge
Maintainer options:
Next step before merge
Security Review detailsBest possible solution: Refresh this narrow daemon cleanup against current main, keep fallback deletion gated on confirmed Scheduled Task running evidence, preserve the merged inspect matcher, and let the broader doctor/update migration stay owned by the linked repair PR. Do we have a high-confidence way to reproduce the issue? Yes. Current main and v2026.6.9 still run the Scheduled Task install/update path without removing Startup-folder entries, and the linked Windows issue contains live stale-fallback evidence; I did not run a fresh native Windows repro in this read-only review. Is this the best way to solve the issue? Mostly yes. The narrow cleanup belongs in src/daemon/schtasks.ts and is gated on confirmed running-task evidence, but the PR needs a current-main refresh and should remain scoped below the broader doctor/update migration PR. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against e9b694ef9cd8. Label changesLabel justifications:
Evidence reviewedPR surface: Source +35, Tests +39. Total +74 across 4 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
|
c77ee7a to
0faa38b
Compare
|
Closing this as fully consolidated; there is no remaining unique change to land from this branch.
Keeping this conflicting four-file branch open would split the same Windows migration invariant across two PRs. #88311 remains the canonical doctor/update migration candidate. Thanks @vincentkoc for the original focused proof and Windows coverage. |
Summary
\OpenClaw Gatewayso the active task is not reported as another gateway-like service.Refs #87156. This is the native-Windows daemon cleanup slice; the broader doctor/update migration from existing fallback installs to Scheduled Task is tracked in #88311.
Verification
node scripts/run-vitest.mjs src/daemon/schtasks.startup-fallback.test.ts src/daemon/inspect.test.tsnode_modules/.bin/oxfmt --check src/daemon/schtasks.ts src/daemon/schtasks.startup-fallback.test.ts src/daemon/inspect.ts src/daemon/inspect.test.tsnode_modules/.bin/oxlint src/daemon/schtasks.ts src/daemon/schtasks.startup-fallback.test.ts src/daemon/inspect.ts src/daemon/inspect.test.tsgit diff --check origin/main...HEAD.agents/skills/autoreview/scripts/autoreview --mode branch --base origin/mainpnpm check:changed:provider=aws,lease=cbx_5e61cd2ed565,run=run_7f8dc0bf445aprovider=aws,lease=cbx_070e47559279,run=run_b633192f400echecks-windows-node-test: https://github.com/openclaw/openclaw/actions/runs/26687401081/job/78657871243Behavior addressed: Windows fallback installs that later migrate to a healthy Scheduled Task no longer keep stale Startup-folder launchers, and
gateway status --deepno longer treats\OpenClaw Gatewayas an extra service.Real environment tested: focused unit coverage in a Codex worktree, AWS Crabbox native Windows SYSTEM scheduled-task proof, AWS Crabbox changed gate, plus the existing native Windows GitHub Actions runner proof.
Exact steps or command run after this patch: the Verification commands and Crabbox runs above.
Evidence after fix: targeted schtasks fallback tests pass, win32 extra-service parsing test passes, formatter/lint/diff checks pass, autoreview is clean,
pnpm check:changedpassed remotely, and native Windows proof observedStatus: RunningwithLast Result: 267009before cleanup.Observed result after fix: cleanup removes both
.cmdand.vbsStartup entries only after Task Scheduler reports a running task result; the fallback is preserved whenschtasks /Runfalls back to direct launch.What was not tested: live elevated manual install/update on an interactive Windows desktop and Windows WSL; this patch touches native-Windows service metadata/runtime cleanup, not WSL behavior.