fix(onboarding): 무진행 구간 UX + 중복 실행 가드
Some checks failed
Build macOS / Build & Package (macOS) (push) Failing after 3s
Build macOS / Build & Package (macOS)-1 (push) Failing after 5s

- verifying/manifest 상태(바이트 진행률 없음)에서 인디터미넌트 바 + 친화적 문구
  — 9.6GB 검증 ~2분간 멈춘 것처럼 보이던 문제 해소
- OnboardingModal 중복 실행 가드 (runningRef)
- LocalLLMService.pullModel: 동일 모델 동시 pull은 기존 promise 합류
- LocalSTTService.downloadModel: /download 409는 실패가 아닌 기존 진행 합류
This commit is contained in:
Yun Chan 2026-07-21 18:02:26 +09:00
parent 64c1d3709b
commit 0b9e67afe9
6 changed files with 86 additions and 35 deletions

View file

@ -98,6 +98,8 @@ function stripReasoningBlocks(text: string): string {
class LocalLLMService extends EventEmitter {
private _state = LLMState.Unavailable
/** 모델별 진행 중 pull — 중복 요청은 기존 promise에 합류 */
private _pullInFlight = new Map<string, Promise<void>>()
private _pollInterval: ReturnType<typeof setInterval> | null = null
private _available = false
private _abortController: AbortController | null = null
@ -497,6 +499,20 @@ class LocalLLMService extends EventEmitter {
* @param modelId : 'gemma4:e4b'
*/
async pullModel(modelId: string): Promise<void> {
// 동일 모델 동시 pull 방지 — 진행 중이면 같은 promise에 합류
const inFlight = this._pullInFlight.get(modelId)
if (inFlight) {
logger.info(`Pull 진행 중 재요청 — 기존 작업에 합류: ${modelId}`)
return inFlight
}
const task = this._doPullModel(modelId).finally(() => {
this._pullInFlight.delete(modelId)
})
this._pullInFlight.set(modelId, task)
return task
}
private async _doPullModel(modelId: string): Promise<void> {
const serverUrl = configGet('ollamaServerUrl')
logger.info(`Pull 시작: ${modelId}`)