fix: harden custom TTS URL handling and availability checks

Validate and normalize custom TTS server URLs before proxying requests.
Gate server TTS availability by provider mode to avoid OpenAI/custom misrouting.
Keep browser and message TTS hooks aligned with the new provider-specific checks.
This commit is contained in:
Bohdan Triapitsyn
2026-04-12 10:38:16 +03:00
parent 055b6f6af0
commit c7f1501ad2
5 changed files with 36 additions and 8 deletions
+1
View File
@@ -44,6 +44,7 @@ export function useMessageTTS(): UseMessageTTSReturn {
const { speak: speakServerTTS, stop: stopServerTTS, isAvailable: isServerTTSAvailable } = useServerTTS({
enabled: shouldCheckOpenAIAvailability,
availabilityMode: voiceProvider === 'openai-compatible' ? 'openai-compatible' : 'openai',
});
const { speak: speakSayTTS, stop: stopSayTTS, isAvailable: isSayTTSAvailable } = useSayTTS({
enabled: shouldCheckSayAvailability,