diff --git a/apps/desktop/src/hermes.test.ts b/apps/desktop/src/hermes.test.ts index 6b4775742368..a1dc61c6095f 100644 --- a/apps/desktop/src/hermes.test.ts +++ b/apps/desktop/src/hermes.test.ts @@ -19,6 +19,7 @@ import { listSessions, listSidebarSessions, resetSidebarBatchCapability, + setApiRequestProfile, speakText, transcribeAudio } from './hermes' @@ -44,6 +45,7 @@ describe('Hermes REST helpers', () => { }) afterEach(() => { + setApiRequestProfile(null) vi.restoreAllMocks() Reflect.deleteProperty(window, 'hermesDesktop') }) @@ -337,7 +339,8 @@ describe('Hermes REST helpers', () => { expect(audioSpeakRequestTimeoutMs('x'.repeat(100_000))).toBe(AUDIO_SPEAK_MAX_REQUEST_TIMEOUT_MS) }) - it('uses an extended timeout for blocking TTS synthesis', async () => { + it('routes blocking TTS synthesis through the active profile backend', async () => { + setApiRequestProfile('rhaegal') api.mockResolvedValueOnce({ data_url: 'data:audio/mpeg;base64,AA==', mime_type: 'audio/mpeg', @@ -356,6 +359,7 @@ describe('Hermes REST helpers', () => { body: { text: 'Read this aloud' }, method: 'POST', path: '/api/audio/speak', + profile: 'rhaegal', timeoutMs: AUDIO_SPEAK_MIN_REQUEST_TIMEOUT_MS }) }) diff --git a/apps/desktop/src/hermes.ts b/apps/desktop/src/hermes.ts index 1bb60c7e3d8c..645d0c6fa3a3 100644 --- a/apps/desktop/src/hermes.ts +++ b/apps/desktop/src/hermes.ts @@ -1527,9 +1527,9 @@ export function transcribeAudio(dataUrl: string, mimeType?: string): Promise { return window.hermesDesktop.api({ + ...profileScoped(), path: '/api/audio/speak', method: 'POST', - ...profileScoped(), body: { text }, // TTS blocks until provider synthesis, file read, and base64 encoding // finish. Remote providers and large messages regularly exceed the