Commit graph

3 commits

Author SHA1 Message Date
윤찬
9d12133cfe fix(desktop): qwen3 reasoning 모드로 LLM refine 39초 + 빈 응답
증상:
- STT 426ms로 빠른데 LLM refine 단계가 39초 소요 후 빈 문자열 반환
- _completeSession('') → finalText.length === 0이라 paste 호출 자체 건너뜀
- 사용자에게는 '느리고 paste 안 됨'으로 보임

원인:
- 사용자가 ollama pull qwen3:4b 한 직후 첫 호출 (모델 cold start 일부 있음)
- qwen3는 reasoning model이라 응답에 <think>...</think> 블록을 길게 출력
- system prompt에 '/no_think' 토큰 없음 → reasoning mode ON
- generate()는 data.response.trim() 그대로 반환 → think 블록 + 빈 본문이면
  trim 후 빈 문자열
- 빈 문자열에 대한 fallback이 없어서 그대로 _completeSession('')

수정:
- SYSTEM_PROMPTS 모두에 '/no_think' 헤더 추가
  - qwen3 reasoning 비활성화 → 응답 속도 대폭 단축
  - 다른 모델(llama, mistral, gemma)은 토큰 무시 → 호환성 OK
- stripReasoningBlocks() 추가
  - <think>...</think> + <thinking>...</thinking> 블록 제거 (gi flag)
  - /no_think를 무시하는 모델 + 응답에 think tag가 섞여 들어오는 케이스 안전망
- processText() 결과:
  - stripReasoningBlocks(result.text)
  - 빈 문자열이면 원본 transcript fallback + warn 로그
2026-04-11 09:28:55 +09:00
yunchan8804
3b0eb3393b feat(V2-1b): packages/core 추출 — 공유 타입/에러/채널/유틸 분리
packages/core (@d3ro/core) 신규 생성:
- types.ts, errors.ts, ipc-channels.ts, constants.ts (shared에서 이동)
- utils/meeting-markdown.ts, utils/markdown-to-docx.ts (main/utils에서 이동)
- subpath exports 정의 (./types, ./errors, ./ipc-channels, ./constants,
  ./utils/meeting-markdown, ./utils/markdown-to-docx)
- src/index.ts barrel export 추가
- docx를 core 자체 dependency로 선언

apps/desktop 연결:
- package.json에 @d3ro/core: '*' dep 추가
- tsconfig.node/web.json paths에 @d3ro/core/* 추가
- electron.vite.config.ts 3개 섹션 alias 추가 (main/preload/renderer)
- externalizeDepsPlugin exclude에 @d3ro/core (workspace 소스 번들 대상)
- vitest.config.ts alias 추가

일괄 치환 (79 파일, 167건):
- @shared/{types,errors,ipc-channels,constants} → @d3ro/core/*
- static/dynamic import + type expression import 모두 포함
- MeetingModeService.ts의 ../utils/* 상대 경로 → @d3ro/core/utils/*
- @shared/theme-vars는 V2-1c 범위로 남김 (WindowManager만 사용)

M1 수정 포함:
- electron.vite.config.ts의 resolve('src/shared') → resolve(__dirname, ...)
  CWD 독립적으로 동작하도록 견고화

검증:
- typecheck 통과
- build 통과 (main+preload+renderer)
- dev 런타임 → DB/핫키/Ollama 모두 정상, 기존 데이터 연속성 유지
2026-04-08 14:39:46 +09:00
yunchan8804
45a580878a feat(V2-1a): Monorepo 구조 전환 — apps/desktop으로 V1 이동
- npm workspaces 루트 (apps/*, packages/*) 세팅
- V1 전체를 apps/desktop/으로 git mv (src, resources, tests, sidecar,
  scripts, electron.vite.config.ts, electron-builder.yml, vitest.config.ts,
  tsconfig.node.json, tsconfig.web.json)
- apps/desktop/package.json 신규 (name=@d3ro/desktop)
- productName: 'd3ro-voice' 명시 — app.getName()을 고정하여 userData 경로
  %APPDATA%\d3ro-voice\ 그대로 유지 (기존 DB/설정 연속성 보장)
- 루트 package.json을 workspace 루트로 재구성, 공통 devDep만 유지
  (typescript, eslint, prettier)
- turbo.json, tsconfig.base.json 추가 (Turborepo 자체 설치는 별도 sub-phase)
- memory/project_status.md 생성 (규칙 13)

검증:
- npm run typecheck 통과
- npm run build 통과 (electron-vite main+preload+renderer)
- npm run dev 실제 실행 → DB/핫키/Ollama 자동 실행 모두 정상
2026-04-08 14:04:41 +09:00
Renamed from src/main/services/LocalLLMService.ts (Browse further)