Repository navigation
fix(backup): create --verify fails for the open Windows agent database - #157301
roboclaw-bot merged 2 commits into
Conversation
|
🦞👀 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 maintainer review before merge. Reviewed September 24, 2026, 1:04 PM ET / 17:04 UTC (Revision 3). ClawSweeper reviewWhat this changesThe branch maps Windows drive and network-share namespace aliases to portable backup paths, deduplicates agent database snapshots, adds backup regression coverage, and adjusts a Gateway abort-test fixture. Merge readiness✅ Ready for maintainer review The reported Windows backup failure remains present on current main, and this PR addresses its source-level cause. The latest change adjusts a Gateway test fixture; the earlier review’s test-runtime request is addressed in the PR body. No actionable patch defect is established. Priority: P1 Review scores
Verification
How this fits togetherOpenClaw’s backup command discovers local files and databases, writes them into a portable archive, and optionally verifies that archive. Restore verifies the archive again before extracting it. flowchart LR
A[Backup command] --> B[Local files and database registry]
B --> C[Path and ownership inventory]
C --> D[SQLite snapshots]
D --> E[Portable archive]
E --> F[Archive verification]
F --> G[Verified backup or restore]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +22, Tests +92. Total +114 across 6 files. View PR surface stats
Review metrics
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Technical reviewBest possible solution: Keep one physical agent database snapshot under a portable archive name while preserving verification and restore of previously valid archives. Do we have a high-confidence way to reproduce the issue? Yes, from source and the reported Windows run: a namespace-prefixed drive path reaches the old archive encoder as a path containing Is this the best way to solve the issue? Yes. The patch changes the existing archive path and ownership owners, and its Windows create/restore evidence covers the intended user flow. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 54bec7738313. LabelsLabel changes: No label changes. Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (2 earlier review cycles)
|
…ows namespace path A \\?\ or \\.\ spelling of the live agent database was archived beside the drive path as posix/?/C:, and create --verify rejected its own archive. Those aliases now share one drive or UNC entry. Co-authored-by: Cursor <[email protected]>
65c4242 to
3b3e9b7
Compare
The abort fanout fixture acknowledges asynchronous agent admission before execution. Await its existing parentStarted signal rather than polling the mock call count with an unrelated two-second deadline, then retain the exact once-called assertion. Cancellation, sibling accounting, and cleanup assertions are unchanged. Co-authored-by: Tak Hoffman <[email protected]> Co-authored-by: Takhoffman <[email protected]>
|
Merged via squash.
|
openclaw#157301) Normalize Windows namespace drive and UNC aliases before archive naming and SQLite ownership resolution so verified backups keep one portable snapshot per physical database without relaxing archive-path validation. Synchronize the Gateway abort fixture with its existing execution-start signal rather than an unrelated two-second poll. Closes openclaw#157235 Co-authored-by: ericcaiwx-star <[email protected]> Co-authored-by: Tak Hoffman <[email protected]> Co-authored-by: Takhoffman <[email protected]>
Closes #157235
What Problem This Solves
Fixes:
openclaw backup create --verifyfails on Windows when the running Gateway has the main agent database open, because the archive contains a non-relative duplicatepayload/posix/?/C:/...entry.User Impact
User impact: scheduled and manual verified backups can complete on Windows again. The verifier still rejects non-relative archive paths.
Why This Change Was Made
A
\\?\or\\.\spelling of the same drive or UNC path was encoded as a POSIX path containing a drive letter, and a second snapshot was emitted beside the normalwindows/<drive>/...entry. Namespace aliases now use that drive or UNC archive name, and one physical database keeps one snapshot. Volume GUID paths are left unchanged.Evidence
On Windows at main
4d69dd020015d514fd028ab913ac9ac12ed57b6e, encoding\\?\C:\Users\...\openclaw-agent.sqliteproducedpayload/posix/?/C:/...and exited 1.At
65c4242b2c9a095463ebe2b919fcb974be46f87bthe same command exits 0 withpayload/windows/C/....src/commands/backup-shared.namespace-path.test.tspassed (9). On native Windows,src/infra/backup-create.ownership.test.tscreated a verified archive for a namespaced registry alias, restored it, and found one SQLite payload underpayload/windows/.Maintainer verification
At source head
65c4242b2c9a095463ebe2b919fcb974be46f87b, independent source review found no actionable P0–P2 findings. The contributor-reported native Windows proof above is retained; the following independent run was Linux, not a Windows rerun.Single-worker measurements on secretless direct AWS (Node 24.19.0), using
pnpm test <file> --maxWorkers=1:src/commands/backup-shared.namespace-path.test.tssrc/infra/backup-create.ownership.test.tsThe namespace run included cold compiler-cache preparation (22.371 s); its nine assertions each took 0–1 ms. The ownership run reused compiler output; existing integration cases took 0.275–2.158 s. Windows-specific case runtime is not measured by this Linux run. Focused run.
The original CI run failed only in the unrelated Codex startup-teardown fixture (
shared-client-lifetime.test-support.ts:121). Upstream commit 619405d49ddd fixes that fixture by waiting for the real stream-close event instead of only advancing fake timers; the contributor refreshed the branch to head 3b3e9b7 at 14:36 UTC. That head contains the upstream fixture fix. All five backup files and the patch ID are identical to the reviewed source; the prior review and focused proof are reused, while fresh exact-head CI is required before merge.Landing CI fixture repair
A second CI failure occurred in the existing Gateway sibling-abort test before its fanout assertions: a two-second mock-call poll expired after the asynchronous agent request was accepted. The follow-up changes only that fixture to await its existing execution-start signal, then retains the exact once-called assertion. No production behavior changes; no test timeout is increased, and cancellation assertions and cleanup contracts remain unchanged.
Validation on the exact backup source plus the one-line fixture repair, in secretless AWS with Node 24.19.0:
pnpm test src/gateway/server.chat-abort-sibling-fanout.test.ts --maxWorkers=1. Command wall times: 25.12–65.55 s, including process/fixture setup and transforms.Limit: the baseline replay passed, so the original slow startup was not naturally reproduced on the larger AWS host. The original CI failure and source ordering establish that the assertion ran before its owned completion signal; this does not claim to diagnose a production performance defect. Fresh exact-head CI passed on the published follow-up: 120 successful jobs, 19 skipped, zero failures. Both required gate entries are successful. ClawSweeper revision 3 reviewed this exact head and found no actionable defects.
Published follow-up head: 473ec74; its tree matches the reviewed and tested candidate.
Made with Cursor