diff --git a/.vscode/settings.json b/.vscode/settings.json index a29ea0823..b7bdac6f7 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -57,5 +57,10 @@ "appimage", "localforage" ], - "vitest.disableWorkspaceWarning": true + "vitest.disableWorkspaceWarning": true, + "editor.quickSuggestions": { + "comments": "off", + "strings": "off", + "other": "off" + } } diff --git a/apps/stage-tamagotchi/src/renderer/pages/index.vue b/apps/stage-tamagotchi/src/renderer/pages/index.vue index 8c98d5da9..d489f3deb 100644 --- a/apps/stage-tamagotchi/src/renderer/pages/index.vue +++ b/apps/stage-tamagotchi/src/renderer/pages/index.vue @@ -328,11 +328,10 @@ const { activeTranscriptionModel, activeTranscriptionProvider } = storeToRefs(he const hearingPipeline = useHearingSpeechInputPipeline() const { removeStreamingTranscriptionConsumer, transcribeForMediaStream, stopStreamingTranscription } = hearingPipeline const { error: transcriptionError, supportsStreamInput } = storeToRefs(hearingPipeline) +const transcriptionConsumerId = 'stage-tamagotchi:voice-input' const chatStore = useChatStore() const chatSession = useChatSessionStore() const streamingTranscriptionUnavailable = ref(false) -/** Identifies this page in the shared streaming transcription session. */ -const transcriptionConsumerId = 'stage-tamagotchi:voice-input' const shouldUseStreamInput = computed(() => supportsStreamInput.value && !!stream.value && !streamingTranscriptionUnavailable.value) const voiceTranscriptBuffer = createTranscriptBuffer({ flushDelayMs: 1200, @@ -575,7 +574,7 @@ function handleStreamingSentenceEnd(delta: string) { void sendVoiceInputTextToChat(finalText) } -/** Replaces the speaker caption with the provider's current volatile transcript. */ +/** Replaces the caption with the provider's current volatile transcript. */ function handleStreamingTranscriptionUpdate(text: string) { if (isVoiceInputSuppressed()) return @@ -648,14 +647,12 @@ async function startAudioInteractionConsumers() { }) if (inspectVoiceInputStreamingRequestGate().skip) { - removeStreamingTranscriptionConsumer(transcriptionConsumerId) await stopStreamingTranscription(true) return } if (transcriptionError.value) { streamingTranscriptionUnavailable.value = true - removeStreamingTranscriptionConsumer(transcriptionConsumerId) await stopStreamingTranscription(true) console.warn('[Main Page] Streaming transcription unavailable; using recorder-backed fallback:', transcriptionError.value) } @@ -674,7 +671,6 @@ async function stopAudioInteractionConsumers(options: StopAudioInteractionOption clearAssistantSpeechResumeTimer() clearHearingInput() voiceInputGeneration += 1 - removeStreamingTranscriptionConsumer(transcriptionConsumerId) await Promise.all([ stopStreamingTranscription(true), @@ -742,6 +738,7 @@ onMounted(() => { }) onUnmounted(() => { + removeStreamingTranscriptionConsumer(transcriptionConsumerId) for (const [timer, sourceId] of hearingInputClearTimers) { clearTimeout(timer) clearHearingInput(sourceId)