Make your computer a home for your AI partner. Avibe is the local-first Agent OS: Vibey, its built-in AI partner, works out of the box, and Claude Code, Codex & OpenCode run unchanged beside it — reach them from your browser, phone, or any chat app.
Bounded local storage growth — Show Runtime archives & agent trace events
Status: In progress (2026-08-17) Owners: storage workstream Related: avibe#1506 (feature issue and measured numbers)
Background
One active installation measured (avibe#1506): 50 archives / 974 MiB in
/.avibe/state/vibe.sqliteruntime/show-runtime/downloads (49 stale, no open handles) and a
`of ~1.27 GiB dominated by 362kagent_eventsrows, of which 361,958 werevisibility='trace'/event_type='tool_call'`.
Both are internal runtime artifacts with no lifecycle owner. User-visible
data (messages, deliveries, sessions/runs, Vault audit) is out of scope and
must never be touched by this work.
Lane A — Show Runtime archive cache (small, independent)
Code facts that shaped the design:
- The manifest download flow stages into
<sha256>.tmp, verifies size + full sha256, then atomically renames todownloads/<sha256>.tgz(_resolve_manifest_archive). A file with the strict content-addressed name is therefore always a completed, verified archive;.tmpfiles and unknown names are never candidates. current.jsonand each install's.vibe-show-runtime.jsonrecordarchive_sha256, so the protected set (current + retained rollback installs, following the existingkeep_previouscontract) is exact._packaged_runtime_archivewrites a non-sha name — excluded by the strict<64-hex>.tgzfilter, so the packaged flow's cache is never pruned.
Changes:
ShowRuntimeManager.clean(dry_run=...)now also prunes stale content-addressed archives (strict name + regular file vialstat, symlink/unknown/.tmpuntouched) and reports count/bytes (candidates + removed)._clean_after_managed_installruns the same archive cleanup after a successful managed manifest install, inside the existing never-break-prepare guard.vibe runtime clean --dry-runpreviews all removals;vibe doctorgained a read-only archive-cache item (show_runtime.archive_cache_reclaimable).
Lane B — agent_events trace retention (storage-owned)
Design decisions:
- One retention owner: a new
storage/agent_events_retention.py. Call sites (controller daily task, CLI) never write ad hoc deletes. - Eligibility is a single property predicate:
event_type='tool_call' AND visibility='trace' AND created_at < cutoff(default 30 days, configurable, explicit opt-out). Everything else — messages, non-trace events, newer traces — is preserved by construction. - Alembic partial index on
created_at WHERE event_type='tool_call' AND visibility='trace'keeps the age scan bounded. - Deletes run in small batches in per-batch transactions (WAL allows
concurrent writers between batches); a persistent
state_metamarker throttles runs to at most once per day and serializes concurrent runners. - Physical compaction only after a preflight (free disk > db + WAL + margin, checkpoint first); otherwise deferred with a reported reason. Never an automatic VACUUM that can exhaust a nearly-full volume.
- Trigger: controller background task (daily check via marker) + manual CLI with dry-run/status; never in user request hot paths.
Todos
- Lane A implementation + tests (
tests/test_show_runtime_archive_cleanup.py) - Lane A PR review loop
- Lane A user docs:
vibe runtime clean/--dry-runen + zh (avibe-bot/avibe-docs#24) - Lane B migration (partial index) — next alembic head after
20260817_0055 - Lane B retention service + controller task + CLI + tests
- Lane B PR review loop
- avibe-docs: en/zh docs for trace retention (ships with lane B)