fix(stt): gate local fallback on installed engine and extract SidecarSupervisor
This commit is contained in:
parent
4588b65dfa
commit
2cd462333f
7 changed files with 1057 additions and 343 deletions
|
|
@ -651,7 +651,8 @@ describe('Complex User Journeys & Multi-Provider STT Orchestration (105 Scenario
|
|||
expect(res.text).toBe('타임아웃 로컬 대체')
|
||||
})
|
||||
|
||||
it('50. Provider returning empty text triggers fallback or error', async () => {
|
||||
// 무음(빈 전사)은 로컬로 다시 돌려도 결과가 같으므로 폴백하지 않고 STTNoAudioData 로 끝난다.
|
||||
it('50. Provider returning empty text ends with no-audio error and skips local fallback', async () => {
|
||||
const mgr = getSTTManager()
|
||||
mgr.setProvider('openai')
|
||||
mgr.setProviderConfig('openai', { apiKey: 'sk-test' })
|
||||
|
|
@ -667,7 +668,7 @@ describe('Complex User Journeys & Multi-Provider STT Orchestration (105 Scenario
|
|||
)
|
||||
|
||||
const { getLocalSTTService } = await import('../../src/main/services/LocalSTTService')
|
||||
vi.spyOn(getLocalSTTService(), 'transcribe').mockResolvedValue({
|
||||
const localTranscribe = vi.spyOn(getLocalSTTService(), 'transcribe').mockResolvedValue({
|
||||
text: '빈값 감지 후 로컬 복구',
|
||||
language: 'ko',
|
||||
duration: 1.0,
|
||||
|
|
@ -675,11 +676,11 @@ describe('Complex User Journeys & Multi-Provider STT Orchestration (105 Scenario
|
|||
segments: [],
|
||||
})
|
||||
|
||||
const res = await mgr.transcribe(makePcmBuffer(1.0))
|
||||
expect(res.text).toBe('빈값 감지 후 로컬 복구')
|
||||
await expect(mgr.transcribe(makePcmBuffer(1.0))).rejects.toMatchObject({ code: ErrorCode.STTNoAudioData })
|
||||
expect(localTranscribe).not.toHaveBeenCalled()
|
||||
})
|
||||
|
||||
it('51. Provider returning null text triggers fallback', async () => {
|
||||
it('51. Provider returning null text ends with no-audio error and skips local fallback', async () => {
|
||||
const mgr = getSTTManager()
|
||||
mgr.setProvider('custom')
|
||||
mgr.setProviderConfig('custom', { baseUrl: 'http://custom:8000' })
|
||||
|
|
@ -695,7 +696,7 @@ describe('Complex User Journeys & Multi-Provider STT Orchestration (105 Scenario
|
|||
)
|
||||
|
||||
const { getLocalSTTService } = await import('../../src/main/services/LocalSTTService')
|
||||
vi.spyOn(getLocalSTTService(), 'transcribe').mockResolvedValue({
|
||||
const localTranscribe = vi.spyOn(getLocalSTTService(), 'transcribe').mockResolvedValue({
|
||||
text: '널값 감지 로컬 복구',
|
||||
language: 'ko',
|
||||
duration: 1.0,
|
||||
|
|
@ -703,8 +704,8 @@ describe('Complex User Journeys & Multi-Provider STT Orchestration (105 Scenario
|
|||
segments: [],
|
||||
})
|
||||
|
||||
const res = await mgr.transcribe(makePcmBuffer(1.0))
|
||||
expect(res.text).toBe('널값 감지 로컬 복구')
|
||||
await expect(mgr.transcribe(makePcmBuffer(1.0))).rejects.toMatchObject({ code: ErrorCode.STTNoAudioData })
|
||||
expect(localTranscribe).not.toHaveBeenCalled()
|
||||
})
|
||||
|
||||
it('52. Local Whisper execution failure throws STTTranscriptionFailed', async () => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue