From cfb8aab77d2eab42d4586ef8a5494775200744df Mon Sep 17 00:00:00 2001 From: Daniel Date: Sat, 12 Sep 2026 05:05:39 +0200 Subject: [PATCH] fix: /api/health/detailed reported a text-to-speech provider that does not exist MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The endpoint answered from environment variables of its own rather than from the speech code, so ELEVENLABS_API_KEY being set made it report tts: 'elevenlabs'. There is no ElevenLabs path in ttsProvider.js — getTTSProvider() only ever returns 'litellm' or 'none' — so the one endpoint an operator checks to find out what speech is doing was reporting a provider this app cannot use. Likewise whisper: OPENAI_API_KEY, which stopped describing STT when transcription moved behind the gateway. Both now ask getSTTProvider() and getTTSProvider(), the same functions the routes ask, so the answer cannot drift from behaviour again. Removed the two other ElevenLabs leftovers: the FAQ told users their notes were read aloud by "Google, OpenAI, or ElevenLabs", and a TTS test used 'elevenlabs' as its sample value for the passthrough of TTS_PROVIDER, which implied the provider was supported. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01Dv6sqaY6Vq3ChZHMem3cnU --- public/components/faq.html | 2 +- server.js | 8 ++++++-- test/tts-provider.test.js | 4 ++-- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/public/components/faq.html b/public/components/faq.html index 49611c5e..6661ad61 100644 --- a/public/components/faq.html +++ b/public/components/faq.html @@ -124,7 +124,7 @@
-

Yes. Click the Read button on any generated note to hear it spoken aloud. This uses text-to-speech (TTS) powered by Google, OpenAI, or ElevenLabs depending on your setup. You can choose your preferred voice in Settings > Voice Preferences.

+

Yes. Click the Read button on any generated note to hear it spoken aloud. Which voice engine does the speaking depends on what your administrator has configured. You can choose your preferred voice in Settings > Voice Preferences.

diff --git a/server.js b/server.js index 2ebf4d30..bad23431 100644 --- a/server.js +++ b/server.js @@ -308,8 +308,12 @@ app.get('/api/health/detailed', _hcAuth, _hcAdmin, (req, res) => { bedrock: process.env.AWS_BEDROCK_REGION ? 'configured' : 'not configured', azure: process.env.AZURE_OPENAI_ENDPOINT ? 'configured' : 'not configured', litellm: process.env.LITELLM_API_BASE ? 'configured' : 'not configured', - whisper: process.env.OPENAI_API_KEY ? 'configured' : 'missing', - tts: process.env.LITELLM_API_BASE ? 'litellm' : (process.env.ELEVENLABS_API_KEY ? 'elevenlabs' : 'none') + // Asked of the same functions the routes ask, so this cannot drift from what + // speech actually does. It used to answer from environment variables of its + // own and would report tts: 'elevenlabs' for a provider that does not exist + // in this app — a health check that lies is worse than one that is absent. + stt: require('./src/utils/sttProvider').getSTTProvider(), + tts: require('./src/utils/ttsProvider').getTTSProvider() }); }); diff --git a/test/tts-provider.test.js b/test/tts-provider.test.js index c547589b..79ed56cb 100644 --- a/test/tts-provider.test.js +++ b/test/tts-provider.test.js @@ -27,8 +27,8 @@ test('TTS provider defaults to LiteLLM when gateway is configured', () => { test('TTS provider ignores non-LiteLLM provider overrides', () => { const ttsProvider = require('../src/utils/ttsProvider'); - withEnv({ TTS_PROVIDER: 'elevenlabs', LITELLM_API_BASE: 'https://llm.example.com' }, () => { - assert.equal(ttsProvider.getTTSEnvProvider(), 'elevenlabs'); + withEnv({ TTS_PROVIDER: 'some-other-provider', LITELLM_API_BASE: 'https://llm.example.com' }, () => { + assert.equal(ttsProvider.getTTSEnvProvider(), 'some-other-provider'); assert.equal(ttsProvider.getTTSProvider(), 'litellm'); }); });