[DEF-1] Image cache has no eviction — agent disk fills #22

Closed
opened 2026-07-04 15:30:47 +00:00 by a73x · 1 comment
a73x commented 2026-07-04 15:30:47 +00:00 (Migrated from git.a73x.sh)

[claude 2026-07-03] Deferred from architecture review. internal/agent/imagecache keeps every downloaded image forever (comment at imagecache.go:3 defers eviction). Implement a size-capped LRU: after a successful Ensure, evict least-recently-used images beyond a configurable cap (agent flag, default e.g. 20GB), never evicting the image just ensured. E2E: real imagecache against a real HTTP server + real filesystem; verify eviction order and that in-use image survives.


Migrated from git-collab issue 9a31ed8f24db2260f7ceb180317c1b6b93e3e9e2.

Original author: a73x dev@a73x.sh.

Close reason: Fixed by patch 8d3338f9

[claude 2026-07-03] Deferred from architecture review. internal/agent/imagecache keeps every downloaded image forever (comment at imagecache.go:3 defers eviction). Implement a size-capped LRU: after a successful Ensure, evict least-recently-used images beyond a configurable cap (agent flag, default e.g. 20GB), never evicting the image just ensured. E2E: real imagecache against a real HTTP server + real filesystem; verify eviction order and that in-use image survives. --- Migrated from git-collab issue `9a31ed8f24db2260f7ceb180317c1b6b93e3e9e2`. Original author: a73x <dev@a73x.sh>. Close reason: Fixed by patch 8d3338f9
a73x commented 2026-07-04 15:41:34 +00:00 (Migrated from git.a73x.sh)

[claude 2026-07-04] Picking this up. Size-capped LRU: Ensure touches mtime on cache hit (recency signal), then evicts oldest-mtime .raw files beyond the cap, never the image just ensured (reflink copies mean running VMs don't depend on the base after create; the single-threaded reconcile loop means no concurrent create races). Agent flag --image-cache-max-gb, default 20, 0 = unlimited.

[claude 2026-07-04] Picking this up. Size-capped LRU: Ensure touches mtime on cache hit (recency signal), then evicts oldest-mtime .raw files beyond the cap, never the image just ensured (reflink copies mean running VMs don't depend on the base after create; the single-threaded reconcile loop means no concurrent create races). Agent flag --image-cache-max-gb, default 20, 0 = unlimited.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
a73x/eitri#22
No description provided.