Repository navigation
Fail closed when TTS writes empty audio or list-valued strings - #99
Merged
Merged
Conversation
A 0-byte mp3 after synthesize_speech was treated as success. Reject list-valued tts.model / voice / instructions at config load, raise on empty provider output (unlink the file), and reject an empty xAI TTS body. Co-authored-by: jmjava <jmjava@gmail.com>
Local ruff, pytest, and docgen benchmark are green on this branch. Co-authored-by: jmjava <jmjava@gmail.com>
jmjava
marked this pull request as ready for review
September 7, 2026 20:27
This was referenced Sep 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
TTSGeneratorprinted Wrote aftersynthesize_speecheven when the provider wrote a 0-byte mp3. Downstream timestamps then ran against empty audio. Chat already fails closed on empty text; TTS did not.tts.model/tts.voice/tts.instructionsas a YAML list also loaded and were passed to the API (instructions:as a bullet list is a common typo).Change
tts.model/tts.voicemust be non-empty YAML strings.tts.instructionsmust be a YAML string (empty string allowed).TTSErrorand the empty file is removed.AIErroron an empty HTTP body (does not write the file).Milestone:
milestones/tts-empty-audio.md. Also marksav-sync-scene-specas shipped (#98).Out of scope
wizard.system_prompt/llm_modeltype gating is separate.Gates
ruff check src/ tests/pytest tests/docgen benchmark(no clock change; no--update-baseline)