fix(windows): repair doctor update fallback migration#88311
Conversation
|
Codex review: found issues before merge. Reviewed June 21, 2026, 4:35 AM ET / 08:35 UTC. Summary PR surface: Source +158, Tests +488. Total +646 across 11 files. Reproducibility: yes. source-reproducible. Current main and v2026.6.9 still stage update-mode service repair, and the linked issue/PR body include live native-Windows evidence for stale fallback state and post-update gateway unavailability. Review metrics: 2 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 findings
Review detailsBest possible solution: Refresh the branch against current main, remove the duplicated local version-mismatch audit in favor of the canonical service-audit code, then land only after maintainers accept the Windows upgrade auth and availability behavior. Do we have a high-confidence way to reproduce the issue? Yes, source-reproducible. Current main and v2026.6.9 still stage update-mode service repair, and the linked issue/PR body include live native-Windows evidence for stale fallback state and post-update gateway unavailability. Is this the best way to solve the issue? No as currently based. The repair is in the right owner surfaces, but it duplicates current main's canonical service-version audit and needs refresh before it is the best fix. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 9940110b881b. Label changesLabel justifications:
Evidence reviewedPR surface: Source +158, Tests +488. Total +646 across 11 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
|
41233b5 to
d6193de
Compare
e107b30 to
b4f59bc
Compare
e8066b7 to
18a08eb
Compare
18a08eb to
11f564e
Compare
|
Replaced and landed in #101213 as commit bb44c23. This branch could not be updated because maintainer edits are disabled, so I replayed the work on a maintainer branch, preserved the original commits and co-author credit, and hardened the takeover with exact process ownership, rollback, broader update-path tests, full exact-head CI, and native Windows doctor/update proof. Thank you, @vincentkoc, for identifying and implementing the core Windows repair. For future contributor PRs, enabling Allow edits by maintainers lets us improve and land the original branch directly. |
Summary
OPENCLAW_SERVICE_VERSIONvalues and repairs version drift through the existing gateway service doctor path.cmdand hidden.vbs) only after Task Scheduler reports running evidenceOPENCLAW_GATEWAY_TOKENintogateway.auth.tokenbefore reinstalling the taskFixes #87156.
Verification
node scripts/run-vitest.mjs src/commands/doctor-gateway-services.test.ts src/flows/doctor-health-contributions.test.ts src/commands/doctor-update.test.ts src/daemon/schtasks.startup-fallback.test.ts src/daemon/schtasks.stop.test.ts -- --run- passed after rebase on11f564ede1ba3acade0a697090e62e21794c8e59(100 assertions across 5 files)node_modules/.bin/oxfmt --check src/commands/doctor-gateway-services.ts src/commands/doctor-gateway-services.test.ts src/flows/doctor-health-contributions.ts src/flows/doctor-health-contributions.test.ts- passednode scripts/run-oxlint.mjs src/commands/doctor-gateway-services.ts src/commands/doctor-gateway-services.test.ts src/flows/doctor-health-contributions.ts src/flows/doctor-health-contributions.test.ts- passedgit diff --check origin/main...HEAD && git diff --check- passed.agents/skills/autoreview/scripts/autoreview --mode branch --base origin/main- clean after addressing accepted findings for token propagation, update-safe write options, and legacy update-parent write guardsrun_52d49841f33don AWS Windows (cbx_013fda705836) created both Startup-folder fallback extensions under the real Windows Startup folder and removed both:windows_startup_dual_extension_cleanup=ok,removed_extensions=.cmd,.vbswindows-2025; WSL was present (wsl_status_exit=0, default version 2) but no distro was installed, so this is WSL availability proof, not successful WSL distro executionrun_a9b4283c04abreachedpnpm check:changed; conflict markers, changelog attributions, dependency guards, core typecheck, and core test typecheck passed, then the gate failed in an untouched current-main Discord boundary dts check:extensions/discord/src/monitor/gateway-plugin.ts:165(1000 | 1001compared with1008). This branch does not touchextensions/discord/**.Real behavior proof
Behavior addressed: Windows doctor/update migration now distinguishes running vs stopped managed gateways, detects stale service versions, preserves gateway auth during task rewrites, restarts stale installed/running gateways after update, and removes old Startup-folder fallback launchers only after Task Scheduler running evidence.
Real environment tested: native AWS Windows via Crabbox for Startup-folder dual-extension cleanup; GitHub-hosted Windows Server 2025 probe for native Windows and WSL availability; focused local Vitest shards for daemon startup fallback, daemon stop, doctor update, doctor gateway services, and doctor health config handoff.
Exact steps or command run after this patch: focused Vitest/format/lint/autoreview commands listed above; native Windows cleanup probe
run_52d49841f33d; remote changed gatenode scripts/crabbox-wrapper.mjs run --provider aws --idle-timeout 90m --ttl 240m --timing-json --shell -- "pnpm check:changed"(run_a9b4283c04ab).Evidence after fix: focused tests passed after the latest rebase at
11f564ede1ba3acade0a697090e62e21794c8e59; autoreview is clean; native Windows cleanup proof removed both.cmdand.vbsStartup-folder fallbacks; remote changed gate passed the touched core typecheck and test typecheck lanes before hitting the unrelated Discord boundary dts failure.Observed result after fix: the Windows doctor/service migration paths are validated for the touched unit behavior and the native Windows Startup-folder cleanup path. The broad changed gate is blocked by an untouched current-main Discord type issue, not by this patch.
What was not tested: successful WSL2 distro boot/execution inside a Windows runner; direct Blacksmith Testbox proof, because Blacksmith auth is not available in this environment.