Skip to content

Backup archive should skip volatile agent runtime and browser cache paths #98865

Description

@carterstebbins23-spec

Backup archive should skip volatile agent runtime and browser cache paths

Title

Backup archive should skip volatile agent runtime and browser cache paths

Problem

Backup archive creation can include volatile runtime paths under agent homes and browser user-data directories. These paths can be large, short-lived, and race-prone during live operation. When a volatile file disappears during tar creation, backup can fail even though the disappearing file is disposable runtime state.

The same class also causes archive bloat by capturing cache, shell snapshot, browser cache, retired archive, and transient files that do not help restore durable OpenClaw state.

Anchor and Version Context

  • Local anchor name: backup-agent-runtime-tmp-archive-filter
  • Observed on OpenClaw 2026.5.x through the current 2026.6.5 patch manifest.
  • Current patched target family: dist/backup-create-*.js
  • Local patch behavior:
    • Exclude agent runtime tmp, .tmp, cache, and shell_snapshots directories under ~/.openclaw/agents/<agent>/agent/.
    • Exclude browser user-data cache and web-app resource cache paths under ~/.openclaw/browser/**.
    • Exclude retired archive paths under ~/.openclaw/archived/**.
    • Treat disappearing volatile paths as retryable or skippable archive races.
    • Expand transient extension and suffix handling for lock, partial, journal, WAL, and SHM files.

Proposed Upstream Fix

Extend the backup archive filter to classify disposable runtime and cache paths as volatile, then skip those paths during archive creation. If tar sees ENOENT for a path that the filter would exclude, treat it as a volatile race and retry or continue with the filtered archive.

Acceptance Criteria

  • Durable state remains included in backup archives.
  • Agent runtime tmp/cache/shell snapshot paths are excluded.
  • Browser user-data cache and generated web-app resource cache paths are excluded.
  • Retired archive paths are excluded.
  • ENOENT on a volatile path does not fail the backup.
  • The backup summary reports skipped volatile file counts with enough detail for operators to understand why the archive is smaller.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Normal backlog priority with limited blast radius.clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.clawsweeper:queueable-fixClawSweeper marked this issue as an existing queue_fix_pr work candidate.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.impact:otherThis issue has meaningful maintainer-visible impact outside the owned taxonomy.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.no-staleExclude from stale automation

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions