Skip to content

Open-source Grok Bot alternative with a virtual machine that bots can use

fix(dictation): calls point only to a listening key when Windows lacks the recognizer

AdityaUmalea3377c90f781
diff --git a/src/components/CallView.tsx b/src/components/CallView.tsx
index 224f347ff7..27b1ae01b0 100644
--- a/src/components/CallView.tsx
+++ b/src/components/CallView.tsx
@@ -27,7 +27,7 @@ import { callStarted } from "@/lib/product-events";
import { useDesktopCapabilities } from "./DesktopCapabilities";
import { callCapabilityHelp, type CallCapabilityHelp } from "@/lib/call-capability";
import { onCallStartRequest } from "@/lib/call-start-request";
-import { CALL_ENDPOINT_MS, listensHere, missingListenKey, speechBridge } from "@/lib/speech";
+import { CALL_ENDPOINT_MS, callSpeechEndNote, listensHere, missingListenKey, speechBridge } from "@/lib/speech";
import { VoiceSetupDialog } from "./lazy-screens";
import { openBotSettings } from "./bot-panel/panel-link";
import { MENU_SHEET } from "./menu-recipe";
@@ -673,15 +673,7 @@ function Call({ bot }: { bot: Bot }) {
}
if (code === 1) {
setNote(
- message ?? t(reason === "helper-build-failed"
- ? "call.turns.helperBuildFailed"
- : reason === "dictation-disabled"
- ? "composer.dictation.disabled"
- : reason === "speech-not-authorized"
- ? "call.turns.speechNotAuthorized"
- : reason === "speech-language-missing"
- ? "composer.dictation.languageMissing"
- : "composer.dictation.failed"),
+ message ?? t(callSpeechEndNote(reason)),
);
return;
}
diff --git a/src/components/GroupCallView.tsx b/src/components/GroupCallView.tsx
index 8e3dca05a1..dc2df46592 100644
--- a/src/components/GroupCallView.tsx
+++ b/src/components/GroupCallView.tsx
@@ -16,7 +16,7 @@ import { cn } from "@/lib/cn";
import { BotAvatar } from "./Avatar";
import { CallTargetButton, type CallButtonPlacement } from "./CallView";
import { useAdvancedMode } from "@/lib/interface-mode";
-import { CALL_ENDPOINT_MS, speechBridge } from "@/lib/speech";
+import { CALL_ENDPOINT_MS, callSpeechEndNote, speechBridge } from "@/lib/speech";
import { useDesktopCapabilities } from "./DesktopCapabilities";
import { isRoutineApproval, isSkillApproval, pendingApprovals, spokenApprovalPrompt } from "./PendingApproval";
import { titledCard } from "./ApprovalCard";
@@ -321,15 +321,7 @@ function GroupCall({ group, members }: { group: Group; members: Bot[] }) {
}
if (code === 1) {
setNote(
- message ?? t(reason === "helper-build-failed"
- ? "call.turns.helperBuildFailed"
- : reason === "dictation-disabled"
- ? "composer.dictation.disabled"
- : reason === "speech-not-authorized"
- ? "call.turns.speechNotAuthorized"
- : reason === "speech-language-missing"
- ? "composer.dictation.languageMissing"
- : "composer.dictation.failed"),
+ message ?? t(callSpeechEndNote(reason)),
);
return;
}
diff --git a/src/lib/speech.test.ts b/src/lib/speech.test.ts
index 42157f49d8..58f725001e 100644
--- a/src/lib/speech.test.ts
+++ b/src/lib/speech.test.ts
@@ -3,7 +3,8 @@ import { DEEPSEEK_RECORDING_MAX_MS } from "../../shared/deepseek-voice";
import type { ConfigStatus } from "@/state/store";
import { cacheDesktopCapabilities, initialDesktopCapabilities } from "./desktop";
import { createEndpointer, fishSpeech } from "./fish-speech";
-import { CALL_ENDPOINT_MS, fishListeningReady, listensHere, missingListenKey, recordsClips, scribeChosen, speechBridge } from "./speech";
+import { t } from "./i18n";
+import { CALL_ENDPOINT_MS, callSpeechEndNote, fishListeningReady, listensHere, missingListenKey, recordsClips, scribeChosen, speechBridge } from "./speech";
const withDictation = (dictation: DesktopCapabilities["dictation"]): DesktopCapabilities =>
({ ...initialDesktopCapabilities(), dictation });
@@ -173,3 +174,20 @@ describe("CALL_ENDPOINT_MS", () => {
expect(run(CALL_ENDPOINT_MS, CALL_ENDPOINT_MS + FRAME)).toBe("done");
});
});
+
+describe("call speech-end note", () => {
+ it("tells a call without a recognizer for the language to add a listening key, not to use Windows voice typing", () => {
+ const note = t(callSpeechEndNote("speech-language-missing"));
+ expect(note).toContain("Fish Audio");
+ expect(note).not.toContain("Windows key + H");
+ expect(note).not.toBe(t("composer.dictation.failed"));
+ });
+
+ it("keeps the other helper reasons' notes", () => {
+ expect(callSpeechEndNote("helper-build-failed")).toBe("call.turns.helperBuildFailed");
+ expect(callSpeechEndNote("dictation-disabled")).toBe("composer.dictation.disabled");
+ expect(callSpeechEndNote("speech-not-authorized")).toBe("call.turns.speechNotAuthorized");
+ expect(callSpeechEndNote("helper-start-failed")).toBe("composer.dictation.failed");
+ expect(callSpeechEndNote(undefined)).toBe("composer.dictation.failed");
+ });
+});
diff --git a/src/lib/speech.ts b/src/lib/speech.ts
index b3dc97f175..86b5cfa77b 100644
--- a/src/lib/speech.ts
+++ b/src/lib/speech.ts
@@ -1,5 +1,6 @@
import { DEEPSEEK_RECORDING_MAX_MS } from "../../shared/deepseek-voice";
import { keyEntry, savedState } from "@/components/keys/key-catalog";
+import type { LocaleKey } from "@/locales";
import type { ConfigStatus } from "@/state/store";
import { desktopCapabilitiesNow } from "./desktop";
import { fishSpeech, type SpeechBridge } from "./fish-speech";
@@ -77,3 +78,15 @@ export function missingListenKey(capabilities: DesktopCapabilities, config: Conf
export function listensHere(capabilities: DesktopCapabilities, config: ConfigStatus | null | undefined): boolean {
return capabilities.dictation.available && missingListenKey(capabilities, config) === null;
}
+
+/** The note a call shows when the desktop helper stops listening with an error. A call has no text field, so a
+ * missing recognizer points only to a key the server hears with, not to Windows voice typing. */
+export function callSpeechEndNote(reason: string | undefined): LocaleKey {
+ switch (reason) {
+ case "helper-build-failed": return "call.turns.helperBuildFailed";
+ case "dictation-disabled": return "composer.dictation.disabled";
+ case "speech-not-authorized": return "call.turns.speechNotAuthorized";
+ case "speech-language-missing": return "call.turns.languageMissing";
+ default: return "composer.dictation.failed";
+ }
+}
diff --git a/src/locales/en.json b/src/locales/en.json
index 80d1d554bd..d7a2c49a02 100644
--- a/src/locales/en.json
+++ b/src/locales/en.json
@@ -8999,6 +8999,7 @@
"call.turns.needsDictation": "Calls need macOS dictation, which isn't available here yet.",
"call.turns.helperBuildFailed": "The dictation helper couldn't be built. Install Apple's Command Line Tools and try again.",
"call.turns.speechNotAuthorized": "Allow Speech Recognition in System Settings → Privacy & Security, then try again.",
+ "call.turns.languageMissing": "Windows has no speech recognizer for your language that calls can use. To talk in calls, add a Fish Audio or ElevenLabs key in Settings → AI → Other services.",
"call.turns.pushToTalk": "Push to talk",
"call.turns.listening": "Listening",
"call.turns.oneMoment": "One moment",
diff --git a/src/locales/pt-br.json b/src/locales/pt-br.json
index 4fa10b5f0e..fe07af97ca 100644
--- a/src/locales/pt-br.json
+++ b/src/locales/pt-br.json
@@ -8931,6 +8931,7 @@
"call.turns.needsDictation": "As chamadas precisam do Ditado do macOS, que ainda não está disponível aqui.",
"call.turns.helperBuildFailed": "Não foi possível montar o auxiliar de ditado. Instale as Command Line Tools da Apple e tente novamente.",
"call.turns.speechNotAuthorized": "Permita o Reconhecimento de Fala em Ajustes do Sistema → Privacidade e Segurança e tente novamente.",
+ "call.turns.languageMissing": "O Windows não tem um reconhecedor de fala para o seu idioma que as chamadas possam usar. Para falar nas chamadas, adicione uma chave do Fish Audio ou do ElevenLabs em Configurações → IA → Outros serviços.",
"call.turns.pushToTalk": "Aperte para falar",
"call.turns.listening": "Ouvindo",
"call.turns.oneMoment": "Um momento",