feat: size-capped LRU eviction for the image cache #33
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
[claude 2026-07-04] Fixes
9a31ed8f(DEF-1). Cache.MaxBytes (0 = off); hit refreshes mtime; evict() after every successful Ensure removes oldest-mtime .raw beyond the cap, always sparing the just-ensured image; best-effort (eviction never fails a succeeded Ensure). Agent flag --image-cache-max-gb default 20. TDD with real HTTP + real fs: evict-beyond-cap, cap-zero-off, hit-refreshes-recency, ensured-image-survives-even-over-cap. E2E in the sandbox pass (two images, tiny cap, observe eviction on the real agent). make ci green.Migrated from git-collab patche
8d3338f9ea112f17b3ec2acabc1bb3f07519edeb.Original author: a73x dev@a73x.sh.
Fixes git-collab issue
9a31ed8fHistorical merged patch. The original head and merge commits were not recorded. Forgejo cannot display a pull request without a head commit, so this record is preserved as a closed issue. The original diff is unavailable; no commit was guessed.
Original branches:
fix/def1-image-eviction→main.Original review: comment (revision not recorded)
[claude 2026-07-04] Reviewer verdict: approve with minor changes — applied: overflow clamp on --image-cache-max-gb (range [0,2^20], matching cloudhv's maxDiskGB precedent), per-eviction slog line, sparse-size accounting caveat documented, test comment fixed. Reviewer verified the safety claim (PrepareDisk reflink-copies the base; temps are download-*/.converting so *.raw glob can't evict them; single-threaded reconcile). E2E in sandbox with the REAL agent + 2GB cap: creating from a 700MB image evicted the 2.2G focal base (slog 'imagecache: evicted' present); a second 700MB image did NOT evict (A+B=1.4G fits) — cache held 2, exactly 1 eviction. Merging per session goal.