Repository navigation
test(update): fix the Windows backup-rename regression on native Windows - #162352
Conversation
Inject the platform only into the backup-rename policy. Leave native filesystem staging, verification, and cleanup on the host platform so the Linux policy case reaches its injected EPERM on Windows. Preserve all existing failure, retry, rollback, and content assertions. Refs #162027.
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs changes before merge. Reviewed September 30, 2026, 11:56 PM ET / October 1, 2026, 03:56 UTC (Revision 2). ClawSweeper reviewWhat this changesThe PR lets update tests select the backup-rename retry policy while staging, verification, and cleanup continue using the host’s native filesystem behavior. Merge readiness⛔ Needs changes before merge - 1 item remains Keep open: current main still needs this focused fixture repair. No introduced correctness defect was found, and the previously requested validation results remain pending. Priority: P2 Review scores
Verification
How this fits togetherThe package updater stages a replacement installation, backs up the installed package, and verifies activation or rollback. These tests inject rename failures into that production swap path to check retry and recovery behavior. flowchart TD
A[Staged replacement package] --> B[Package swap]
C[Test-selected retry policy] --> D[Backup rename]
B --> D
D --> E[Native filesystem operations]
E --> F[Activation or rollback]
F --> G[Package and launcher assertions]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +1, Tests +7. Total +8 across 2 files. View PR surface stats
Review metricsNone. Technical reviewBest possible solution: Keep one backup-rename policy owner and exercise both policies through the package swap without changing the native filesystem platform. Do we have a high-confidence way to reproduce the issue? Yes, from source: the existing Linux-policy case spoofs process.platform across a native Windows swap, allowing fs-safe to reject staging before the injected EPERM rename. No failing execution was performed during this read-only review. Is this the best way to solve the issue? Yes: selecting the policy at its existing owner preserves the actual swap boundary and assertions while avoiding a global platform mismatch. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 37952aee0f0e. LabelsLabel changes: No label changes. Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
|
Independent verification for the Windows fixture blocker affecting #161827 and #162098: this fix is already merged as Reused and inspected native Windows job 110210852632, Node 24.21.0, from successful exact-head CI attempt 1. Its checkout was Exact original failure: Compared the unpublished test-only alternative (+7/-1 test lines, zero production lines). It scopes the platform mock to backup, while this landed fix removes global platform mocking throughout the file and preserves every assertion. Measured landed PR delta: production +2/-1 (net +1); tests +20/-13 (net +7). No duplicate PR or repeated successful suite was needed. |
Keep the extension package-boundary check on Blacksmith during optional hybrid/runson hosted overflow. Hosted boundary jobs could not restore the self-hosted compiled-declaration archives (restore key includes runner.environment) and took 22-23 minutes; 2 of 25 boundary jobs in a 40-run census ran hosted. Explicit GitHub overrides, retry/manual/trust fallbacks, compiler checks, canary, deadlines and concurrency are unchanged. Merged past one inherited red: checks-windows-node-test-3 src/infra/package-update-swap.windows.test.ts "preserves the package after persistent EPERM on linux (retries=false)" came from b5555b0 (#162231), is red on main in hourly 36811800156, and is fixed on main by d7b0293 (#162352). This PR touches no Windows or updater code.
…ows (openclaw#162352) The regression added by openclaw#162231 spoofed the platform globally in its fixture, which made fs-safe select Linux staging on a native Windows host and failed the linux-case assertion. Platform injection now affects only the backup-rename retry policy; assertions are unchanged. Native Windows passes all 11 cases. Refs openclaw#162027
…#162289) Keep the extension package-boundary check on Blacksmith during optional hybrid/runson hosted overflow. Hosted boundary jobs could not restore the self-hosted compiled-declaration archives (restore key includes runner.environment) and took 22-23 minutes; 2 of 25 boundary jobs in a 40-run census ran hosted. Explicit GitHub overrides, retry/manual/trust fallbacks, compiler checks, canary, deadlines and concurrency are unchanged. Merged past one inherited red: checks-windows-node-test-3 src/infra/package-update-swap.windows.test.ts "preserves the package after persistent EPERM on linux (retries=false)" came from 1b0ec4c (openclaw#162231), is red on main in hourly 36811800156, and is fixed on main by 74ffe77 (openclaw#162352). This PR touches no Windows or updater code.
Refs #162027
What Problem This Solves
Fixes the backup-rename regression test introduced by #162231, which failed on native Windows when exercising the Linux no-retry policy.
User Impact
The test exercises both retry policies on a Windows runner while keeping real filesystem staging, verification, and cleanup native. Default updater behavior is unchanged.
Why This Change Was Made
Spoofing
process.platformaround the whole swap caused fs-safe to select Linux retained-directory staging against the Windows native binding. The fixture returnedhelper-unavailable: native retained-directory staging is unavailableandpackageRollbackVerified: falsebefore reaching the injectedEPERMrename.The backup-rename policy now accepts a platform dependency that defaults to the real host. The test delegates to that real owner with its selected policy and leaves
process.platformuntouched. All existing error-code, rollback, retry-count, warning, and file-content assertions remain unchanged. No matcher was widened and no case was skipped.Evidence
Head:
7b8d453d15bd2e5f0e9e3a8448946d45760f54fb, based on main97e6d8e2592bff84fc9b651b794969f8b1a37da5.110188916369failed the LinuxEPERMno-retry case with the unrelated staging refusal above.tbx_01m3tqztj0k1thy7kscgywtxrjfetched the pushed SHA and installed withpnpm install --frozen-lockfile, without local tree sync. Regression: 11/11 passed.pnpm test src/infra/package-update-swap.windows.test.ts --maxWorkers=1measured 7.00 seconds warm wall time, with about 0.21 seconds of test time.CI=1 OPENCLAW_CHECK_CHANGED_REMOTE_CHILD=1 node scripts/check-changed.mjs --base 97e6d8e2592bff84fc9b651b794969f8b1a37da5passed, including core types, all 27 core-test type graphs, lint, formatting, dead-export scans, and selected guards.tbx_01m3tr4bdpe6f26eettb8d7p36was stopped and task credentials were deleted.Production: +2/-1 lines (net +1 platform dependency). Tests: +20/-13 lines (net +7). No dependency, schema, CLI, configuration, or baseline changes.
Auto-merge is off; this is a fix-forward PR, not a direct main push.