fix(windows): repair doctor update fallback migration#88311
Conversation
|
Codex review: needs maintainer review before merge. Reviewed May 31, 2026, 8:31 AM ET / 12:31 UTC. Summary PR surface: Source +158, Tests +488. Total +646 across 11 files. Reproducibility: yes. source inspection and the linked user report give a high-confidence reproduction path: current main stages all update-mode service repairs and does not remove hidden Review metrics: 2 noteworthy metrics.
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 a maintainer-approved version that keeps the existing service repair ownership, restarts or activates only already-running Windows managed gateways, preserves recovered auth through update-safe config writes, and deletes old Startup-folder fallbacks only after Scheduled Task running evidence. Do we have a high-confidence way to reproduce the issue? Yes, source inspection and the linked user report give a high-confidence reproduction path: current main stages all update-mode service repairs and does not remove hidden Is this the best way to solve the issue? Yes, the PR uses the existing doctor/service repair path instead of adding a new config surface, and it includes explicit guards for external repair policy, legacy update parents, stopped services, and Scheduled Task running evidence. The remaining judgment is whether maintainers accept the intended Windows upgrade semantics. AGENTS.md: found and applied where relevant. Codex review notes: reasoning high; reviewed against 729712d19467. 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
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.