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.

fix(dictation): translate on a model that can translate, and give it the time

Harald1cedc503a13a
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 30c457b81c..d9791eb835 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -11,6 +11,22 @@ versioning per [SemVer](https://semver.org/).
### Fixed
+- **Dictation translation reads like the target language now.** The
+ translate pass ran on the same tiny model the formatter uses, which
+ punctuates well and translates flatly — measured on real German
+ transcripts it dropped whole clauses. A family may now declare a
+ translation tier, and the pass uses it: Groq translates on
+ `gpt-oss-120b`, Gemini on `gemini-3.7-flash`, OpenRouter on
+ `google/gemini-3.7-flash`. A model you pinned yourself still wins.
+- **A long dictation is no longer cut off by the wording ceiling.** The
+ 1200 ms budget was fixed while the work grows with the transcript, so a
+ tenth of all wording passes expired on one measured install — and they
+ were the long ones. The ceiling now ramps with the transcript length up
+ to `[dictation].polish_timeout_max_ms`. Short dictations are unchanged,
+ and a healthy provider never reaches either number.
+- **Two wording defaults were years out of date.** OpenAI ran on
+ `gpt-4.1-nano` and Gemini on a 3.1 lite build; both now use the current
+ generation their own catalog serves.
- **A Start-Menu click that cannot boot now says why.** A missing `click`
(uvicorn's import-time dependency) killed the backend thread, the window
waited 45 s for `/api/health`, and pythonw swallowed the traceback — so
diff --git a/docs/product/everyday-use/dictation.md b/docs/product/everyday-use/dictation.md
index 858285eef6..be261dd913 100644
--- a/docs/product/everyday-use/dictation.md
+++ b/docs/product/everyday-use/dictation.md
@@ -98,8 +98,15 @@ uses a fixed sample and saves nothing. If the model fails or changes too much,
Jarvis uses the version from before that pass.
**Always write in one language** translates and cleans up in one request.
-Translation starts off. If the model times out, text stays in the spoken
-language.
+Translation starts off. It runs at the provider you picked, on that provider's
+strongest fast model rather than its quickest one, because rewriting a sentence
+in another language asks more than punctuating it. If the model times out, text
+stays in the spoken language.
+
+A long dictation is given more time than a short one: the budget you set
+applies up to about 25 words and then grows with the transcript, up to
+`polish_timeout_max_ms`. Waiting longer costs nothing while the provider is
+healthy — it only decides what happens when it is not.
> [!warning] A hosted recognition provider receives audio; a hosted wording
> provider receives the transcript. The Language tab names the chosen model.
diff --git a/jarvis/core/config.py b/jarvis/core/config.py
index 2cc5bf020a..7ccabbdb7d 100644
--- a/jarvis/core/config.py
+++ b/jarvis/core/config.py
@@ -3147,6 +3147,34 @@ class DictationConfig(BaseModel):
#: consumer client talking to a cloud model over the open internet.
polish_timeout_ms: int = Field(default=1200, ge=200, le=5000)
+ #: How far the ceiling above may stretch on a LONG dictation, in
+ #: milliseconds.
+ #:
+ #: The key above is a promise about the wait; the work it bounds is sized
+ #: by the user, because the model has to write the finished text out. One
+ #: fixed ceiling therefore switches the pass off on exactly the dictations
+ #: that need it most. Measured on one live install (2026-08-20, 201 wording
+ #: passes at the 1200 ms ceiling): successful passes ran 526 ms median
+ #: below 25 words and 850-1000 ms at 100-220 words, while the 20 that
+ #: expired had a median of 77 words against 15 for the ones that came back.
+ #: A tenth of the pass was being thrown away by the clock, and it was the
+ #: long half.
+ #:
+ #: So the budget ramps: unchanged up to ~25 words, and a few milliseconds
+ #: per further word after that, never past this ceiling. The allowance is
+ #: that small because the same measurement shows the wall is met far
+ #: earlier than "long dictation" suggests — the p90 at 25-49 words was
+ #: already 992 ms.
+ #:
+ #: **A wider ceiling does not make dictation slower.** The model answers
+ #: when it answers; this number is only reached when the provider is
+ #: struggling, and there the choice is between waiting an extra second and
+ #: dropping the wrong language into a live document.
+ #:
+ #: Set it equal to (or below) ``polish_timeout_ms`` to switch the ramp off
+ #: and get the old fixed ceiling back.
+ polish_timeout_max_ms: int = Field(default=4000, ge=200, le=20_000)
+
#: Skip the pass above this many characters. ``0`` — the default — means
#: no cap.
#:
@@ -3394,6 +3422,11 @@ class DictationConfig(BaseModel):
def _clamp_polish_timeout_ms(cls, value: object) -> int:
return _clamped_polish_int(value, default=1200, low=200, high=5000)
+ @field_validator("polish_timeout_max_ms", mode="before")
+ @classmethod
+ def _clamp_polish_timeout_max_ms(cls, value: object) -> int:
+ return _clamped_polish_int(value, default=4000, low=200, high=20_000)
+
@field_validator("polish_max_input_chars", mode="before")
@classmethod
def _clamp_polish_max_input_chars(cls, value: object) -> int:
diff --git a/jarvis/core/config_writer.py b/jarvis/core/config_writer.py
index 4aa60b5fc1..18b3609dc5 100644
--- a/jarvis/core/config_writer.py
+++ b/jarvis/core/config_writer.py
@@ -862,6 +862,7 @@ DICTATION_SETTING_KEYS = (
"polish_provider",
"polish_model",
"polish_timeout_ms",
+ "polish_timeout_max_ms",
"polish_max_input_chars",
"polish_min_words",
"polish_max_output_tokens",
diff --git a/jarvis/dictation/polish.py b/jarvis/dictation/polish.py
index fb6ed839b3..9cb0be2d07 100644
--- a/jarvis/dictation/polish.py
+++ b/jarvis/dictation/polish.py
@@ -15,10 +15,12 @@ Two jobs, one pass
The same machinery also runs the TRANSLATE pass (``[dictation].translate``),
which delivers the dictation in a fixed language whatever the speaker used. It
is the same chain, the same breaker, the same ceiling and the same fail-open
-contract — only the prompt (:mod:`jarvis.dictation.translate_prompt`) and the
-guard set (``translate_drift_reason``) differ, and formatting happens inside the
-SAME call so a translation costs one round trip, not two. ``translate_to``
-selects the mode; :func:`resolve_translate_target` decides it.
+contract — the prompt (:mod:`jarvis.dictation.translate_prompt`), the guard set
+(``translate_drift_reason``) and the model TIER
+(:attr:`~jarvis.dictation.polish_client.PolishFamily.translate_model`) differ,
+and formatting happens inside the SAME call so a translation costs one round
+trip, not two. ``translate_to`` selects the mode;
+:func:`resolve_translate_target` decides it.
Precision mode rides on top of both
-----------------------------------
@@ -48,9 +50,11 @@ Four things bound it
--------------------
1. **A hard latency ceiling.** One ``asyncio.wait_for`` around the WHOLE pass —
the credential sweep included, since that is exactly where a locked keyring
- blocks — default 1200 ms. On expiry the in-flight work is cancelled and the
- raw text is delivered. A formatter that makes the user wait has already
- failed at its job.
+ blocks — default 1200 ms, ramping with the transcript's length up to
+ ``polish_timeout_max_ms`` (see :data:`_TIMEOUT_FREE_WORDS`). On expiry the
+ in-flight work is cancelled and the raw text is delivered. A formatter that
+ makes the user wait has already failed at its job; a ceiling that cancels
+ the pass on every long dictation has failed at its own.
2. **A key-aware, family-crossing chain** (:func:`resolve_polish_chain`,
AP-22). No key in any family means an empty chain, status ``unavailable``,
and behaviour byte-identical to before this feature existed — the AP-23
@@ -197,6 +201,45 @@ _AUTO = "auto"
#: fails in a way that looks like a provider outage instead of like our deadline.
_MIN_CALL_TIMEOUT_S = 0.05
+# ---------------------------------------------------------------------------
+# The length ramp — why one ceiling cannot serve one-line and one-page
+# dictations
+# ---------------------------------------------------------------------------
+# ``polish_timeout_ms`` used to be the whole budget, whatever was dictated. That
+# is a promise about the WAIT, applied to work whose size the user chose: the
+# model has to write the finished text out, so a transcript ten times as long
+# takes materially longer, and a single ceiling therefore switches the feature
+# off on exactly the dictations it was most needed for. Measured on one live
+# install (2026-08-20, 201 wording passes, the shipped 1200 ms ceiling): the
+# passes that succeeded ran 526 ms median under 25 words and 850-1000 ms at
+# 100-220 words, while the 20 that expired had a median of 77 words against 15
+# for the ones that came back. Ten per cent of the pass was being thrown away
+# by the clock, and it was the long half.
+#
+# So the ceiling ramps with the transcript instead. Below the free allowance
+# nothing changes at all — the one-line dictation keeps exactly the budget it
+# always had. Above it, each further word buys a few more milliseconds, up to a
+# hard cap the user sets.
+#
+# The two numbers are read off that same live install rather than guessed. The
+# allowance is 25 words because the p90 at 25-49 words was already 992 ms
+# against a 1200 ms ceiling — the wall is met far earlier than "long dictation"
+# suggests, and a translation, which has to write every word again in another
+# language, meets it earlier still. The rate is ~3x the measured slope
+# (2.7 ms/word formatting, 4.4 ms/word translating), because the ceiling exists
+# to cut off a provider that has DIED, not to race a healthy one having a slow
+# minute.
+#
+# **A wider ceiling does not make dictation slower.** The model answers when it
+# answers — 570-870 ms on the measured runs — and the ceiling is only ever
+# reached when the provider is struggling. What it changes is what happens
+# THERE: waiting an extra second, or dropping German text into an English
+# document. The old ceiling chose the second one nine times out of ten it was
+# hit, and never said so.
+_TIMEOUT_FREE_WORDS = 25
+_TIMEOUT_MS_PER_WORD = 15
+_DEFAULT_TIMEOUT_MAX_MS = 4000
+
@dataclass(frozen=True, slots=True)
class PolishOutcome:
@@ -467,7 +510,11 @@ async def polish_transcript(
if await breaker.is_open():
return _result("unavailable", reason="circuit_open")
- budget_s = _timeout_budget(cfg, timeout_s)
+ # Counted from the SOURCE, not from the answer: the ceiling has to be
+ # decided before the call that it bounds. It is the same counter the
+ # drift guards use, so "how long this may take" and "how far the answer
+ # may drift" are measured off one number.
+ budget_s = _timeout_budget(cfg, timeout_s, words=count_words(source))
attempt = _Attempt()
# Resolved ONCE and used for both the prompt and the guard below. Those
# two are a matched pair — the precision prompt licenses substitutions
@@ -513,6 +560,7 @@ async def polish_transcript(
temperature=_cfg_float(
cfg, "polish_temperature", _DEFAULT_TEMPERATURE, lo=0.0, hi=2.0
),
+ translating=translating,
),
budget_s,
)
@@ -755,6 +803,7 @@ async def _resolve_and_run(
deadline: float,
max_output_tokens: int,
temperature: float,
+ translating: bool = False,
) -> str | None:
"""Resolve the chain and then walk it — both inside the caller's ceiling.
@@ -778,7 +827,9 @@ async def _resolve_and_run(
attempt.on_device_only = all(family.runs_on_device for family in chain)
primary = chain[0]
attempt.provider = primary.id
- attempt.model = resolve_model(primary, cfg, primary_id=primary.id)
+ attempt.model = resolve_model(
+ primary, cfg, primary_id=primary.id, translating=translating
+ )
return await _run_chain(
chain,
@@ -789,6 +840,7 @@ async def _resolve_and_run(
deadline=deadline,
max_output_tokens=max_output_tokens,
temperature=temperature,
+ translating=translating,
)
@@ -802,6 +854,7 @@ async def _run_chain(
deadline: float,
max_output_tokens: int,
temperature: float,
+ translating: bool = False,
) -> str | None:
"""Walk the family chain until one answers; ``None`` when none does.
@@ -818,7 +871,9 @@ async def _run_chain(
"""
primary_id = chain[0].id
for family in chain:
- model = resolve_model(family, cfg, primary_id=primary_id)
+ model = resolve_model(
+ family, cfg, primary_id=primary_id, translating=translating
+ )
attempt.provider = family.id
attempt.model = model
@@ -862,15 +917,35 @@ async def _run_chain(
return None
-def _timeout_budget(cfg: Any, override_s: float | None) -> float:
- """The hard ceiling for one polish pass, in seconds."""
+def _timeout_budget(cfg: Any, override_s: float | None, *, words: int = 0) -> float:
+ """The hard ceiling for one wording pass, in seconds.
+
+ ``words`` is the transcript's own length, which is what the ramp above is
+ for: ``polish_timeout_ms`` remains the budget for everything up to
+ :data:`_TIMEOUT_FREE_WORDS`, and only a longer transcript earns more, never
+ past ``polish_timeout_max_ms``.
+
+ An explicit ``override_s`` still wins outright and is NOT ramped — its two
+ callers are the settings-screen dry run and the tests, and both mean "this
+ many seconds exactly".
+
+ ``polish_timeout_max_ms`` bounds the RAMP, not the pass: set below the
+ base it simply means "do not ramp", and the base still applies. The base is
+ the key that says how long a wording pass may take; a user who wants a
+ lower ceiling than that lowers THAT one.
+ """
if override_s is not None:
try:
return max(_MIN_CALL_TIMEOUT_S, float(override_s))
except (TypeError, ValueError):
pass
- ms = _cfg_int(cfg, "polish_timeout_ms", _DEFAULT_TIMEOUT_MS, lo=200, hi=5000)
- return ms / 1000.0
+ base_ms = _cfg_int(cfg, "polish_timeout_ms", _DEFAULT_TIMEOUT_MS, lo=200, hi=5000)
+ max_ms = _cfg_int(
+ cfg, "polish_timeout_max_ms", _DEFAULT_TIMEOUT_MAX_MS, lo=200, hi=20_000
+ )
+ extra_words = max(0, int(words) - _TIMEOUT_FREE_WORDS)
+ ramped_ms = base_ms + extra_words * _TIMEOUT_MS_PER_WORD
+ return min(max(base_ms, ramped_ms), max(base_ms, max_ms)) / 1000.0
def _cfg_int(cfg: Any, name: str, default: int, *, lo: int, hi: int) -> int:
diff --git a/jarvis/dictation/polish_client.py b/jarvis/dictation/polish_client.py
index d8ccc9d29b..e5aadc7ba7 100644
--- a/jarvis/dictation/polish_client.py
+++ b/jarvis/dictation/polish_client.py
@@ -132,6 +132,29 @@ class PolishFamily:
secret_candidates: tuple[str, ...]
default_model: str
default_timeout_ms: int
+ #: The model this family uses when the pass is TRANSLATING, or ``""`` to
+ #: reuse ``default_model``.
+ #:
+ #: The two passes are not the same job. Punctuating a transcript is
+ #: pattern work that the smallest, fastest model in a family does as well
+ #: as the largest one, and that model is the right default because the
+ #: pass has a latency budget measured in hundreds of milliseconds. Writing
+ #: the same utterance again in another language is not pattern work: it
+ #: needs the target language's own word order and idiom, and a model that
+ #: cannot do that does not fail loudly — it returns a grammatical sentence
+ #: still audibly arranged like the source language, and quietly drops the
+ #: clause it could not place. Measured on this family's own default
+ #: (2026-08-20, German -> English, real dictated transcripts): the small
+ #: model dropped a whole clause and flattened the speaker's emphasis where
+ #: the larger one carried both, for ~200 ms more.
+ #:
+ #: So the tier is per-family DATA rather than one global "use the big one"
+ #: rule: a family whose fastest model already translates well (Cerebras
+ #: serves nothing smaller) leaves this empty and pays nothing, and a family
+ #: where the tiers genuinely differ names the model that earns the wait.
+ #: The user's own ``polish_model`` pin still wins over both (see
+ #: :func:`resolve_model`) — this is a default, never an override.
+ translate_model: str = ""
#: Provider card this family INHERITS its address from, or None for a
#: hosted endpoint that never moves. A self-hosted server has exactly one
#: address, and the user set it once on that provider's card; keeping a
@@ -223,6 +246,14 @@ POLISH_FAMILIES: Final[tuple[PolishFamily, ...]] = (
# Llama 3.1 8B that used to sit here, and polish lives or dies on
# latency: the budget above is 1.2 s for the whole call.
default_model="openai/gpt-oss-20b",
+ # Measured on this box 2026-08-20 against the live Groq catalog, warm
+ # connection, real dictated German transcripts: 20b answers in
+ # 450-650 ms but loses material ("Eine Ahnung oder auf jeden Fall ein
+ # richtig schnelles Modell" vanished entirely); 120b answers in
+ # 630-860 ms and keeps it. Both stay inside the budget, so the larger
+ # model costs ~200 ms and buys the difference between a translation and
+ # a gist.
+ translate_model="openai/gpt-oss-120b",
default_timeout_ms=1200,
),
PolishFamily(
@@ -249,7 +280,12 @@ POLISH_FAMILIES: Final[tuple[PolishFamily, ...]] = (
"google_aistudio_api_key",
"google_api_key",
),
- default_model="gemini-3.1-flash-lite",
+ # Verified 2026-08-20 against the live AI Studio catalog. The formatter
+ # stays on the lite tier, where it belongs, but on the CURRENT
+ # generation of it — the 3.1 build that used to sit here is two
+ # generations behind a list that already serves 3.5, 3.6 and 3.7.
+ default_model="gemini-3.5-flash-lite",
+ translate_model="gemini-3.7-flash",
default_timeout_ms=1500,
),
PolishFamily(
@@ -258,7 +294,13 @@ POLISH_FAMILIES: Final[tuple[PolishFamily, ...]] = (
transport="openai_chat",
base_url="https://api.openai.com/v1",
secret_candidates=("openai_api_key",),
- default_model="gpt-4.1-nano",
+ # ``gpt-4.1-nano`` sat here from a 2025 catalog and is more than a year
+ # old — never a default (CLAUDE.md §3). Both ids below are the ones
+ # ``jarvis.brain.model_catalog`` carries as current for this provider
+ # and ``tests/unit/brain/test_current_model_catalogs.py`` pins, so the
+ # wording pass and the brain cannot drift apart on what OpenAI serves.
+ default_model="gpt-5.4-nano",
+ translate_model="gpt-5.4-mini",
default_timeout_ms=1500,
),
PolishFamily(
@@ -270,6 +312,10 @@ POLISH_FAMILIES: Final[tuple[PolishFamily, ...]] = (
# Current small flash-class model on OpenRouter's live catalog
# (checked 2026-08-09), replacing a Llama 3.1 build from 2024.
default_model="qwen/qwen3.7-flash",
+ # One OpenRouter key reaches every family, so the translate tier here
+ # is not bound to the formatter's vendor. Verified on OpenRouter's live
+ # catalog 2026-08-20.
+ translate_model="google/gemini-3.7-flash",
default_timeout_ms=1500,
),
PolishFamily(
@@ -653,18 +699,30 @@ def resolve_polish_chain(cfg: Any) -> tuple[PolishFamily, ...]:
return tuple(chain)
-def resolve_model(family: PolishFamily, cfg: Any, *, primary_id: str) -> str:
+def resolve_model(
+ family: PolishFamily, cfg: Any, *, primary_id: str, translating: bool = False
+) -> str:
"""The model id to use for *family* on this call.
``[dictation].polish_model`` applies to the PRIMARY family only. A model id
is family-specific — ``llama-3.1-8b-instant`` means nothing to Gemini — so
carrying the user's pinned model across a fallback would turn a recoverable
outage into a guaranteed 404.
+
+ ``translating`` picks the family's translation tier
+ (:attr:`PolishFamily.translate_model`) where it declares one. It sits BELOW
+ the pin on purpose: someone who typed a model id chose it for this feature,
+ and silently sending their dictation to a different model than the one on
+ their own settings screen would be the config switch nobody read (AP-31).
+ A family with no declared tier answers with its ordinary default, so the
+ flag is a no-op there rather than a branch.
"""
if family.id == primary_id:
pinned = str(getattr(cfg, "polish_model", "") or "").strip()
if pinned:
return pinned
+ if translating and family.translate_model:
+ return family.translate_model
return family.default_model
diff --git a/jarvis/ui/web/dictation_routes.py b/jarvis/ui/web/dictation_routes.py
index c710dc3aa4..64a3437719 100644
--- a/jarvis/ui/web/dictation_routes.py
+++ b/jarvis/ui/web/dictation_routes.py
@@ -490,6 +490,14 @@ class SettingsBody(BaseModel):
"delivered instead (200-5000 ms)"
),
)
+ polish_timeout_max_ms: int | None = Field(
+ default=None,
+ description=(
+ "Ceiling for a LONG dictation, which is given more time than the "
+ "budget above (200-20000 ms); set it to that budget to switch the "
+ "extra time off"
+ ),
+ )
polish_max_input_chars: int | None = None
polish_min_words: int | None = None
polish_max_output_tokens: int | None = None
diff --git a/jarvis/ui/web/frontend/src/hooks/useDictation.ts b/jarvis/ui/web/frontend/src/hooks/useDictation.ts
index 02037d5ca0..4e90c57075 100644
--- a/jarvis/ui/web/frontend/src/hooks/useDictation.ts
+++ b/jarvis/ui/web/frontend/src/hooks/useDictation.ts
@@ -297,6 +297,8 @@ export interface DictationSettings {
/** "" = the family's own default model. */
polish_model: string;
polish_timeout_ms: number;
+ /** Ceiling for a long dictation; equal to the budget above = no extra time. */
+ polish_timeout_max_ms: number;
polish_max_input_chars: number;
polish_min_words: number;
polish_max_output_tokens: number;
diff --git a/jarvis/ui/web/frontend/src/i18n/locales/de.json b/jarvis/ui/web/frontend/src/i18n/locales/de.json
index bd8ec290bb..57ffbfb57c 100644
--- a/jarvis/ui/web/frontend/src/i18n/locales/de.json
+++ b/jarvis/ui/web/frontend/src/i18n/locales/de.json
@@ -419,7 +419,7 @@
"translate": {
"title": "Immer in einer Sprache schreiben",
"description": "Sprich in der Sprache, in der du denkst, und lass den Text in der ankommen, in der du schreibst. Sag es auf Deutsch, im Feld steht Englisch. Was du wirklich gesagt hast, bleibt immer in deinem Verlauf.",
- "sends_text": "Das Übersetzen passiert im selben Schritt wie das Aufräumen der Formulierung — es kostet also keine zusätzliche Wartezeit und nutzt dasselbe Modell, das du oben gewählt hast. Antwortet kein Modell rechtzeitig, kommt dein Text in der Sprache an, in der du ihn gesprochen hast.",
+ "sends_text": "Das Übersetzen passiert im selben Schritt wie das Aufräumen der Formulierung — keine zusätzliche Wartezeit, und es läuft bei dem Anbieter, den du oben gewählt hast. Dort nimmt es dessen stärkstes schnelles Modell, denn übersetzen verlangt mehr als Kommas setzen. Antwortet kein Modell rechtzeitig, kommt dein Text in der Sprache an, in der du ihn gesprochen hast.",
"target_label": "Diktat schreiben in",
"target_hint": "Alles, was du diktierst, kommt in dieser Sprache heraus — egal, welche du sprichst. Diktate, die schon in dieser Sprache sind, werden einfach nur aufgeräumt.",
"same_language_notice": "Das ist die Sprache, auf die du dein Diktat festgelegt hast — es wird also nichts übersetzt. Wähle eine andere, oder stell die Diktatsprache oben wieder auf automatisch."
diff --git a/jarvis/ui/web/frontend/src/i18n/locales/en.json b/jarvis/ui/web/frontend/src/i18n/locales/en.json
index 6e0629fb3e..1997045af4 100644
--- a/jarvis/ui/web/frontend/src/i18n/locales/en.json
+++ b/jarvis/ui/web/frontend/src/i18n/locales/en.json
@@ -419,7 +419,7 @@
"translate": {
"title": "Always write in one language",
"description": "Speak whichever language you think in and have the text arrive in the one you write in. Say it in German, get English in the field. What you actually said is always saved in your history.",
- "sends_text": "Translating happens in the same step as the wording clean-up, so it costs no extra wait and uses the same model you picked above. If no model answers in time, your words arrive in the language you spoke them.",
+ "sends_text": "Translating happens in the same step as the wording clean-up, so it costs no extra wait, and it runs at the provider you picked above — on that provider's strongest fast model rather than its quickest, because rewriting a sentence in another language asks more than punctuating it. If no model answers in time, your words arrive in the language you spoke them.",
"target_label": "Write my dictation in",
"target_hint": "Everything you dictate comes out in this language, whichever one you speak. Dictations you already speak in it are simply tidied up.",
"same_language_notice": "This is the language you have pinned for dictation, so nothing will be translated. Pick a different one, or set the dictation language above back to automatic."
diff --git a/jarvis/ui/web/frontend/src/i18n/locales/es.json b/jarvis/ui/web/frontend/src/i18n/locales/es.json
index eb1aecddd3..2c706f49fe 100644
--- a/jarvis/ui/web/frontend/src/i18n/locales/es.json
+++ b/jarvis/ui/web/frontend/src/i18n/locales/es.json
@@ -419,7 +419,7 @@
"translate": {
"title": "Escribir siempre en un idioma",
"description": "Habla en el idioma en el que piensas y deja que el texto llegue en el que escribes. Dilo en español y en el campo aparece inglés. Lo que dijiste realmente siempre queda en tu historial.",
- "sends_text": "La traducción ocurre en el mismo paso que el repaso de la redacción, así que no cuesta espera adicional y usa el mismo modelo que elegiste arriba. Si ningún modelo responde a tiempo, tus palabras llegan en el idioma en que las dijiste.",
+ "sends_text": "La traducción ocurre en el mismo paso que el repaso de la redacción, así que no cuesta espera adicional, y se ejecuta en el proveedor que elegiste arriba, con su modelo rápido más potente y no con el más veloz: traducir exige más que puntuar. Si ningún modelo responde a tiempo, tus palabras llegan en el idioma en que las dijiste.",
"target_label": "Escribir mi dictado en",
"target_hint": "Todo lo que dictes sale en este idioma, hables el que hables. Los dictados que ya están en él simplemente se pulen.",
"same_language_notice": "Es el idioma que has fijado para el dictado, así que no se traducirá nada. Elige otro, o vuelve a poner el idioma de dictado de arriba en automático."
diff --git a/tests/unit/dictation/test_polish_timeout_ramp.py b/tests/unit/dictation/test_polish_timeout_ramp.py
new file mode 100644
index 0000000000..e76b5f937d
--- /dev/null
+++ b/tests/unit/dictation/test_polish_timeout_ramp.py
@@ -0,0 +1,227 @@
+"""The wording pass's ceiling grows with the transcript, and only with it.
+
+Why this needs its own file
+---------------------------
+``polish_timeout_ms`` used to be the whole budget for every dictation, which
+made it a promise about the WAIT applied to work whose size the speaker chooses.
+Measured on one live install (2026-08-20, 201 wording passes at the fixed
+1200 ms ceiling): the passes that came back ran 526 ms median below 25 words and
+850-1000 ms at 100-220 words, while the 20 that expired had a median of 77 words
+against 15 for the ones that succeeded. A tenth of the feature was being thrown
+away by the clock, and it was the long half — the dictations a formatter is most
+needed on, and the ones where a failed TRANSLATION is not merely unpunctuated
+text but text in the wrong language.
+
+What must stay true, and is what these tests pin:
+
+* a short dictation keeps EXACTLY the configured ceiling — the one-line
+ dictation is the common case and the ramp may not quietly spend it;
+* a long one gets more, in proportion to how much more there is to write;
+* the extra time stops at a ceiling the user owns;
+* a user who wants the old fixed behaviour gets it by saying so.
+
+The client is faked, so what is asserted is the deadline the transport was
+handed — not wall-clock timing, which would make this file flaky rather than
+meaningful.
+"""
+
+from __future__ import annotations
+
+from dataclasses import dataclass, field
+from typing import Any
+
+import pytest
+
+from jarvis.dictation import polish
+from jarvis.dictation.polish import polish_transcript
+from jarvis.dictation.polish_client import POLISH_FAMILIES, PolishFamily
+
+pytestmark = pytest.mark.asyncio
+
+GROQ: PolishFamily = POLISH_FAMILIES[0]
+
+
+#: One word per entry, so a test can ask for a transcript of a stated length
+#: without counting anything by hand.
+def _words(count: int) -> str:
+ return " ".join(["word"] * count)
+
+
+@dataclass
+class _Cfg:
+ """Only the keys the ceiling is computed from."""
+
+ polish: bool = True
+ polish_provider: str = "auto"
+ polish_model: str = ""
+ polish_timeout_ms: int = 1200
+ polish_timeout_max_ms: int = 4000
+ polish_min_words: int = 4
+ polish_max_input_chars: int = 0
+ polish_max_output_tokens: int = 1200
+ polish_temperature: float = 0.0
+ polish_drift_max_shrink: float = 0.55
+ polish_drift_max_growth: float = 1.20
+ polish_style: str = "neutral"
+
+
+@dataclass
+class _FakeClient:
+ """Answers with the input unchanged and records the deadline it was given."""
+
+ calls: list[float] = field(default_factory=list)
+
+ async def complete(
+ self,
+ system: str,
+ user: str,
+ *,
+ max_output_tokens: int,
+ temperature: float,
+ timeout_s: float,
+ ) -> str:
+ self.calls.append(timeout_s)
+ return "anything"
+
+
[email protected](autouse=True)
+def _fresh_breaker() -> None:
+ polish.reset_polish_state()
+
+
+def _wire(monkeypatch: pytest.MonkeyPatch) -> _FakeClient:
+ client = _FakeClient()
+ monkeypatch.setattr(polish, "resolve_polish_chain", lambda cfg: (GROQ,))
+ monkeypatch.setattr(polish, "build_polish_client", lambda family, *, model: client)
+ return client
+
+
+async def _deadline_for(monkeypatch: pytest.MonkeyPatch, words: int, cfg: Any) -> float:
+ """The per-call deadline the transport was handed, in seconds."""
+ client = _wire(monkeypatch)
+ await polish_transcript(_words(words), language="en", cfg=cfg)
+ assert client.calls, "the pass never reached a provider"
+ return client.calls[0]
+
+
+async def test_a_short_dictation_keeps_the_configured_ceiling(
+ monkeypatch: pytest.MonkeyPatch,
+) -> None:
+ """The promise the user reads on the settings screen, unchanged.
+
+ Everything up to the free allowance is the dictation people make all day,
+ and it must still be delivered inside the budget they configured. A ramp
+ that started at the first word would have turned one honest number into a
+ number that is true of nothing.
+ """
+ deadline = await _deadline_for(monkeypatch, 20, _Cfg(polish_timeout_ms=1200))
+
+ # The walk hands the client the time REMAINING, so a few milliseconds of
+ # our own work are legitimately missing; what must not happen is the
+ # budget growing.
+ assert 1.0 < deadline <= 1.2
+
+
+async def test_a_long_dictation_is_given_more_time_than_a_short_one(
+ monkeypatch: pytest.MonkeyPatch,
+) -> None:
+ """The defect this ramp exists for, stated as a comparison.
+
+ Two dictations, same config, same provider — the longer one has more text
+ to write out and gets proportionally longer before we give up on it.
+ """
+ short = await _deadline_for(monkeypatch, 20, _Cfg())
+ polish.reset_polish_state()
+ long = await _deadline_for(monkeypatch, 100, _Cfg())
+
+ assert long > short
+ # 100 words = 75 over the free allowance, 15 ms each on top of 1200 ms,
+ # and still short of the 4000 ms cap — so this asserts the RAMP rather
+ # than the ceiling the next test owns.
+ assert 2.1 < long <= 2.325
+
+
+async def test_the_extra_time_stops_at_the_configured_maximum(
+ monkeypatch: pytest.MonkeyPatch,
+) -> None:
+ """A very long dictation must not be able to hang the delivery.
+
+ The ramp is bounded by a key the user owns, so "give the long ones more
+ time" can never become "wait indefinitely for a provider that died".
+ """
+ deadline = await _deadline_for(
+ monkeypatch, 5000, _Cfg(polish_timeout_ms=1200, polish_timeout_max_ms=2500)
+ )
+
+ assert 2.3 < deadline <= 2.5
+
+
+async def test_a_maximum_at_the_base_switches_the_ramp_off(
+ monkeypatch: pytest.MonkeyPatch,
+) -> None:
+ """The escape hatch: the old fixed ceiling is still available, by saying so.
+
+ Someone who would rather have their raw words immediately than wait for a
+ long dictation to be formatted sets the maximum to the base and gets
+ exactly the behaviour that shipped before the ramp existed.
+ """
+ deadline = await _deadline_for(
+ monkeypatch, 800, _Cfg(polish_timeout_ms=900, polish_timeout_max_ms=900)
+ )
+
+ assert 0.7 < deadline <= 0.9
+
+
+async def test_a_maximum_below_the_base_never_shortens_the_base(
+ monkeypatch: pytest.MonkeyPatch,
+) -> None:
+ """A contradictory config costs the ramp, never the configured budget.
+
+ ``polish_timeout_max_ms`` bounds how far the ceiling may STRETCH; it is not
+ a second, competing budget. A hand-edited config that sets it below the
+ base gets no ramp — and still gets the base it asked for, rather than a
+ dictation pass silently running on a ceiling nobody typed.
+ """
+ deadline = await _deadline_for(
+ monkeypatch, 800, _Cfg(polish_timeout_ms=1500, polish_timeout_max_ms=400)
+ )
+
+ assert 1.3 < deadline <= 1.5
+
+
+async def test_an_explicit_override_is_never_ramped(
+ monkeypatch: pytest.MonkeyPatch,
+) -> None:
+ """``timeout_s`` means that many seconds exactly.
+
+ Its two callers are the settings-screen dry run and the tests, and both are
+ measuring a provider against a stated number. A ramp underneath them would
+ make the reported answer depend on how long the sample happened to be.
+ """
+ client = _wire(monkeypatch)
+
+ await polish_transcript(_words(900), language="en", cfg=_Cfg(), timeout_s=0.5)
+
+ assert client.calls and 0 < client.calls[0] <= 0.5
+
+
+async def test_a_config_that_never_heard_of_the_maximum_still_ramps(
+ monkeypatch: pytest.MonkeyPatch,
+) -> None:
+ """An install whose ``jarvis.toml`` predates this key is not left behind.
+
+ Every key in this pass is read through ``getattr`` with a default precisely
+ so an older config keeps working; the ramp is a fix for a live defect, so
+ the default has to be the fixed version, not the broken one.
+ """
+
+ class _OlderConfig:
+ polish = True
+ polish_provider = "auto"
+ polish_timeout_ms = 1200
+ polish_min_words = 4
+
+ client = _wire(monkeypatch)
+ await polish_transcript(_words(300), language="en", cfg=_OlderConfig())
+
+ assert client.calls and client.calls[0] > 1.2
diff --git a/tests/unit/dictation/test_translate.py b/tests/unit/dictation/test_translate.py
index aa3a115589..95bb663cf4 100644
--- a/tests/unit/dictation/test_translate.py
+++ b/tests/unit/dictation/test_translate.py
@@ -704,3 +704,128 @@ def test_every_translate_reason_is_declared() -> None:
assert len(set(TRANSLATE_DRIFT_REASONS)) == len(TRANSLATE_DRIFT_REASONS)
assert "not_translated" in TRANSLATE_DRIFT_REASONS
assert "language_flip" not in TRANSLATE_DRIFT_REASONS
+
+
+# --------------------------------------------------------------------------
+# Which MODEL the translation runs on
+# --------------------------------------------------------------------------
+# Punctuating a transcript and writing the same utterance again in another
+# language are not the same job, and a family's fastest model is only the right
+# answer to the first one. The failure mode of the second is quiet: a small
+# model returns a grammatical sentence still arranged like the source language
+# and drops the clause it could not place, which reads as a mediocre feature
+# rather than as a model that was out of its depth. So a family may declare a
+# translation tier, and these tests pin that it is used for translations, only
+# for translations, and never over the user's own pin.
+
+
+def _model_seen(monkeypatch: pytest.MonkeyPatch, family_id: str) -> list[str]:
+ """Record every model id the chain walk asks a client to be built for."""
+ seen: list[str] = []
+ client = _FakeClient(answer=ENGLISH)
+ family = next(f for f in POLISH_FAMILIES if f.id == family_id)
+
+ monkeypatch.setattr(polish_module, "resolve_polish_chain", lambda cfg: (family,))
+
+ def _factory(fam: Any, *, model: str) -> Any:
+ seen.append(model)
+ return client
+
+ monkeypatch.setattr(polish_module, "build_polish_client", _factory)
+ return seen
+
+
+async def test_a_translation_runs_on_the_family_translation_tier(
+ monkeypatch: pytest.MonkeyPatch,
+) -> None:
+ """The whole point: the translate pass gets the better model, not the
+ fastest one."""
+ seen = _model_seen(monkeypatch, "groq")
+ family = next(f for f in POLISH_FAMILIES if f.id == "groq")
+
+ await polish_transcript(
+ GERMAN, language="de", cfg=_cfg(translate=True), translate_to="en"
+ )
+
+ assert seen and seen[0] == family.translate_model
+ assert seen[0] != family.default_model
+
+
+async def test_a_plain_polish_stays_on_the_fast_model(
+ monkeypatch: pytest.MonkeyPatch,
+) -> None:
+ """The formatter's budget is measured in hundreds of milliseconds and its
+ job is pattern work — it must not inherit the translator's model."""
+ seen = _model_seen(monkeypatch, "groq")
+ family = next(f for f in POLISH_FAMILIES if f.id == "groq")
+
+ await polish_transcript(GERMAN, language="de", cfg=_cfg())
+
+ assert seen and seen[0] == family.default_model
+
+
+async def test_a_pinned_model_still_wins_over_the_translation_tier(
+ monkeypatch: pytest.MonkeyPatch,
+) -> None:
+ """A model the user typed is a decision, not a hint.
+
+ Sending their dictation to a different model than the one on their own
+ settings screen would be the switch that reads as set and does nothing
+ (AP-31), and it is the one place where "we know better" is wrong.
+ """
+ seen = _model_seen(monkeypatch, "groq")
+
+ await polish_transcript(
+ GERMAN,
+ language="de",
+ cfg=_cfg(translate=True, polish_model="my-own-model"),
+ translate_to="en",
+ )
+
+ assert seen and seen[0] == "my-own-model"
+
+
+async def test_a_family_without_a_tier_translates_on_its_ordinary_default(
+ monkeypatch: pytest.MonkeyPatch,
+) -> None:
+ """The tier is per-family data, so a family that needs none costs nothing.
+
+ Cerebras serves one production model, so there is no faster tier to fall
+ back to and no better one to reach for; the flag has to be a no-op there
+ rather than a branch that has to find something.
+ """
+ family = next(f for f in POLISH_FAMILIES if f.id == "cerebras")
+ assert not family.translate_model, "fixture picked a family that declares a tier"
+
+ seen = _model_seen(monkeypatch, "cerebras")
+ await polish_transcript(
+ GERMAN, language="de", cfg=_cfg(translate=True), translate_to="en"
+ )
+
+ assert seen and seen[0] == family.default_model
+
+
+def test_every_declared_translation_tier_is_a_different_model() -> None:
+ """A tier equal to the default is a line that reads as a decision and is
+ not one — the family should simply leave it empty."""
+ for family in POLISH_FAMILIES:
+ if family.translate_model:
+ assert family.translate_model != family.default_model, family.id
+
+
+def test_the_openai_wording_models_come_from_the_verified_catalog() -> None:
+ """The wording pass and the brain must not disagree about what OpenAI serves.
+
+ This family's default sat on a 2025 model id for long enough that nobody
+ noticed (CLAUDE.md §3 forbids a default that old). Tying both ids to the
+ curated roster the brain already keeps current means the next refresh of
+ that roster cannot leave this pass behind — and a removal there fails here
+ instead of 404-ing at dictation time.
+ """
+ from jarvis.brain.model_catalog import CURATED_MODELS
+
+ served = {model.id for model in CURATED_MODELS["openai"]}
+ family = next(f for f in POLISH_FAMILIES if f.id == "openai")
+
+ assert family.default_model in served
+ assert family.translate_model in served