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.

chore(i18n): translate committed German to English in test_skill_trigger_e2e/test_sub_agents_api/test_suppress_response_no_fallback

Ruben Lütke9b1482bc093c
diff --git a/tests/integration/test_skill_trigger_e2e.py b/tests/integration/test_skill_trigger_e2e.py
index 6d331e8108..c54d1550ba 100644
--- a/tests/integration/test_skill_trigger_e2e.py
+++ b/tests/integration/test_skill_trigger_e2e.py
@@ -19,7 +19,7 @@ def builtin_root() -> Path:
async def test_voice_match_de_en(builtin_root: Path) -> None:
- """AC12: Named Test beide Sprachen in einem Test (Review-Warning 3)."""
+ """AC12: named test covers both languages in one test (Review-Warning 3)."""
bus = EventBus()
reg = SkillRegistry(builtin_root, bus)
reg.reload_sync()
@@ -46,7 +46,7 @@ async def test_cron_scheduler_graceful_without_croniter(
matcher = TriggerMatcher(reg)
stop_event = asyncio.Event()
stop_event.set() # sofort stop
- # Darf NICHT crashen
+ # Must NOT crash
count = 0
async for _ in matcher.run_cron_scheduler(stop_event):
count += 1
diff --git a/tests/integration/test_sub_agents_api.py b/tests/integration/test_sub_agents_api.py
index 7434672f34..a9ed8b17ba 100644
--- a/tests/integration/test_sub_agents_api.py
+++ b/tests/integration/test_sub_agents_api.py
@@ -1,11 +1,11 @@
-"""Integration-Tests fuer die Sub-Agent-Dashboard-REST-API.
-
-Deckt:
-- GET /api/sub-agents/tree liefert leere Struktur wenn keine Events.
-- Events auf dem Bus landen im Tree-Endpoint.
-- GET /api/sub-agents/{trace_id} liefert eine einzelne Node.
-- 404 bei unbekanntem trace_id.
-- 503-Fallback wenn Registry fehlt.
+"""Integration tests for the Sub-Agent dashboard REST API.
+
+Covers:
+- GET /api/sub-agents/tree returns an empty structure when there are no events.
+- Events on the bus land in the tree endpoint.
+- GET /api/sub-agents/{trace_id} returns a single node.
+- 404 for an unknown trace_id.
+- 503 fallback when the registry is missing.
"""
from __future__ import annotations
@@ -26,16 +26,16 @@ from jarvis.ui.web.server import WebServer
@pytest.fixture
def server_bus() -> tuple[TestClient, EventBus, JarvisAgentRegistry]:
- """Baut einen echten WebServer + FastAPI + Registry auf.
+ """Builds a real WebServer + FastAPI + registry.
- Die Registry haengt direkt am Bus, also fliessen bus.publish-Events
- durch in den /api/sub-agents/tree-Response.
+ The registry hangs directly off the bus, so bus.publish events
+ flow through into the /api/sub-agents/tree response.
"""
bus = EventBus()
ws = WebServer(bus=bus, cfg=load_config())
client = TestClient(ws.app)
registry = ws.app.state.sub_agent_registry
- assert registry is not None, "JarvisAgentRegistry wurde nicht attached"
+ assert registry is not None, "JarvisAgentRegistry was not attached"
return client, bus, registry
@@ -118,7 +118,7 @@ async def test_tree_lifecycle_running_to_completed(server_bus) -> None:
def test_tree_fallback_when_registry_missing() -> None:
- """Wenn Registry None ist (Import-Fehler), liefert /tree ein leeres OK-Payload."""
+ """If registry is None (import error), /tree returns an empty OK payload."""
from fastapi import FastAPI
from jarvis.ui.web.sub_agents_routes import router as sub_agents_router
diff --git a/tests/integration/test_suppress_response_no_fallback.py b/tests/integration/test_suppress_response_no_fallback.py
index 87af3e66e6..1edd5bd5a8 100644
--- a/tests/integration/test_suppress_response_no_fallback.py
+++ b/tests/integration/test_suppress_response_no_fallback.py
@@ -1,16 +1,16 @@
-"""Regressions-Test: suppress_response-Tool darf KEINEN Fallback ausloesen.
+"""Regression test: the suppress_response tool must NOT trigger a fallback.
-Bug 2026-04-29: Fire-and-Forget-Tools wie ``spawn_worker`` setzen
-``suppress_response=True`` → ``ToolUseLoop`` schreibt ``final_agg.text=""``
-und ``finish_reason="suppress_response"``.
+Bug 2026-04-29: fire-and-forget tools like ``spawn_worker`` set
+``suppress_response=True`` → ``ToolUseLoop`` writes ``final_agg.text=""``
+and ``finish_reason="suppress_response"``.
-Frueher: Der Empty-Response-Guard im ``BrainManager.generate`` hat dies als
-Safety-Block missinterpretiert und auf den naechsten Provider gefallen. Jeder
-Provider in der Chain hat dann erneut ``spawn_worker`` gerufen, das
-zweite/dritte Mal lief in den ``JARVIS_DEPTH``-Recursion-Guard.
+Previously: the empty-response guard in ``BrainManager.generate``
+misinterpreted this as a safety block and fell back to the next provider.
+Every provider in the chain then called ``spawn_worker`` again, and the
+second/third call hit the ``JARVIS_DEPTH`` recursion guard.
-Fix: Empty-Text + Tool-Calls + ``finish_reason="suppress_response"`` ist ein
-LEGITIMER Turn-Abschluss, kein Fallback-Trigger.
+Fix: empty text + tool calls + ``finish_reason="suppress_response"`` is a
+LEGITIMATE turn completion, not a fallback trigger.
"""
from __future__ import annotations
@@ -49,8 +49,8 @@ class _SuppressResponseTool:
@pytest.mark.asyncio
async def test_suppress_response_does_not_trigger_fallback():
- """Brain ruft spawn_worker (suppress_response=True). Empty-Text-Guard
- darf NICHT den naechsten Provider in der Chain probieren."""
+ """Brain calls spawn_worker (suppress_response=True). The empty-text guard
+ must NOT try the next provider in the chain."""
bus = EventBus()
config = JarvisConfig()
config.brain.primary = "claude-subscription"
@@ -87,7 +87,7 @@ async def test_suppress_response_does_not_trigger_fallback():
)],
],
)
- fallback = FakeBrain(text_response="ich darf nicht aufgerufen werden")
+ fallback = FakeBrain(text_response="I must not be called")
manager._brain_cache[("claude-subscription", "haiku-model")] = primary
manager._brain_cache[("claude-subscription", "opus-model")] = fallback
@@ -105,37 +105,37 @@ async def test_suppress_response_does_not_trigger_fallback():
# we can observe the suppress_response path end-to-end.
manager._hide_action_tools_on_signalless_turn = lambda tools, user_text: tools # type: ignore[method-assign]
- # Utterance enthaelt KEIN Verb aus spawn_verbs, sodass die Force-Spawn-
- # Heuristik nicht greift und der LLM-Pfad wirklich getestet wird.
- result = await manager.generate("erkläre mir das mal", use_history=False)
+ # The utterance contains NO verb from spawn_verbs, so the Force-Spawn
+ # heuristic does not kick in and the LLM path is genuinely exercised.
+ result = await manager.generate("erkläre mir das mal", use_history=False) # i18n-allow
- # Spawn-Tool wurde GENAU EINMAL gerufen — nicht zweimal (kein Fallback).
+ # The spawn tool was called EXACTLY ONCE — not twice (no fallback).
assert len(spawn_tool.calls) == 1, (
- f"spawn_worker sollte nur einmal gerufen werden — bekam "
- f"{len(spawn_tool.calls)} Calls. Fallback-Cascade aktiv?"
+ f"spawn_worker should only be called once — got "
+ f"{len(spawn_tool.calls)} calls. Fallback cascade active?"
)
- # Primary brain wurde gerufen, fallback brain NICHT.
+ # Primary brain was called, fallback brain was NOT.
assert len(primary.calls) >= 1
assert len(fallback.calls) == 0, (
- f"Fallback-Brain wurde {len(fallback.calls)}x gerufen — sollte 0 sein. "
- f"Empty-Response-Guard hat false-fired auf suppress_response-Turn."
+ f"Fallback brain was called {len(fallback.calls)}x — should be 0. "
+ f"Empty-response guard false-fired on a suppress_response turn."
)
- # Result darf leer sein (suppress_response) — UI bekommt OpenClawAnnouncement
- # ueber den Bus, nicht ueber das BrainManager-return.
+ # Result may be empty (suppress_response) — the UI gets OpenClawAnnouncement
+ # via the bus, not via the BrainManager return value.
assert isinstance(result, str)
- # Kritisch: result darf NICHT die "alle fehlgeschlagen"-Message enthalten,
- # auch wenn der Text leer ist (suppress_response ist KEIN Fail).
- assert "fehlgeschlagen" not in result
- assert "Keine Brain-Provider" not in result
+ # Critical: the result must NOT contain the "all failed" message,
+ # even when the text is empty (suppress_response is NOT a failure).
+ assert "fehlgeschlagen" not in result # i18n-allow (matches production error text)
+ assert "Keine Brain-Provider" not in result # i18n-allow (matches production error text)
assert "unerreichbar" not in result.lower()
@pytest.mark.asyncio
async def test_truly_empty_response_still_triggers_fallback():
- """Backward-Compatibility: ein Brain das WIRKLICH nichts tut (kein Text,
- keine Tool-Calls, kein suppress_response) darf weiterhin fallback'n."""
+ """Backward compatibility: a brain that TRULY does nothing (no text,
+ no tool calls, no suppress_response) may still fall back."""
bus = EventBus()
config = JarvisConfig()
config.brain.primary = "claude-subscription"
@@ -146,7 +146,7 @@ async def test_truly_empty_response_still_triggers_fallback():
manager = BrainManager(config=config, bus=bus, tools={})
manager._registry._loaded = True
- # Empty stream: kein content, kein tool_call.
+ # Empty stream: no content, no tool_call.
empty = FakeBrain(script=[[BrainDelta(content="", finish_reason="stop")]])
fallback = FakeBrain(text_response="Hallo von Fallback")