fix: backup skips volatile cache paths#98879
Conversation
|
Codex review: needs real behavior proof before merge. Reviewed July 2, 2026, 2:01 AM ET / 06:01 UTC. Summary PR surface: Source +39, Tests +48. Total +87 across 2 files. Reproducibility: yes. source-reproducible: current main's volatile predicate lacks the requested agent runtime, browser cache, archived, and transient suffix rules, and the PR head only calls that predicate from statCache. I did not run a live filesystem-race repro in this read-only review. Review metrics: 1 noteworthy metric.
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:
Proof guidance:
Risk before merge
Maintainer options:
Next step before merge
Security Review findings
Review detailsBest possible solution: Either restore the narrow volatile-filter expansion with exact-head backup proof, or retitle and unlink this as a stat-cache-only race fix while keeping the canonical issue open. Do we have a high-confidence way to reproduce the issue? Yes, source-reproducible: current main's volatile predicate lacks the requested agent runtime, browser cache, archived, and transient suffix rules, and the PR head only calls that predicate from statCache. I did not run a live filesystem-race repro in this read-only review. Is this the best way to solve the issue? No. The stat-cache layer is a good sub-fix for ENOENT on already-volatile paths, but the best fix for the linked backup bug must also update the centralized volatile predicate or narrow the PR scope. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 75240f438564. Label changesLabel justifications:
Evidence reviewedPR surface: Source +39, Tests +48. Total +87 across 2 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
|
72cf342 to
9bcea8e
Compare
|
@clawsweeper re-review Addressed the backup volatile suffix finding by narrowing Fresh evidence:
|
|
🦞🧹 I asked ClawSweeper to review this item again. |
9bcea8e to
2e56a6c
Compare
2e56a6c to
1ac0f28
Compare
|
Land-ready proof for repaired head
Known proof gaps: none for the bounded writer-level race fix. The broader question of additional disposable backup paths remains intentionally out of this PR. |
|
Merged via squash.
|
…ilter.ts (openclaw#98879) Replace the vague one-line description of skipped files with a structured list matching isVolatileBackupPath in src/infra/backup-volatile-filter.ts. The filter was introduced in PR openclaw#98879 (fixes openclaw#98865) but the docs were not updated at the time. Each rule is listed with its glob pattern so operators can understand exactly which files are excluded from backup archives.
* fix: skip volatile backup cache paths * fix(backup): tolerate disappearing volatile files --------- Co-authored-by: Vincent Koc <[email protected]>
* fix: skip volatile backup cache paths * fix(backup): tolerate disappearing volatile files --------- Co-authored-by: Vincent Koc <[email protected]>
Closes #98865
What Problem This Solves
Fixes an issue where
openclaw backup createcould archive disposable agent runtime cache, browser cache, retired archive, and transient side-effect files from runtime-owned state paths. Those paths can be large or short-lived during live operation, so including them can bloat backups or make archive creation fail if a disposable file disappears while tar is walking the tree.Why This Change Was Made
The backup volatile-path filter now covers agent runtime tmp/cache/shell snapshot directories, managed browser user-data cache/resource directories, retired archive paths, and non-SQLite transient lock/partial/WAL/SHM/journal paths under transient-owned roots while preserving durable agent auth/profile files, browser profile files, and installed plugin source under
state/extensions. The archive writer also gives node-tar a backup-scoped synthetic stat cache for known volatile paths so entries that vanish beforelstatstill reach the normal filtered skip path; SQLite sidecars remain under the existing SQLite snapshot safety checks instead of the generic volatile path.User Impact
Backup archives are smaller and more reliable during live OpenClaw use. Operators still get durable state such as agent auth profiles, browser profile preferences/cookies, and installed plugin source lockfiles, while disposable runtime/cache paths are counted in
skippedVolatileCountand omitted from the tarball.Evidence
[email protected]callsfilteronly afterlstatsucceeds inPack, so a disappeared file can reject before the existing filter sees it; the new scopedstatCachehandles only paths already classified as volatile.OPENCLAW_STATE_DIRcontaining agent cache, browserDefault/Cache, a retired archive path, transient-rootcache/queue/item.walanddownloads/download.partial, durable browserDefault/Preferences, and durablestate/extensions/example/{Cargo.lock,download.partial}, runningpnpm openclaw backup create --output <tmp>/out --no-include-workspace --jsonproducedskippedVolatileCount=5;tar -tzfshowed durable browser preferences and bothstate/extensionsfiles, and did not show the cache/archive/transient-root side-effect paths.pnpm openclaw agent --local --agent proof --model deepseek/deepseek-v4-pro --message "Reply with exactly: backup proof agent ok" --json --timeout 180completed through providerdeepseek, modeldeepseek-v4-pro, HTTP status 200, final textbackup proof agent ok.node scripts/run-vitest.mjs src/infra/backup-volatile-filter.test.ts src/infra/backup-create.test.tspassed after repair: 63 unit-fast tests and 39 infra tests.node scripts/run-tsgo.mjs -p tsconfig.core.json --incremental --tsBuildInfoFile .artifacts/tsgo-cache/core.tsbuildinfo && node scripts/run-tsgo.mjs -p test/tsconfig/tsconfig.test.src.json --incremental --tsBuildInfoFile .artifacts/tsgo-cache/test-src.tsbuildinfopassed after repair.pnpm format:fix -- src/infra/backup-volatile-filter.ts src/infra/backup-volatile-filter.test.ts src/infra/backup-create.test.tspassed after repair.pnpm format:docs:check -- docs/cli/backup.mdpassed.git diff --checkpassed after repair.pnpm buildpassed after repair../.agents/skills/autoreview/scripts/autoreview --mode localpassed after repair with no accepted/actionable findings.AI-assisted.