fix(windows): preserve staged update handoff#75649
fix(windows): preserve staged update handoff#75649IAMSamuelRodda wants to merge 4 commits intoopenclaw:mainfrom
Conversation
|
Codex review: needs changes before merge. Summary Reproducibility: yes. by source inspection for the review finding. #40540 documents Windows Next step before merge Security Review findings
Review detailsBest possible solution: Land the Control UI/Gateway detached verified-swap design after changing the #40540 changelog wording to non-closing, or broaden the implementation to cover the CLI package-update path before using closing language. Do we have a high-confidence way to reproduce the issue? Yes, by source inspection for the review finding. #40540 documents Windows Is this the best way to solve the issue? Partly. The detached staged-swap approach is a maintainable fix for Control UI/Gateway Full review comments:
Overall correctness: patch is incorrect Acceptance criteria:
What I checked:
Likely related people:
Remaining risk / open question:
Codex review notes: model gpt-5.5, reasoning high; reviewed against 13dc14d43ec2. |
c96817b to
35313fb
Compare
…EBUSY On Windows, 'npm i -g openclaw@latest' fails with EBUSY when the Gateway process is running because Node.js locks loaded .js files. The Dashboard 'Update now' button always fails on Windows for this reason. This fix introduces a detached update flow for Windows: 1. update-runner detects Windows + global npm install scenario 2. Spawns a detached .cmd helper script (update-detached-win32.ts) 3. Returns status 'ok' with detachedResultPath so the handler knows to exit the Gateway process (not just SIGUSR1 in-process reload) 4. The detached helper waits for the Gateway PID to exit, runs npm install, then relaunches the Gateway via Scheduled Task This mirrors the existing windows-task-restart.ts pattern but adds the npm install step between stop and restart. Files changed: - src/infra/update-detached-win32.ts (new): Detached update helper - src/infra/update-runner.ts: Windows branch in global update path - src/gateway/server-methods/update.ts: Handle detachedResultPath - src/infra/update-detached-win32.test.ts (new): Tests Fixes: Dashboard 'Update now' EBUSY failure on Windows (cherry picked from commit c83ca14)
35313fb to
4224f5b
Compare
Summary
Carries forward #44614 by @Eiman24, preserving their original cherry-picked commit as the first commit and adding maintainer follow-up commits on top.
This keeps the detached Windows update direction, but adjusts the implementation around the current package-update contract:
update.statusValidation
pnpm exec oxfmt --check --threads=1 src/infra/package-update-steps.ts src/infra/package-update-steps.test.ts src/infra/update-detached-result.ts src/infra/update-detached-win32.ts src/infra/update-detached-win32.test.ts src/infra/update-runner.ts src/gateway/server-methods/update.ts src/gateway/server-methods/update.test.ts src/gateway/server-restart-sentinel.ts src/gateway/server-restart-sentinel.test.ts src/infra/restart-sentinel.tspnpm test src/infra/update-detached-win32.test.ts src/infra/package-update-steps.test.ts src/gateway/server-methods/update.test.ts src/gateway/server-restart-sentinel.test.ts src/infra/update-runner.test.ts src/cli/update-cli/restart-helper.test.tspnpm tsgopnpm tsgo:core:testNotes
I attempted to push directly to
Eiman24:fix/windows-ebusy-updatewith--force-with-leaseagainstc83ca14db7192665cb80af98d88722be43c5a0e1, but GitHub denied push access for this account. This draft PR is the fallback path so the fix is available without overwriting the contributor's work.pnpm check:changedexpanded to all lanes because this rebased branch has no clean ancestry with the original PR branch. The local all-lane run reachedtsgo:alland then failed on an unrelated existing Matrix extension type error inextensions/matrix/src/matrix/monitor/handler.ts(dmScope/liveDmAllowFrom). The touched core typechecks and focused tests above pass.