Repository navigation
fix(media): expire playback cache without attachment ttl - #119417
Conversation
|
ClawSweeper status: review started. I am starting a fresh review of this pull request: fix(media): expire playback cache without attachment ttl This is item 1/1 in the current shard. Shard 3/20. This placeholder means the worker is alive and reading the current context. I will edit this same comment with the actual review when the claws are done clicking. Crustacean status: shell secured, claws on keyboard, evidence pebbles being sorted. |
|
Land-ready proof for
Known proof gap: no live Gateway run was needed; the changed boundary is covered with real filesystem retention tests plus Gateway fake-clock startup/hourly, failure-isolation, overlap, and timer-disposal tests. |
|
@clawsweeper re-review The initial exact-head review lease expired without replacing the placeholder. Please run a fresh review for |
|
🦞👀 Command router queued. I will update this comment with the next step. |
|
Merged via squash.
|
* origin/main: (22 commits) refactor(plugins): consolidate lifecycle hook dispatch (#119429) fix(ci): stabilize TUI PTY proof ownership (#119420) test(system-agent): reduce suite setup overhead (#119424) fix(ui): keep session rail pill status from overlapping the headline (#119397) fix(discord): avoid doctor runtime loading (#119391) fix(media): decouple playback cache retention (#119417) fix(slack): infer upload filename extensions from MIME types (#119399) refactor(channels): unify configured binding resolution (#119414) refactor(google-meet): unify gateway and tool dispatch (#119413) test(state): reuse legacy database fixtures (#119423) fix(reset): preserve bootstrap guidance for dynamic models (#119179) fix(chutes): honor serving context limits (#119196) refactor(status): consolidate scan projections and lazy loaders (#119412) fix(status): status --all slows down with missing plugins (#119203) refactor(gateway): consolidate usage reporting and caches (#119409) perf(gateway): keep reload and recovery machinery off gateway cold start (#119094) fix(cli): align TaskFlow controller columns for wide text (#118801) fix: make startup migration restart guidance install-neutral (#119406) fix(ci): preserve cache warmer shard envelopes (#119403) fix(sessions): preserve compatible auth profiles on model changes (#117550) ...
What Problem This Solves
Fixes an issue where default Gateways could keep cached playback transcodes past their fixed seven-day retention window when
attachments.ttlHourswas unset. The 512 MiB write-time quota still ran, but the age-based sweep was accidentally gated by the optional attachment cleanup setting.Why This Change Was Made
Playback cache policy now has a dedicated media-store maintenance entry point, while Gateway maintenance always owns its startup-and-hourly cadence. General attachment cleanup remains opt-in, and the two cleanup lanes have independent failure and overlap handling so a failed or hung attachment sweep cannot block playback retention.
This intentionally stays separate from the SQLite- and transcript-aware managed outgoing-media work in #119127.
User Impact
Default Gateways now enforce the playback cache's seven-day retention without requiring operators to enable broader attachment cleanup. No configuration change is required, and unrelated persisted media keeps its existing retention behavior.
Evidence
node scripts/run-vitest.mjs src/media/store.playback-cache.test.ts src/media/store.test.ts src/tts/tts-audio-store.test.ts src/gateway/server-maintenance.test.ts src/gateway/server-runtime-services.test.tsOPENCLAW_CHECK_CHANGED_REMOTE_CHILD=1 node scripts/check-changed.mjs -- src/gateway/server-maintenance.ts src/gateway/server-maintenance.test.ts src/media/store.ts src/media/store.playback-cache.test.ts docs/nodes/media-playback.mdAI-assisted: yes. The implementation, ownership boundary, tests, and documentation were inspected and validated before submission.