/
/
# What does this implement/fix? AI Radio DJ clips were dropped from the queue with misleading errors when Home Assistant's TTS failed. MA treated any TTS failure as a rejected language, logging "TTS engine rejected language 'en-US'" even for a plain server error, and the final message guessed "Does your TTS provider have enough credit?" as the diagnosis. Background: HA's `tts_get_url` endpoint currently answers every validation failure (unsupported language, invalid options) with a bare HTTP 500 instead of the intended 400 with an error body, so MA cannot always know the real reason. The errors are now classified where the response is inspected and the messages say honestly what is known. - Retry with the engine's default voice only when the language was (possibly) rejected, instead of on any error - Classify `tts_get_url` responses in the Home Assistant provider: a real "language not supported" body, a masked bare 500, and other failures each get their own error and wording - Reword the failed-render message: point at the Home Assistant core log instead of presenting the credit guess as the diagnosis - Add regression tests for the fallback helper and the new classification **Related issue (if applicable):** - related issue N/A (found via triage of nightly logs) ## Types of changes - [x] Bugfix (non-breaking change which fixes an issue) — `bugfix` - [ ] New feature (non-breaking change which adds functionality) — `new-feature` - [ ] Enhancement to an existing feature — `enhancement` - [ ] New music/player/metadata/plugin provider — `new-provider` - [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) — `breaking-change` - [ ] Refactor (no behaviour change) — `refactor` - [ ] Documentation only — `documentation` - [ ] Maintenance / chore — `maintenance` - [ ] CI / workflow change — `ci` - [ ] Dependencies bump — `dependencies` ## Checklist - [x] The code change is tested and works locally. - [x] `pre-commit run --all-files` passes. - [x] `pytest` passes, and tests have been added/updated under `tests/` where applicable. - [ ] For changes to shared models, the companion PR in `music-assistant/models` is linked. - [ ] For changes affecting the UI, the companion PR in `music-assistant/frontend` is linked. - [x] I have read and complied with the project's [AI Policy](https://github.com/music-assistant/.github/blob/main/AI_POLICY.md) for any AI-assisted contributions. - [ ] I have [raised a PR against the documentation repository](https://github.com/music-assistant/music-assistant.io/blob/main/CONTRIBUTING.md) targeting the main or beta branch as appropriate.