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(missions): add Spanish failure phrases for git setup reasons + tidy setup-reason state

Ruben Lütkedd29fbc3ae42
diff --git a/jarvis/missions/kontrollierer/orchestrator.py b/jarvis/missions/kontrollierer/orchestrator.py
index ecb7e4377a..423e63253a 100644
--- a/jarvis/missions/kontrollierer/orchestrator.py
+++ b/jarvis/missions/kontrollierer/orchestrator.py
@@ -1068,7 +1068,7 @@ class Kontrollierer:
# classified reason (git_missing / git_not_a_repository) set by
# `_run_task_with_critic_loop`'s except clause takes priority over
# the pre-existing generic fallback.
- setup_reason = self.__dict__.get("_setup_failure_reason", {}).pop(
+ setup_reason = self._setup_failure_reason.pop(
mission_id, "worktree_setup_failed"
)
await self._fail_mission(
@@ -1139,7 +1139,7 @@ class Kontrollierer:
# actionable reason instead of the generic
# "worktree_setup_failed" for every facet.
logger.exception("Task %s: worktree-create failed: %s", step.task_id, exc)
- self.__dict__.setdefault("_setup_failure_reason", {})[mission_id] = (
+ self._setup_failure_reason[mission_id] = (
_classify_worktree_setup_failure(exc)
)
return TaskOutcome.SETUP_FAILED
diff --git a/jarvis/missions/voice/readback.py b/jarvis/missions/voice/readback.py
index 880a3a9a90..52be16c0c6 100644
--- a/jarvis/missions/voice/readback.py
+++ b/jarvis/missions/voice/readback.py
@@ -172,7 +172,15 @@ READBACK_TEMPLATES: Final[dict[TemplateKey, dict[Lang, list[str]]]] = { # i18n-
# readback paths (direct-TTS listener + announcer bridge) cannot drift apart
# (2026-05-27 hardening finding #7). Keys are the reasons emitted by the
# orchestrator / recovery sweep; the DE and EN sets must stay in parity.
-FAILURE_REASON_PHRASES: Final[dict[Lang, dict[str, str]]] = {
+# Keyed by language CODE (str), not the render-API ``Lang`` literal: ``es`` is
+# an equal supported product-surface language (CLAUDE.md §1) and MUST be able
+# to carry a phrase here even though the ``MissionReadback`` render methods
+# themselves still default to the de/en ``Lang`` surface (widening that whole
+# API to ``es`` is a separate, larger task). Lookups use ``.get(language, {})``
+# so a code without an entry falls back cleanly. The de/en parity gate
+# (``test_failure_reason_phrases_de_en_parity``) still guards those two; ``es``
+# here carries only the keys that have been translated so far.
+FAILURE_REASON_PHRASES: Final[dict[str, dict[str, str]]] = {
"de": {
"critic_loop_exhausted": "Drei Versuche haben nicht gereicht.", # i18n-allow
"critic_rejected": "Die Prüfung war nicht zufrieden.", # i18n-allow
@@ -211,6 +219,17 @@ FAILURE_REASON_PHRASES: Final[dict[Lang, dict[str, str]]] = {
"git-based installer, not a ZIP download)."
),
},
+ # Spanish is an equal supported product-surface language (CLAUDE.md §1).
+ # Only the two git-setup reason keys added with this fix carry ``es`` for
+ # now — the rest of the table is de/en pending a broader translation pass;
+ # a missing key here falls back via ``.get(language, {})``.
+ "es": {
+ "git_missing": "Jarvis-Agents necesitan que git esté instalado y en el PATH.", # i18n-allow: Spanish TTS product-surface phrase
+ "git_not_a_repository": (
+ "Jarvis-Agents necesitan una copia de git (instala con el " # i18n-allow: Spanish TTS product-surface phrase
+ "instalador de git, no con una descarga ZIP)." # i18n-allow: Spanish TTS product-surface phrase
+ ),
+ },
}
diff --git a/tests/missions/kontrollierer/test_worktree_setup_failure.py b/tests/missions/kontrollierer/test_worktree_setup_failure.py
index 9cdd6f4568..dc0bce8443 100644
--- a/tests/missions/kontrollierer/test_worktree_setup_failure.py
+++ b/tests/missions/kontrollierer/test_worktree_setup_failure.py
@@ -77,6 +77,7 @@ async def test_worktree_path_cap_failure_returns_setup_failed(
) -> None:
k = object.__new__(Kontrollierer)
k._budget = _NoopBudget()
+ k._setup_failure_reason = {}
k._worktrees = _PathCapWorktrees()
outcome = await k._run_task_with_critic_loop(
@@ -99,6 +100,7 @@ async def test_worktree_git_lock_failure_returns_setup_failed(
) -> None:
k = object.__new__(Kontrollierer)
k._budget = _NoopBudget()
+ k._setup_failure_reason = {}
k._worktrees = _GitLockWorktrees()
outcome = await k._run_task_with_critic_loop(
@@ -130,6 +132,7 @@ async def test_worktree_missing_git_binary_yields_honest_setup_failed_reason(
API-worker tasks, since every task is wrapped in a worktree first)."""
k = object.__new__(Kontrollierer)
k._budget = _NoopBudget()
+ k._setup_failure_reason = {}
k._worktrees = _GitMissingWorktrees()
outcome = await k._run_task_with_critic_loop(
@@ -156,6 +159,7 @@ async def test_worktree_not_a_git_repository_yields_zip_install_reason(
unhelpful generic "I could not create a workspace."."""
k = object.__new__(Kontrollierer)
k._budget = _NoopBudget()
+ k._setup_failure_reason = {}
k._worktrees = _NotAGitRepositoryWorktrees()
outcome = await k._run_task_with_critic_loop(
diff --git a/tests/missions/test_voice_readback.py b/tests/missions/test_voice_readback.py
index 2313980060..dd4ae78813 100644
--- a/tests/missions/test_voice_readback.py
+++ b/tests/missions/test_voice_readback.py
@@ -124,6 +124,23 @@ def test_render_failed_maps_git_not_a_repository_to_zip_install_phrase() -> None
assert "zip" in out_en.lower(), f"expected the ZIP-install hint, got {out_en!r}"
+def test_git_setup_reasons_carry_spanish() -> None:
+ """CLAUDE.md §1: Spanish is an equal supported product-surface language,
+ so the two new git-setup reason keys must carry an ``es`` phrase — the
+ exact lines this fix added must not perpetuate the de/en-only gap."""
+ from jarvis.missions.voice.readback import FAILURE_REASON_PHRASES
+
+ es = FAILURE_REASON_PHRASES.get("es", {})
+ assert "git_missing" in es, "git_missing missing from the es phrase map"
+ assert "git_not_a_repository" in es, (
+ "git_not_a_repository missing from the es phrase map"
+ )
+ # Natural Spanish, not a snake_case token or a de/en copy.
+ assert "git" in es["git_missing"].lower()
+ assert "git_missing" not in es["git_missing"]
+ assert "zip" in es["git_not_a_repository"].lower()
+
+
def test_render_failed_maps_attempts_timed_out_to_honest_timeout_phrase() -> None:
"""Live deep-dive 2026-06-07 (mission 019ea1da): a Computer-Use mission
whose final iteration hit the 630s wall-clock cap was failed with the