fix(tts): stop the hourly cache sweep from deleting TTS voice memos - #100120
Sahilvishnaliya wants to merge 1 commit into
Conversation
text_to_speech documented ~/voice-memos/ as the CLI output location, but every surface writes to the gateway audio cache - the same directory cleanup_audio_cache sweeps once per hour with a 24h max age. A generated voice memo was silently deleted ~24h later while the tool contract promised persistence; the failure was invisible until the user went looking for the file. Contract and behavior were opposites (NousResearch#100075). Fix, maintainer's option 2: (a) the shared _cleanup_cache_dir now takes sticky_prefixes and cleanup_audio_cache excludes TTS-produced tts_* files from the sweep - memos persist; (b) docstring and tool-schema description now state the real default output dir and the sweep exemption instead of the fictional ~/voice-memos/. Fixes NousResearch#100075.
Clean fix for #100075: Non-blocking: exempt files now accumulate in Non-blocking: the test asserts Verdict: LGTM |
|
Exact-head KEEP on #100120 head e9613f3. KEEP stopping CHECK: gateway ephemeral auto-TTS cache still sweeps. CHECK: documented |
Fixes #100075
Problem
text_to_speechdocumented~/voice-memos/as the CLI output location (docstringtts_tool.py:3514+ tool schema:4500), but every surface writes to the gateway audio cache — the same directorycleanup_audio_cachesweeps once per hour with a 24h max age (gateway/run.pyhousekeeping →base.py:1133). A generated voice memo was silently deleted ~24h later while the tool contract promised persistence; the failure was invisible until the user went looking for the file. Contract and behavior were exact opposites.Fix (maintainer's option 2 from the issue)
(a) Make memos survive the sweep:
_cleanup_cache_dirgainssticky_prefixes;cleanup_audio_cachepasses("tts_",)— TTS-generated files are namedtts_{timestamp}.{fmt}bytts_tool.py:3250-3256, so the prefix cleanly separates user artifacts from inbound platform voice notes (which remain swept as before).(b) Fix the contract: docstring and tool-schema description now state the real default output dir (
~/.hermes/cache/audio) and the sweep exemption, instead of the fictional~/voice-memos/.Verification
tests/gateway/test_audio_cache.py: 7/7 pass, including the new regression test — atts_*file backdated 48h (past the 24h cutoff) survives the sweep while the existing old-file removal tests stay green.