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(voice): scheduled (cron) skill composes + announces its result in the conversation language

Ruben Lütke5ec1a326a8ca
diff --git a/jarvis/speech/pipeline.py b/jarvis/speech/pipeline.py
index 48f050dced..e97e47f2cb 100644
--- a/jarvis/speech/pipeline.py
+++ b/jarvis/speech/pipeline.py
@@ -2268,9 +2268,30 @@ class SpeechPipeline:
return
note(skill.name, source="cron")
+ # Compose the scheduled-run instruction in the conversation language so
+ # the brain answers in that language (it derives the reply language from
+ # the prompt text) — a German chat must not receive an English briefing
+ # (forensic 2026-06-23: the screenshot's English "Good morning, Chef…"
+ # announcement). ``lang`` also tags the announcement so the resolver
+ # speaks it in the same language. de strings are functional brain
+ # prompts, not user-facing artifacts (i18n-allow).
+ lang = self._output_language(None, "")
+ _prompts = {
+ "de": (
+ "[Geplanter Lauf] Es ist Zeit für den Skill '{name}'. Führe " # i18n-allow
+ "jetzt seine Anweisungen aus und berichte das Ergebnis kurz." # i18n-allow
+ ),
+ "es": (
+ "[ejecución programada] Es hora del skill '{name}'. Ejecuta sus "
+ "instrucciones ahora e informa brevemente el resultado."
+ ),
+ "en": (
+ "[scheduled run] It is time for the '{name}' skill. Execute its "
+ "instructions now and report the result briefly."
+ ),
+ }
reply = await self._brain(
- f"[scheduled run] It is time for the '{skill.name}' skill. "
- "Execute its instructions now and report the result briefly."
+ _prompts.get(lang, _prompts["en"]).format(name=skill.name)
)
text = (reply or "").strip()
if text and self._bus is not None:
@@ -2279,6 +2300,7 @@ class SpeechPipeline:
AnnouncementRequested(
source_layer="speech.pipeline",
text=text,
+ language=lang,
priority="normal",
)
)
diff --git a/tests/unit/speech/test_cron_skill_language.py b/tests/unit/speech/test_cron_skill_language.py
new file mode 100644
index 0000000000..74941928d6
--- /dev/null
+++ b/tests/unit/speech/test_cron_skill_language.py
@@ -0,0 +1,86 @@
+"""A scheduled (cron) skill must compose AND announce its result in the
+conversation language, not English.
+
+Forensic 2026-06-23 (the screenshot): a German voice chat received an English
+"ANNOUNCEMENT" ("Good morning, Chef. Your calendar is clear today...") because
+``_handle_cron_skill`` drove the brain with a hardcoded ENGLISH instruction and
+published the announcement with no language tag. The brain derives its reply
+language from the prompt text, so the instruction itself must be localized; the
+announcement is also tagged so the resolver speaks it in the same language.
+"""
+from __future__ import annotations
+
+from types import SimpleNamespace
+
+import pytest
+
+from jarvis.core.events import AnnouncementRequested
+from jarvis.speech.pipeline import SpeechPipeline
+
+
+class _FakeBrain:
+ def __init__(self, reply_language: str, conversation_language: str) -> None:
+ self.reply_language = reply_language
+ self.conversation_language = conversation_language
+ self.prompt: str | None = None
+
+ def note_skill_trigger(self, name: str, source: str) -> None: # noqa: D401
+ pass
+
+ async def __call__(self, prompt: str) -> str:
+ self.prompt = prompt
+ return "result text"
+
+
+class _FakeBus:
+ def __init__(self) -> None:
+ self.published: list[object] = []
+
+ async def publish(self, event: object) -> None:
+ self.published.append(event)
+
+
+def _pipe(
+ reply_language: str, conversation_language: str
+) -> tuple[SpeechPipeline, _FakeBrain, _FakeBus]:
+ pipe = SpeechPipeline.__new__(SpeechPipeline)
+ brain = _FakeBrain(reply_language, conversation_language)
+ pipe._brain = brain
+ pipe._config = SimpleNamespace(brain=SimpleNamespace(reply_language=reply_language))
+ bus = _FakeBus()
+ pipe._bus = bus
+
+ async def _noop(*a: object, **k: object) -> None:
+ pass
+
+ pipe._emit_skill_direct = _noop # type: ignore[assignment]
+ return pipe, brain, bus
+
+
+def _skill():
+ from jarvis.skills.schema import SkillLifecycleState
+
+ return SimpleNamespace(
+ name="morning-briefing", state=SkillLifecycleState.ACTIVE, frontmatter=None
+ )
+
+
+async def test_cron_skill_german_conversation_prompts_and_announces_german() -> None:
+ pipe, brain, bus = _pipe(reply_language="auto", conversation_language="de")
+ await pipe._handle_cron_skill(_skill())
+ # The brain instruction is German (so the model replies in German)...
+ assert brain.prompt is not None and "morning-briefing" in brain.prompt
+ assert "Anweisungen" in brain.prompt or "Geplanter" in brain.prompt
+ # ...and the announcement carries the German tag.
+ anns = [e for e in bus.published if isinstance(e, AnnouncementRequested)]
+ assert anns and anns[-1].language == "de"
+
+
+async def test_cron_skill_english_conversation_prompts_and_announces_english() -> None:
+ pipe, brain, bus = _pipe(reply_language="auto", conversation_language="en")
+ await pipe._handle_cron_skill(_skill())
+ assert brain.prompt is not None and "scheduled run" in brain.prompt.lower()
+ anns = [e for e in bus.published if isinstance(e, AnnouncementRequested)]
+ assert anns and anns[-1].language == "en"