archived sessions should get their kvcache slice delete to make space #60

Closed
opened 2026-07-28 16:50:01 +00:00 by hugo · 1 comment
Owner

the archived sessions should have kvcache files removed to free up disc space. when an archived session is actually used (as in a message is sent), then the kvcache context is rebuilt and the session is automatically unarchived. this makes the lifecycle clear: pinned and normal sessions are active and have kvcache primed and ready. archived have still their session available for lookup, but no kvcache and have to rebuild on use. deleted sessions lose both kvcache and session data.

the archived sessions should have kvcache files removed to free up disc space. when an archived session is actually used (as in a message is sent), then the kvcache context is rebuilt and the session is automatically unarchived. this makes the lifecycle clear: pinned and normal sessions are active and have kvcache primed and ready. archived have still their session available for lookup, but no kvcache and have to rebuild on use. deleted sessions lose both kvcache and session data.
hugo added the enhancement label 2026-07-28 16:50:01 +00:00
Author
Owner

Implemented in eaa2fcf. Archiving now refuses active generations and strictly removes every session-owned KV stage (.bin, .tmp, and .compacting), with immediate cache-metric refresh and explicit filesystem errors. Missing disk checkpoints now invalidate matching resident KV state, so reopening an archived session really prefills from persisted chat instead of taking a memory hit. Persisting the next user turn—or a required compaction before that turn—atomically changes archived sessions back to normal and refreshes the sidebar, with a visible rebuild notice on the direct turn path. Session/project deletion and manual rebuild now share the same complete checkpoint cleanup. This archived lifecycle is a DS4Server feature; DS4 has no matching archive UI. Verified with isolated cleanup/reactivation tests and the full commit gates: rustfmt, Clippy with warnings denied, app bundle, and all-feature tests (152 passed, 12 hardware/model tests ignored).

Implemented in eaa2fcf. Archiving now refuses active generations and strictly removes every session-owned KV stage (.bin, .tmp, and .compacting), with immediate cache-metric refresh and explicit filesystem errors. Missing disk checkpoints now invalidate matching resident KV state, so reopening an archived session really prefills from persisted chat instead of taking a memory hit. Persisting the next user turn—or a required compaction before that turn—atomically changes archived sessions back to normal and refreshes the sidebar, with a visible rebuild notice on the direct turn path. Session/project deletion and manual rebuild now share the same complete checkpoint cleanup. This archived lifecycle is a DS4Server feature; DS4 has no matching archive UI. Verified with isolated cleanup/reactivation tests and the full commit gates: rustfmt, Clippy with warnings denied, app bundle, and all-feature tests (152 passed, 12 hardware/model tests ignored).
hugo closed this issue 2026-07-28 17:20:35 +00:00
Sign in to join this conversation.