Files
agent-zero/plugins/_time_travel/webui/config.html
Alessandro c84ff9521a Enable Time Travel snapshot expiry by default
Default active-history expiry to on in bundled settings, backend fallbacks
and the settings UI. New installations and legacy configurations without
the key now keep up to 500 recent snapshots within 30 days, plus current
state and boundary checkpoints. Preserve explicit opt-outs and the existing
cleanup schedule.

Update the settings copy and ownership contract to distinguish snapshot
expiry from optional whole-history deletion for inactive workspaces.

Validation: 59 focused backend tests and 5 frontend tests pass. Verify
that default cleanup expires old preserved timelines, explicit opt-outs
leave refs unchanged, and the settings initializer preserves false values.
The Docker framework runtime reports expiry enabled with the 500/30 limits.
2026-11-12 16:14:42 +01:00

161 lines
9.7 KiB
HTML

<html>
<head>
<title>Time Travel</title>
</head>
<body>
<div x-data>
<template x-if="config">
<div>
<div class="section-title">Snapshot coverage</div>
<div class="field">
<div class="field-label">
<div class="field-title">Additional excluded paths</div>
<div class="field-description">One Git-style pattern per line, relative to each workspace, for example downloads/ or models/*.bin. Built-in secret and cache exclusions always apply. Workspace .gitignore files do not control Time Travel. Exclusions affect future snapshots; older copies remain until their history expires. Restores that would touch an excluded path are refused.</div>
</div>
<div class="field-control">
<textarea rows="5" aria-label="Additional excluded paths" x-model="config.capture_exclude_patterns"
x-init="config.capture_exclude_patterns ??= ''"></textarea>
</div>
</div>
<div class="field">
<div class="field-label">
<div class="field-title">Maximum captured file size (MiB)</div>
<div class="field-description">0 keeps the existing unlimited behavior. Larger files are skipped and listed when you check current changes. Documents, images and other artifacts remain eligible unless you exclude them or set a size limit.</div>
</div>
<div class="field-control">
<input type="number" min="0" step="1" aria-label="Maximum captured file size (MiB)" x-model.number="config.capture_max_file_mb"
x-init="config.capture_max_file_mb ??= 0" />
</div>
</div>
<div class="section-title">Time Travel retention</div>
<div class="section-description">
Time Travel keeps a hidden history of every workspace it snapshots. Retention
removes abandoned histories. Optionally limit recent history in active workspaces
with the controls below. No workspace files are deleted by cleanup.
</div>
<div class="field">
<div class="field-label">
<div class="field-title">Enable retention</div>
<div class="field-description">
Periodically clean up orphaned workspace histories, stale snapshot
locks, and corrupt-repository backups. Turning this off means Time
Travel cleanup stops, including snapshot expiry.
</div>
</div>
<div class="field-control">
<label class="toggle">
<input type="checkbox" x-model="config.retention_enabled"
x-init="if (config.retention_enabled === undefined || config.retention_enabled === null) config.retention_enabled = true" />
<span class="toggler"></span>
</label>
</div>
</div>
<div class="field">
<div class="field-label">
<div class="field-title">Expire older snapshots</div>
<div class="field-description">On by default to limit history growth. Cleanup permanently expires older snapshots and older preserved timelines. Recent snapshots, the current state and boundary checkpoints remain. Turn this off to disable snapshot expiry. Retained snapshot IDs may change. Checkpoints can be restored but cannot be reverted.</div>
</div>
<div class="field-control">
<label class="toggle">
<input type="checkbox" aria-label="Expire older snapshots" x-model="config.history_retention_enabled" :disabled="!config.retention_enabled"
x-init="config.history_retention_enabled ??= true" />
<span class="toggler"></span>
</label>
</div>
</div>
<div class="field">
<div class="field-label">
<div class="field-title">Recent snapshots to keep</div>
<div class="field-description">Keep up to this many recent snapshots across timelines, plus the current state and checkpoint boundaries. 0 disables the count limit. This is not a disk-space limit: retained file contents still need storage.</div>
</div>
<div class="field-control">
<input type="number" min="0" step="1" aria-label="Recent snapshots to keep" x-model.number="config.history_max_snapshots" :disabled="!config.retention_enabled || !config.history_retention_enabled"
x-init="config.history_max_snapshots ??= 500" />
</div>
</div>
<div class="field">
<div class="field-label">
<div class="field-title">Recent history window (days)</div>
<div class="field-description">Apply this age limit together with the count limit. 0 disables age-based expiry. The current state and checkpoint boundaries are always retained.</div>
</div>
<div class="field-control">
<input type="number" min="0" step="1" aria-label="Recent history window (days)" x-model.number="config.history_max_age_days" :disabled="!config.retention_enabled || !config.history_retention_enabled"
x-init="config.history_max_age_days ??= 30" />
</div>
</div>
<div class="field">
<div class="field-label">
<div class="field-title">Sweep interval (hours)</div>
<div class="field-description">
How often the cleanup runs.
</div>
</div>
<div class="field-control">
<input type="number" min="1" step="1"
x-init="if (config.retention_sweep_interval_hours === undefined || config.retention_sweep_interval_hours === null) config.retention_sweep_interval_hours = 6"
x-model.number="config.retention_sweep_interval_hours" />
</div>
</div>
<div class="field">
<div class="field-label">
<div class="field-title">Delete inactive workspace histories after (days)</div>
<div class="field-description">
Leave at 0 (the default) to disable whole-history deletion; snapshot
expiry above still applies. Set a number — say 30 — and a workspace
with no snapshot or travel in that many days
has its history deleted. Time Travel simply starts a fresh history on
the workspace's next change.
</div>
</div>
<div class="field-control">
<input type="number" min="0" step="1"
x-init="if (config.retention_max_age_days === undefined || config.retention_max_age_days === null) config.retention_max_age_days = 0"
x-model.number="config.retention_max_age_days" />
</div>
</div>
<div class="field">
<div class="field-label">
<div class="field-title">Orphan grace period (hours)</div>
<div class="field-description">
History belonging to a deleted chat or project is unreachable from the
UI and gets cleaned up — but only after it has been inactive this long,
so recent work is never raced.
</div>
</div>
<div class="field-control">
<input type="number" min="1" step="1"
x-init="if (config.retention_orphan_grace_hours === undefined || config.retention_orphan_grace_hours === null) config.retention_orphan_grace_hours = 24"
x-model.number="config.retention_orphan_grace_hours" />
</div>
</div>
<div class="field">
<div class="field-label">
<div class="field-title">Stale snapshot lock age (minutes)</div>
<div class="field-description">
A leftover git index.lock older than this is removed so snapshots stop
failing with "index.lock: File exists". Cleanup skips histories
that are currently being captured, restored or compacted.
</div>
</div>
<div class="field-control">
<input type="number" min="5" step="1"
x-init="if (config.retention_stale_lock_minutes === undefined || config.retention_stale_lock_minutes === null) config.retention_stale_lock_minutes = 30"
x-model.number="config.retention_stale_lock_minutes" />
</div>
</div>
</div>
</template>
</div>
</body>
</html>