Skip to content

fix(media): expire playback cache without attachment ttl - #119417

Merged
steipete merged 1 commit into
mainfrom
steipete/playback-cache-retention-lifecycle-520e03
Aug 5, 2026
Merged

steipete merged 1 commit into
mainfrom
steipete/playback-cache-retention-lifecycle-520e03

Conversation

@steipete

@steipete steipete commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes an issue where default Gateways could keep cached playback transcodes past their fixed seven-day retention window when attachments.ttlHours was 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.ts
  • OPENCLAW_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.md
  • Codex autoreview: clean, no accepted/actionable findings.
  • Production TypeScript delta: +4 lines net; test delta: +75 lines net.

AI-assisted: yes. The implementation, ownership boundary, tests, and documentation were inspected and validated before submission.

@steipete
steipete marked this pull request as ready for review August 5, 2026 02:20
@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation gateway Gateway runtime size: S maintainer Maintainer-authored PR labels Aug 5, 2026
@clawsweeper

clawsweeper Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

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.

@steipete

steipete commented Aug 5, 2026

Copy link
Copy Markdown
Contributor Author

Land-ready proof for c3e3f01e14f1ff5c57cece208d11088b9c3b04c1:

  • Focused lifecycle and media-store proof: 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.ts — 109 tests passed.
  • Post-rebase focused proof: node scripts/run-vitest.mjs src/media/store.playback-cache.test.ts src/gateway/server-maintenance.test.ts — 31 tests passed.
  • Changed-file validation passed for the five touched files. Crabbox/Testbox had no ready provider, so trusted-source validation used the documented local fallback.
  • Codex autoreview on the exact rebased branch was clean with no accepted/actionable findings.
  • Exact-head CI is green: https://github.com/openclaw/openclaw/actions/runs/30969067725
  • Review artifacts validate as READY FOR /prepare-pr with zero findings.

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.

@steipete

steipete commented Aug 5, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

The initial exact-head review lease expired without replacing the placeholder. Please run a fresh review for c3e3f01e14f1ff5c57cece208d11088b9c3b04c1.

@clawsweeper

clawsweeper Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Command router queued. I will update this comment with the next step.

@steipete
steipete merged commit 22de30f into main Aug 5, 2026
177 of 183 checks passed
@steipete
steipete deleted the steipete/playback-cache-retention-lifecycle-520e03 branch August 5, 2026 02:57
@steipete

steipete commented Aug 5, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

vincentkoc added a commit that referenced this pull request Aug 5, 2026
* 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)
  ...
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Improvements or additions to documentation gateway Gateway runtime maintainer Maintainer-authored PR size: S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant