mirror of
https://github.com/getpaseo/paseo.git
synced 2026-10-27 11:42:52 +00:00
Provider images were materialized into a per-process directory created with mkdtemp(os.tmpdir(), "paseo-attachments-"). The OS reaps that location -- macOS clears /var/folders after roughly three days -- so every image in a transcript older than the reap window was silently orphaned: the stored markdown still pointed at a path whose bytes no longer existed, and nothing could recreate them. Materialize into resolvePaseoHome()/paseo-attachments/ instead. The directory keeps its 0700 mode and the files their 0600 mode, and the basename is unchanged so PROVIDER_IMAGE_MARKDOWN still matches history written by older builds (the optional "-<suffix>" group covers the old mkdtemp shape). A stable directory is no longer self-limiting, so add a best-effort sweep of entries older than 30 days, run once per process on the first image materialized. Re-materializing an image rewrites it and refreshes its mtime, so images still being rendered keep themselves alive and only genuinely cold ones age out. This also makes the existing content-hash filename deduplication work across daemon restarts; previously it only held within a single process. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>