fix(voice): 받아쓰기 파이프라인 4버그 수정 + 실시간 부분 전사

- press가 STT 초기화를 await하며 action queue 점유 → release 수십 초 지연·
  유령 세션 반복 버그 수정 (initSTT fire-and-forget)
- 프리플라이트: STT 모델 미설치 시 즉시 에러 + 메인 UI 경고 + 온보딩 오픈
- 사이드카: 기동 중 프로세스 사망 시 30초 대기 없이 즉시 실패,
  restartCount 리셋, error 리스너 부재 미처리 예외 방지
- 실시간 부분 전사: 1.5s 간격 interim → RecordingTip에 말하는 내용 미리보기
- Ollama 미가용 후처리 스킵 시 warning 배너, voice:error 브로드캐스트 신설
This commit is contained in:
Yun Chan 2026-07-21 20:56:40 +09:00
parent e0a1864e60
commit fd46ac7b14
13 changed files with 280 additions and 16 deletions

View file

@ -4,9 +4,30 @@ import { ipcMain } from 'electron'
import { IPC_CHANNELS } from '@d3ro/core/ipc-channels'
import { ipcSuccess, ipcError, ErrorCode } from '@d3ro/core/errors'
import { getVoiceModeService } from '../services/VoiceModeService'
import type { StartRecordingParams, StopRecordingParams, CancelRecordingParams, SetVoiceModeParams } from '@d3ro/core/types'
import { getMainWindow } from '../windows/WindowManager'
import type { StartRecordingParams, StopRecordingParams, CancelRecordingParams, SetVoiceModeParams, VoiceErrorEvent } from '@d3ro/core/types'
function safeSendToRenderer(channel: string, data: unknown): void {
const win = getMainWindow()
if (win && !win.isDestroyed()) {
win.webContents.send(channel, data)
}
}
export function registerVoiceHandlers(): void {
// 음성 세션 에러/경고를 메인 윈도우로 브로드캐스트 —
// 모델 미설치/엔진 실패 등의 경고가 recording tip(3초) 외에도
// 메인 UI에서 명확히 보이도록 (설계서 02 voice:error 이벤트)
getVoiceModeService().on('error', (payload) => {
const event: VoiceErrorEvent = {
sessionId: payload.session?.id ?? null,
errorCode: payload.error.code,
message: payload.error.message,
severity: payload.severity ?? 'error',
}
safeSendToRenderer(IPC_CHANNELS.VOICE.ERROR, event)
})
ipcMain.handle(IPC_CHANNELS.VOICE.START_RECORDING, async (_event, params: StartRecordingParams) => {
try {
const voice = getVoiceModeService()