Skip to content

Dodaios is an open-source agent OS for your desktop: it runs your coding agents, browser and apps by voice or chat, on your own machine. Formerly Personal Jarvis.

@ feat(voice): a switch for precision mode in the Voice Hub

rubenluetke10-beep4a2e9829eba7
diff --git a/jarvis/ui/web/frontend/src/hooks/useDictation.ts b/jarvis/ui/web/frontend/src/hooks/useDictation.ts
index 2b01cff02b..301212c688 100644
--- a/jarvis/ui/web/frontend/src/hooks/useDictation.ts
+++ b/jarvis/ui/web/frontend/src/hooks/useDictation.ts
@@ -306,6 +306,17 @@ export interface DictationSettings {
/** neutral | messaging | email — register only, never a licence to change
* meaning. */
polish_style: string;
+ /**
+ * Also sharpen the WORD CHOICE, not just the writing: a vague placeholder
+ * becomes the specific word that was meant, padding collapses into the plain
+ * verb. Simple and exact, never ornate.
+ *
+ * Ships OFF, and unlike `polish_style` this is not a matter of taste — it
+ * relaxes the guard that rejects an answer in which an uncommon word
+ * vanished, because replacing uncommon words is exactly what it licenses.
+ * Applies to a translated dictation too, through the same prompt clause.
+ */
+ polish_precision: boolean;
/**
* Deliver every dictation in `translate_target`, whatever language was
* spoken. Ships OFF: it changes which words come out, not just how they are
diff --git a/jarvis/ui/web/frontend/src/i18n/locales/de.json b/jarvis/ui/web/frontend/src/i18n/locales/de.json
index 873cad8222..ed82e3b2fa 100644
--- a/jarvis/ui/web/frontend/src/i18n/locales/de.json
+++ b/jarvis/ui/web/frontend/src/i18n/locales/de.json
@@ -364,6 +364,9 @@
"title": "Formulierung aufräumen",
"description": "Ein schnelles Modell schreibt die Struktur um — Satzzeichen, Groß- und Kleinschreibung, Füllwörter und Satzgrenzen. Deine genauen Worte und ihr Sinn bleiben erhalten, und der Rohtext steht immer in deinem Verlauf.",
"sends_text": "Solange das an ist, geht dein fertiger Text an das Modell, das du unten auswählst; wenn deine Spracherkennung ohnehin auf diesem Rechner läuft, bleibt auch das Aufräumen hier, außer du wählst selbst ein Cloud-Modell. Dein Rohtext bleibt immer in deinem Verlauf, genau so, wie er erkannt wurde.",
+ "precision_title": "Wortwahl schärfen",
+ "precision_description": "Geht einen Schritt weiter und ändert auch, WELCHE Wörter benutzt werden: Ein vager Platzhalter wird zu dem Wort, das du wirklich gemeint hast, und Füllkonstruktionen werden zum einfachen Verb — aus „eine Entscheidung treffen“ wird „entscheiden“. Einfach und genau. Nie ein längeres Wort, nur damit es klüger klingt.",
+ "precision_tradeoff": "Dafür wird eine Sicherheitsprüfung gelockert: Ungewöhnliche Wörter dürfen jetzt ersetzt werden, ein falsch verstandenes Wort wird also eher ausgetauscht als angezeigt. Deine Namen, deine Zahlen und deine Wörterbuch-Einträge bleiben geschützt, und der Originaltext bleibt immer erhalten. Gilt auch für übersetzte Diktate.",
"provider_label": "Modell",
"provider_auto": "Automatisch — nimm den Schlüssel, den ich habe",
"provider_hint": "Automatisch nimmt einen Schlüssel, den du ohnehin hast, und wechselt zu einem anderen Anbieter, wenn einer am Limit oder ohne Guthaben ist. Feste Wahl nur, wenn ein bestimmtes Konto abgerechnet werden soll.",
@@ -1163,6 +1166,8 @@
"managed_server_port_conflict": "Ein anderer Prozess belegt diesen Port",
"managed_start_cta": "Server starten",
"managed_stop_cta": "Server stoppen",
+ "managed_brain_recheck": "Aktuelles Denkmodell übernehmen",
+ "managed_brain_recheck_hint": "Prüft neu, welches Ollama-Modell auf diese Maschine passt, und stellt das Server-Gehirn darauf um — ohne Neuinstallation. Gilt ab dem nächsten Server-Start.",
"shared_delete_prefix": "Dieser Schlüssel wird auch verwendet von:",
"shared_delete_suffix": "Beim Löschen werden auch diese Provider deaktiviert.",
"delete_anyway": "Trotzdem löschen",
diff --git a/jarvis/ui/web/frontend/src/i18n/locales/en.json b/jarvis/ui/web/frontend/src/i18n/locales/en.json
index 7e322806a3..e0729ab3db 100644
--- a/jarvis/ui/web/frontend/src/i18n/locales/en.json
+++ b/jarvis/ui/web/frontend/src/i18n/locales/en.json
@@ -364,6 +364,9 @@
"title": "Clean up my wording",
"description": "A fast model rewrites the structure — punctuation, capitalization, filler words and sentence breaks. Your exact words and their meaning are kept, and the raw text is always saved in your history.",
"sends_text": "While this is on, your finished transcript is sent to the model you pick below; if your speech recognition already runs on this computer, the wording pass stays here too unless you choose a cloud model yourself. Your raw text is always kept in your history, exactly as it was recognized.",
+ "precision_title": "Sharpen my word choice",
+ "precision_description": "Goes one step further and also changes WHICH words are used: a vague placeholder becomes the word you actually meant, and padding collapses into the plain verb — \"make a decision\" becomes \"decide\". Simple and exact. It will never swap a normal word for a longer one just to sound impressive.",
+ "precision_tradeoff": "In exchange, one safety check is relaxed: replacing an unusual word is now allowed, so a word the model misheard can be replaced rather than flagged. Your names, your numbers and your dictionary terms stay protected, and the original transcript is always kept. Applies to translated dictation too.",
"provider_label": "Model",
"provider_auto": "Automatic — use whichever key I have",
"provider_hint": "Automatic takes a key you already have and moves to a different provider when one is rate-limited or out of credit. Pin one only if you want a specific account billed.",
@@ -1163,6 +1166,8 @@
"managed_server_port_conflict": "Another process is serving this port",
"managed_start_cta": "Start server",
"managed_stop_cta": "Stop server",
+ "managed_brain_recheck": "Use current brain model",
+ "managed_brain_recheck_hint": "Re-check which Ollama model fits this machine and switch the server's brain to it — no reinstall. Takes effect on the next server start.",
"shared_delete_prefix": "This key is also used by:",
"shared_delete_suffix": "Deleting it disables those providers too.",
"delete_anyway": "Delete anyway",
diff --git a/jarvis/ui/web/frontend/src/i18n/locales/es.json b/jarvis/ui/web/frontend/src/i18n/locales/es.json
index 41d63bfaf7..ee1c82e493 100644
--- a/jarvis/ui/web/frontend/src/i18n/locales/es.json
+++ b/jarvis/ui/web/frontend/src/i18n/locales/es.json
@@ -364,6 +364,9 @@
"title": "Pulir mi redacción",
"description": "Un modelo rápido reescribe la estructura: puntuación, mayúsculas, muletillas y separación de frases. Tus palabras exactas y su significado se conservan, y el texto original siempre queda en tu historial.",
"sends_text": "Mientras esto esté activado, tu texto final se envía al modelo que elijas abajo; si tu reconocimiento de voz ya funciona en este ordenador, el repaso también se queda aquí, salvo que elijas tú mismo un modelo en la nube. Tu texto original siempre queda en tu historial, tal y como se reconoció.",
+ "precision_title": "Afinar mi elección de palabras",
+ "precision_description": "Va un paso más allá y también cambia QUÉ palabras se usan: un comodín vago se convierte en la palabra que de verdad querías decir, y el relleno se reduce al verbo simple: «tomar una decisión» pasa a «decidir». Sencillo y exacto. Nunca cambiará una palabra normal por otra más larga solo para sonar impresionante.",
+ "precision_tradeoff": "A cambio se relaja una comprobación de seguridad: ahora se permite sustituir una palabra poco común, así que una palabra mal entendida se reemplaza en vez de señalarse. Tus nombres, tus números y los términos de tu diccionario siguen protegidos, y el texto original siempre se conserva. También se aplica al dictado traducido.",
"provider_label": "Modelo",
"provider_auto": "Automático: usa la clave que ya tengo",
"provider_hint": "El modo automático usa una clave que ya tienes y cambia a otro proveedor cuando uno alcanza su límite o se queda sin saldo. Fija uno solo si quieres que se cobre a una cuenta concreta.",
@@ -1163,6 +1166,8 @@
"managed_server_port_conflict": "Otro proceso está sirviendo en este puerto",
"managed_start_cta": "Iniciar servidor",
"managed_stop_cta": "Detener servidor",
+ "managed_brain_recheck": "Usar el modelo de razonamiento actual",
+ "managed_brain_recheck_hint": "Vuelve a comprobar qué modelo de Ollama cabe en esta máquina y cambia el cerebro del servidor a él — sin reinstalar. Se aplica en el próximo arranque del servidor.",
"shared_delete_prefix": "Esta clave también la usan:",
"shared_delete_suffix": "Al eliminarla, esos proveedores también se desactivan.",
"delete_anyway": "Eliminar de todos modos",
diff --git a/jarvis/ui/web/frontend/src/views/voice/LanguageTab.test.tsx b/jarvis/ui/web/frontend/src/views/voice/LanguageTab.test.tsx
index 381dc8b397..066bfd6e31 100644
--- a/jarvis/ui/web/frontend/src/views/voice/LanguageTab.test.tsx
+++ b/jarvis/ui/web/frontend/src/views/voice/LanguageTab.test.tsx
@@ -510,6 +510,68 @@ describe("LanguageTab — the wording pass", () => {
expect(screen.queryByTestId("dictation-polish-test")).toBeNull();
});
+ // ------------------------------------------------------------------
+ // Precision mode — the word-choice switch that relaxes a guard
+ // ------------------------------------------------------------------
+
+ it("keeps precision off until it is asked for", async () => {
+ installFetchMock(routes());
+ render(<LanguageTab hideHeader />);
+
+ const toggle = await waitFor(() =>
+ screen.getByTestId("dictation-precision-toggle"),
+ );
+ // Off by default, unlike the wording switch above it: this one relaxes the
+ // check that rejects an answer in which an uncommon word vanished, and a
+ // trade like that is never inherited from a default.
+ expect(toggle.getAttribute("aria-checked")).toBe("false");
+ // And the card says so, rather than leaving the user to discover it.
+ expect(screen.getByTestId("dictation-precision-tradeoff").textContent).toBeTruthy();
+ });
+
+ it("saves the precision switch", async () => {
+ const calls = installFetchMock(
+ routes({
+ "PUT /api/dictation/settings": () => ({
+ body: { settings: { ...SETTINGS, polish_precision: true }, persisted: true },
+ }),
+ }),
+ );
+ render(<LanguageTab hideHeader />);
+
+ fireEvent.click(
+ await waitFor(() => screen.getByTestId("dictation-precision-toggle")),
+ );
+
+ await waitFor(() => {
+ const put = calls.find(
+ (c) => c.method === "PUT" && c.url === "/api/dictation/settings",
+ );
+ expect(JSON.parse(put?.body ?? "{}")).toMatchObject({
+ polish_precision: true,
+ persist: true,
+ });
+ });
+ });
+
+ it("still shows the precision switch when the formatter is off", async () => {
+ // It governs a TRANSLATED dictation too, and a translation runs with the
+ // formatter switched off. Hiding it there would leave a switch silently in
+ // force with no way to see or reach it (AP-31).
+ installFetchMock(
+ routes({
+ "GET /api/dictation/settings": () => ({
+ body: { settings: { ...SETTINGS, polish: false }, choices: CHOICES },
+ }),
+ }),
+ );
+ render(<LanguageTab hideHeader />);
+
+ await waitFor(() =>
+ expect(screen.queryByTestId("dictation-precision-toggle")).toBeTruthy(),
+ );
+ });
+
// ------------------------------------------------------------------
// Translation — same tab, and the switch that changes which words come out
// ------------------------------------------------------------------
diff --git a/jarvis/ui/web/frontend/src/views/voice/LanguageTab.tsx b/jarvis/ui/web/frontend/src/views/voice/LanguageTab.tsx
index f397c3be8a..6ccb4c82ab 100644
--- a/jarvis/ui/web/frontend/src/views/voice/LanguageTab.tsx
+++ b/jarvis/ui/web/frontend/src/views/voice/LanguageTab.tsx
@@ -5,6 +5,7 @@ import {
Languages,
Loader2,
PlugZap,
+ Scissors,
Wand2,
} from "lucide-react";
@@ -111,6 +112,19 @@ export function LanguageTab({ hideHeader = false }: LanguageTabProps = {}) {
}
}
+ async function onTogglePrecision(next: boolean) {
+ // Clearing matters more here than on the other switches: the dry run uses a
+ // DIFFERENT sample in precision mode, so a stale result would sit next to
+ // the switch showing a sentence the new setting would never produce.
+ setTestResult(null);
+ try {
+ await saveSettings({ polish_precision: next });
+ pushToast("success", t("dictation.saved"));
+ } catch (e) {
+ pushToast("error", (e as Error).message);
+ }
+ }
+
async function onToggleTranslate(next: boolean) {
setTestResult(null);
try {
@@ -150,6 +164,9 @@ export function LanguageTab({ hideHeader = false }: LanguageTabProps = {}) {
// chain comes back empty, the pass reports "unavailable" and the raw
// transcript is delivered — byte-identical to a build without the feature.
const polishOn = settings?.polish ?? true;
+ // Default OFF, unlike the switch above, and the card says why: this one
+ // relaxes a guard rather than only costing a formatting pass.
+ const precisionOn = settings?.polish_precision ?? false;
const polishProvider = settings?.polish_provider ?? "auto";
const served = choices?.polish_provider ?? ["auto"];
// A pin the served list does not contain would otherwise render as the first
@@ -268,6 +285,46 @@ export function LanguageTab({ hideHeader = false }: LanguageTabProps = {}) {
/>
</div>
+ {/* Deliberately OUTSIDE the `polishOn` block below. Precision also
+ governs a TRANSLATED dictation, which runs with the formatter
+ switched off — hiding the switch there would leave it silently
+ in force with no way to see or reach it (AP-31). */}
+ <div
+ className="mt-3 flex items-start justify-between gap-4 border-t border-border/60 pt-3"
+ data-testid="dictation-precision-row"
+ >
+ <div className="min-w-0">
+ <h5 className="flex items-center gap-2 text-xs font-semibold">
+ <Scissors aria-hidden="true" className="h-3 w-3 text-primary" />
+ {t("voice.polish.precision_title")}
+ </h5>
+ <p
+ className="mt-1 text-[11px] text-muted-foreground"
+ data-testid="dictation-precision-description"
+ >
+ {t("voice.polish.precision_description")}
+ </p>
+ {/* The trade, said out loud. This switch is not a matter of
+ taste like the register is — it relaxes the check that
+ rejects an answer in which an uncommon word vanished, which
+ is the difference between "off by default" and "on by
+ default" for everything else on this card. */}
+ <p
+ className="mt-1.5 text-[11px] text-muted-foreground"
+ data-testid="dictation-precision-tradeoff"
+ >
+ {t("voice.polish.precision_tradeoff")}
+ </p>
+ </div>
+ <Switch
+ checked={precisionOn}
+ disabled={loading}
+ onCheckedChange={(next) => void onTogglePrecision(next)}
+ aria-label={t("voice.polish.precision_title")}
+ data-testid="dictation-precision-toggle"
+ />
+ </div>
+
{polishOn && (
<>
{/* The same themed control as the language picker above it —