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.

test: consolidate in-flight test-suite updates

Ruben Lütked8530e704ed3
diff --git a/tests/board/test_aggregator.py b/tests/board/test_aggregator.py
index 094eb72160..753643156e 100644
--- a/tests/board/test_aggregator.py
+++ b/tests/board/test_aggregator.py
@@ -89,7 +89,7 @@ def synthetic_jsonl(tmp_path: Path) -> Path:
{
"ts_ns": _ns(day1 + timedelta(minutes=5)),
"trace_id": "e" * 32,
- "event": "OpenClawTaskCompleted",
+ "event": "JarvisAgentTaskCompleted",
"layer": "agents",
"payload": {"success": True, "duration_s": 1800.0, "summary": "<redacted>"},
},
@@ -149,7 +149,7 @@ def real_jsonl_with_voice_text(tmp_path: Path) -> Path:
{
"ts_ns": _ns(base + timedelta(seconds=10)),
"trace_id": "a" * 32,
- "event": "OpenClawTaskCompleted",
+ "event": "JarvisAgentTaskCompleted",
"layer": "agents",
"payload": {
"success": True,
diff --git a/tests/board/test_evaluator.py b/tests/board/test_evaluator.py
index 64b638d504..0ed6096858 100644
--- a/tests/board/test_evaluator.py
+++ b/tests/board/test_evaluator.py
@@ -13,7 +13,7 @@ from jarvis.core.events import (
AchievementUnlocked,
ActionExecuted,
HarnessCompleted,
- OpenClawTaskCompleted,
+ JarvisAgentTaskCompleted,
TaskCompleted,
)
from jarvis.core.protocols import HarnessResult
@@ -39,8 +39,8 @@ def _mcp_ok() -> HarnessCompleted:
)
-def _sub_ok(duration_s: float = 60.0) -> OpenClawTaskCompleted:
- return OpenClawTaskCompleted(success=True, duration_s=duration_s)
+def _sub_ok(duration_s: float = 60.0) -> JarvisAgentTaskCompleted:
+ return JarvisAgentTaskCompleted(success=True, duration_s=duration_s)
def _task() -> TaskCompleted:
diff --git a/tests/board/test_profile.py b/tests/board/test_profile.py
index ba96a49b51..c24295b15f 100644
--- a/tests/board/test_profile.py
+++ b/tests/board/test_profile.py
@@ -113,7 +113,7 @@ def _power_user_db(tmp_path: Path) -> tuple[Path, Path]:
events.append({
"ts_ns": _ns(day + timedelta(hours=1, minutes=k * 10)),
"trace_id": f"{day_off:032x}sub{k}",
- "event": "OpenClawTaskCompleted",
+ "event": "JarvisAgentTaskCompleted",
"layer": "agents",
"payload": {"success": True, "duration_s": 900.0},
})
diff --git a/tests/board/test_routes.py b/tests/board/test_routes.py
index 4664ca6613..8d0a8bdcf3 100644
--- a/tests/board/test_routes.py
+++ b/tests/board/test_routes.py
@@ -54,7 +54,7 @@ def wired_client(tmp_path: Path) -> TestClient:
},
{
"ts_ns": _ns(today + timedelta(seconds=10)),
- "trace_id": "c" * 32, "event": "OpenClawTaskCompleted", "layer": "agents",
+ "trace_id": "c" * 32, "event": "JarvisAgentTaskCompleted", "layer": "agents",
"payload": {"success": True, "duration_s": 600.0, "summary": "<redacted>"},
},
]
diff --git a/tests/integration/test_jarvis_agent_active_brain.py b/tests/integration/test_jarvis_agent_active_brain.py
index 3b5d66feed..cd1785a259 100644
--- a/tests/integration/test_jarvis_agent_active_brain.py
+++ b/tests/integration/test_jarvis_agent_active_brain.py
@@ -1,7 +1,7 @@
"""Regression: the API-Keys "SUBAGENT (HEAVY TASKS)" section must mark the
brain that ACTUALLY executes heavy tasks as active.
-Root cause (2026-05-28): GET /api/openclaw/status derived ``is_active_brain``
+Root cause (2026-05-28): GET /api/jarvis-agent/status derived ``is_active_brain``
from ``cfg.brain.primary`` — that is only the lightweight ROUTER brain
(Gemini). The heavy-task subagent runs on ``[brain.sub_jarvis].provider``
(claude-api -> ClaudeDirectWorker -> Claude Max OAuth). The UI therefore
@@ -18,7 +18,7 @@ from fastapi.testclient import TestClient
from jarvis.core.bus import EventBus
from jarvis.core.config import BrainTierConfig, load_config
-from jarvis.missions.worker_runtime.provider_map import canonical_subagent_provider
+from jarvis.missions.worker_runtime.provider_map import canonical_worker_provider
from jarvis.ui.web.server import WebServer
# --- pure helper: canonical subagent (display) provider -------------------
@@ -39,8 +39,8 @@ from jarvis.ui.web.server import WebServer
(None, None),
],
)
-def test_canonical_subagent_provider(raw, expected) -> None:
- assert canonical_subagent_provider(raw) == expected
+def test_canonical_worker_provider(raw, expected) -> None:
+ assert canonical_worker_provider(raw) == expected
# --- endpoint: active brain follows the subagent provider -----------------
@@ -50,7 +50,7 @@ def _status(cfg) -> dict:
bus = EventBus()
ws = WebServer(bus=bus, cfg=cfg)
client = TestClient(ws.app)
- resp = client.get("/api/openclaw/status")
+ resp = client.get("/api/jarvis-agent/status")
assert resp.status_code == 200
return resp.json()
@@ -97,7 +97,7 @@ def test_openclaw_claude_alias_marks_claude_active() -> None:
assert active["gemini"] is False
-# --- endpoint: POST /api/subagent/switch ----------------------------------
+# --- endpoint: POST /api/jarvis-agent/switch ----------------------------------
def _client(cfg) -> TestClient:
@@ -121,7 +121,7 @@ def test_subagent_switch_persists_and_restart_required(
cfg.brain.primary = "gemini"
cfg.brain.sub_jarvis = BrainTierConfig(provider="claude-api", model="")
- resp = _client(cfg).post("/api/subagent/switch", json={"provider": "gemini", "persist": True})
+ resp = _client(cfg).post("/api/jarvis-agent/switch", json={"provider": "gemini", "persist": True})
assert resp.status_code == 200, resp.text
body = resp.json()
assert body["active"] == "gemini"
@@ -135,7 +135,7 @@ def test_subagent_switch_404_unknown_provider(monkeypatch: pytest.MonkeyPatch) -
monkeypatch.setattr(cfg_mod, "get_provider_secret", lambda p: "fake-key")
cfg = load_config()
- resp = _client(cfg).post("/api/subagent/switch", json={"provider": "banana"})
+ resp = _client(cfg).post("/api/jarvis-agent/switch", json={"provider": "banana"})
assert resp.status_code == 404
@@ -149,13 +149,13 @@ def test_subagent_switch_409_when_no_key(monkeypatch: pytest.MonkeyPatch) -> Non
monkeypatch.setattr(config_writer, "set_sub_jarvis_provider", lambda name: persisted.append(name))
cfg = load_config()
- resp = _client(cfg).post("/api/subagent/switch", json={"provider": "openai"})
+ resp = _client(cfg).post("/api/jarvis-agent/switch", json={"provider": "openai"})
assert resp.status_code == 409
assert persisted == [], "must not persist a provider that has no key"
def test_subagent_switch_updates_status_endpoint(monkeypatch: pytest.MonkeyPatch) -> None:
- """After a switch, /api/openclaw/status reflects the new active provider."""
+ """After a switch, /api/jarvis-agent/status reflects the new active provider."""
import jarvis.core.config as cfg_mod
import jarvis.core.config_writer as config_writer
@@ -167,9 +167,9 @@ def test_subagent_switch_updates_status_endpoint(monkeypatch: pytest.MonkeyPatch
cfg.brain.sub_jarvis = BrainTierConfig(provider="claude-api", model="")
client = _client(cfg)
- client.post("/api/subagent/switch", json={"provider": "openrouter", "persist": True})
+ client.post("/api/jarvis-agent/switch", json={"provider": "openrouter", "persist": True})
- data = client.get("/api/openclaw/status").json()
+ data = client.get("/api/jarvis-agent/status").json()
active = {r["jarvis"]: r["is_active_brain"] for r in data["mapping"]}
assert active["openrouter"] is True
assert active["claude-api"] is False
@@ -232,7 +232,7 @@ def test_subagent_switch_accepts_codex_oauth(monkeypatch: pytest.MonkeyPatch) ->
cfg = load_config()
resp = _client(cfg).post(
- "/api/subagent/switch", json={"provider": "openai-codex", "persist": True}
+ "/api/jarvis-agent/switch", json={"provider": "openai-codex", "persist": True}
)
assert resp.status_code == 200, resp.text
assert resp.json()["active"] == "openai-codex"
@@ -254,7 +254,7 @@ def test_subagent_switch_codex_api_key_only(monkeypatch: pytest.MonkeyPatch) ->
cfg = load_config()
resp = _client(cfg).post(
- "/api/subagent/switch", json={"provider": "openai-codex", "persist": True}
+ "/api/jarvis-agent/switch", json={"provider": "openai-codex", "persist": True}
)
assert resp.status_code == 200, resp.text
assert resp.json()["active"] == "openai-codex"
@@ -272,7 +272,7 @@ def test_subagent_switch_chatgpt_alias_normalizes(monkeypatch: pytest.MonkeyPatc
monkeypatch.setattr(config_writer, "set_sub_jarvis_provider", lambda n: calls.append(n))
cfg = load_config()
- resp = _client(cfg).post("/api/subagent/switch", json={"provider": "chatgpt"})
+ resp = _client(cfg).post("/api/jarvis-agent/switch", json={"provider": "chatgpt"})
assert resp.status_code == 200, resp.text
assert resp.json()["active"] == "openai-codex"
assert calls == ["openai-codex"]
@@ -292,7 +292,7 @@ def test_subagent_switch_409_codex_when_not_connected(
monkeypatch.setattr(config_writer, "set_sub_jarvis_provider", lambda n: persisted.append(n))
cfg = load_config()
- resp = _client(cfg).post("/api/subagent/switch", json={"provider": "openai-codex"})
+ resp = _client(cfg).post("/api/jarvis-agent/switch", json={"provider": "openai-codex"})
assert resp.status_code == 409
assert persisted == []
@@ -346,7 +346,7 @@ def test_subagent_switch_accepts_claude_max_oauth(monkeypatch: pytest.MonkeyPatc
cfg = load_config()
resp = _client(cfg).post(
- "/api/subagent/switch", json={"provider": "claude-api", "persist": True}
+ "/api/jarvis-agent/switch", json={"provider": "claude-api", "persist": True}
)
assert resp.status_code == 200, resp.text
assert resp.json()["active"] == "claude-api"
@@ -367,7 +367,7 @@ def test_subagent_switch_409_claude_api_no_key_no_oauth(
monkeypatch.setattr(config_writer, "set_sub_jarvis_provider", lambda n: persisted.append(n))
cfg = load_config()
- resp = _client(cfg).post("/api/subagent/switch", json={"provider": "claude-api"})
+ resp = _client(cfg).post("/api/jarvis-agent/switch", json={"provider": "claude-api"})
assert resp.status_code == 409
assert persisted == []
@@ -451,7 +451,7 @@ def test_subagent_switch_accepts_antigravity(monkeypatch: pytest.MonkeyPatch) ->
cfg = load_config()
resp = _client(cfg).post(
- "/api/subagent/switch", json={"provider": "antigravity", "persist": True}
+ "/api/jarvis-agent/switch", json={"provider": "antigravity", "persist": True}
)
assert resp.status_code == 200, resp.text
assert resp.json()["active"] == "antigravity"
@@ -472,7 +472,7 @@ def test_subagent_switch_409_antigravity_when_not_connected(
monkeypatch.setattr(config_writer, "set_sub_jarvis_provider", lambda n: persisted.append(n))
cfg = load_config()
- resp = _client(cfg).post("/api/subagent/switch", json={"provider": "antigravity"})
+ resp = _client(cfg).post("/api/jarvis-agent/switch", json={"provider": "antigravity"})
assert resp.status_code == 409
assert persisted == []
@@ -530,7 +530,7 @@ def test_subagent_switch_accepts_antigravity_via_api_key(
cfg = load_config()
resp = _client(cfg).post(
- "/api/subagent/switch", json={"provider": "antigravity", "persist": True}
+ "/api/jarvis-agent/switch", json={"provider": "antigravity", "persist": True}
)
assert resp.status_code == 200, resp.text
assert resp.json()["active"] == "antigravity"
diff --git a/tests/integration/test_sub_agents_api.py b/tests/integration/test_sub_agents_api.py
index c04a9c008c..7434672f34 100644
--- a/tests/integration/test_sub_agents_api.py
+++ b/tests/integration/test_sub_agents_api.py
@@ -14,18 +14,18 @@ from uuid import uuid4
import pytest
from fastapi.testclient import TestClient
-from jarvis.agents import SubAgentRegistry
+from jarvis.agents import JarvisAgentRegistry
from jarvis.core.bus import EventBus
from jarvis.core.config import load_config
from jarvis.core.events import (
- OpenClawTaskCompleted,
- OpenClawTaskStarted,
+ JarvisAgentTaskCompleted,
+ JarvisAgentTaskStarted,
)
from jarvis.ui.web.server import WebServer
@pytest.fixture
-def server_bus() -> tuple[TestClient, EventBus, SubAgentRegistry]:
+def server_bus() -> tuple[TestClient, EventBus, JarvisAgentRegistry]:
"""Baut einen echten WebServer + FastAPI + Registry auf.
Die Registry haengt direkt am Bus, also fliessen bus.publish-Events
@@ -35,7 +35,7 @@ def server_bus() -> tuple[TestClient, EventBus, SubAgentRegistry]:
ws = WebServer(bus=bus, cfg=load_config())
client = TestClient(ws.app)
registry = ws.app.state.sub_agent_registry
- assert registry is not None, "SubAgentRegistry wurde nicht attached"
+ assert registry is not None, "JarvisAgentRegistry wurde nicht attached"
return client, bus, registry
@@ -55,7 +55,7 @@ async def test_tree_reflects_published_events(server_bus) -> None:
client, bus, _ = server_bus
tid = uuid4()
await bus.publish(
- OpenClawTaskStarted(
+ JarvisAgentTaskStarted(
trace_id=tid,
utterance="bau mir X",
provider="openclaw",
@@ -67,7 +67,7 @@ async def test_tree_reflects_published_events(server_bus) -> None:
assert data["count"] == 1
assert len(data["roots"]) == 1
root = data["roots"][0]
- assert root["kind"] == "openclaw"
+ assert root["kind"] == "jarvis_agent"
assert root["utterance"] == "bau mir X"
assert root["model"] == "opus"
@@ -76,7 +76,7 @@ async def test_tree_reflects_published_events(server_bus) -> None:
async def test_get_agent_by_trace_id(server_bus) -> None:
client, bus, _ = server_bus
tid = uuid4()
- await bus.publish(OpenClawTaskStarted(trace_id=tid, utterance="test"))
+ await bus.publish(JarvisAgentTaskStarted(trace_id=tid, utterance="test"))
# Akzeptiert hex-form
resp = client.get(f"/api/sub-agents/{tid.hex}")
@@ -99,12 +99,12 @@ def test_get_agent_404_on_unknown(server_bus) -> None:
async def test_tree_lifecycle_running_to_completed(server_bus) -> None:
client, bus, _ = server_bus
tid = uuid4()
- await bus.publish(OpenClawTaskStarted(trace_id=tid))
+ await bus.publish(JarvisAgentTaskStarted(trace_id=tid))
r1 = client.get("/api/sub-agents/tree").json()
assert r1["roots"][0]["status"] == "running"
await bus.publish(
- OpenClawTaskCompleted(
+ JarvisAgentTaskCompleted(
trace_id=tid,
success=True,
summary="done",
diff --git a/tests/integration/test_worker_lazy_bootstrap.py b/tests/integration/test_worker_lazy_bootstrap.py
index ec38c7593d..9ba23cad63 100644
--- a/tests/integration/test_worker_lazy_bootstrap.py
+++ b/tests/integration/test_worker_lazy_bootstrap.py
@@ -23,12 +23,12 @@ import pytest
from jarvis.brain.factory import (
_KONTROLLIERER_REF,
_MISSION_MANAGER_REF,
- _OPENCLAW_BOOTSTRAP_FAILED,
+ _WORKER_BOOTSTRAP_FAILED,
build_default_brain,
- is_openclaw_bootstrap_failed,
+ is_worker_bootstrap_failed,
set_kontrollierer,
set_mission_manager,
- set_openclaw_bootstrap_failed,
+ set_worker_bootstrap_failed,
)
from jarvis.core.bus import EventBus
from jarvis.core.protocols import ExecutionContext
@@ -40,17 +40,17 @@ def _clean_singleton():
+ bootstrap-failed sentinel."""
saved_mgr = list(_MISSION_MANAGER_REF)
saved_kon = list(_KONTROLLIERER_REF)
- saved_flag = _OPENCLAW_BOOTSTRAP_FAILED[0]
+ saved_flag = _WORKER_BOOTSTRAP_FAILED[0]
_MISSION_MANAGER_REF.clear()
_KONTROLLIERER_REF.clear()
- _OPENCLAW_BOOTSTRAP_FAILED[0] = False
+ _WORKER_BOOTSTRAP_FAILED[0] = False
os.environ.pop("JARVIS_BRAIN", None)
yield
_MISSION_MANAGER_REF.clear()
_MISSION_MANAGER_REF.extend(saved_mgr)
_KONTROLLIERER_REF.clear()
_KONTROLLIERER_REF.extend(saved_kon)
- _OPENCLAW_BOOTSTRAP_FAILED[0] = saved_flag
+ _WORKER_BOOTSTRAP_FAILED[0] = saved_flag
def _make_ctx() -> ExecutionContext:
@@ -238,20 +238,20 @@ async def test_voice_path_no_kontrollierer_logs_warning() -> None:
async def test_voice_path_kontrollierer_crash_publishes_completed_event() -> None:
"""If run_mission crashes, the tool must publish a failure event.
- The Voice-Listener subscribes to OpenClawBackgroundCompleted with
+ The Voice-Listener subscribes to JarvisAgentBackgroundCompleted with
success=False to give the user voice feedback ("OpenClaw ist
abgestuerzt"). Without this publish the user would just hear silence.
"""
- from jarvis.core.events import OpenClawBackgroundCompleted
+ from jarvis.core.events import JarvisAgentBackgroundCompleted
from jarvis.plugins.tool.spawn_worker import SpawnWorkerTool
bus = EventBus()
- received: list[OpenClawBackgroundCompleted] = []
+ received: list[JarvisAgentBackgroundCompleted] = []
- def _capture(env: OpenClawBackgroundCompleted) -> None:
+ def _capture(env: JarvisAgentBackgroundCompleted) -> None:
received.append(env)
- bus.subscribe(OpenClawBackgroundCompleted, _capture)
+ bus.subscribe(JarvisAgentBackgroundCompleted, _capture)
fake_manager = MagicMock()
fake_manager.dispatch = AsyncMock(return_value="mid")
@@ -280,15 +280,15 @@ async def test_voice_path_kontrollierer_crash_publishes_completed_event() -> Non
# --- Phase 2A: bootstrap-failed sentinel (forensic report 2026-05-14) -------
-def test_set_openclaw_bootstrap_failed_round_trips() -> None:
+def test_set_worker_bootstrap_failed_round_trips() -> None:
"""The factory-level singleton must round-trip through its setter/getter
so server.py can mark a failed bootstrap and the spawn_worker tool can
read that signal at execute-time."""
- assert is_openclaw_bootstrap_failed() is False
- set_openclaw_bootstrap_failed(True)
- assert is_openclaw_bootstrap_failed() is True
- set_openclaw_bootstrap_failed(False)
- assert is_openclaw_bootstrap_failed() is False
+ assert is_worker_bootstrap_failed() is False
+ set_worker_bootstrap_failed(True)
+ assert is_worker_bootstrap_failed() is True
+ set_worker_bootstrap_failed(False)
+ assert is_worker_bootstrap_failed() is False
@pytest.mark.asyncio
@@ -300,7 +300,7 @@ async def test_execute_short_circuits_on_bootstrap_failed() -> None:
brain = build_default_brain(tier="router")
tool = brain._tools["spawn_worker"]
- set_openclaw_bootstrap_failed(True)
+ set_worker_bootstrap_failed(True)
result = await tool.execute(
{"utterance": "baue mir eine app", "action": "build"}, _make_ctx()
diff --git a/tests/missions/worker_runtime/test_provider_map.py b/tests/missions/worker_runtime/test_provider_map.py
index dcc8032f9a..3d8c7c11d8 100644
--- a/tests/missions/worker_runtime/test_provider_map.py
+++ b/tests/missions/worker_runtime/test_provider_map.py
@@ -1,34 +1,34 @@
-"""Tests fuer jarvis.missions.worker_runtime.provider_map.
+"""Tests for jarvis.missions.worker_runtime.provider_map.
-Quelle der Wahrheit: docs/openclaw-bridge.md AD-6 Amendment-Tabelle.
-Bei Aenderung der Tabelle bitte BEIDES anpassen — Doku ist verbindlich.
+Source of truth: docs/openclaw-bridge.md AD-6 Amendment table.
+When the table changes, update BOTH — the doc is authoritative.
"""
from __future__ import annotations
import pytest
from jarvis.missions.worker_runtime.provider_map import (
- JARVIS_TO_OPENCLAW,
+ JARVIS_TO_WORKER_SLUG,
MAPPINGS,
- OPENCLAW_TO_JARVIS,
+ WORKER_SLUG_TO_JARVIS,
ProviderMapping,
- UnknownJarvisProviderError,
- UnknownOpenclawProviderError,
+ NoWorkerSlugMappingError,
+ NoJarvisFromWorkerSlugError,
env_vars_for,
- to_jarvis_slug,
- to_provider_slug,
+ to_jarvis_from_worker_slug,
+ to_worker_slug,
validate_configured_providers,
)
-# --- Forward-Mapping (jarvis -> openclaw) ---
+# --- Forward-Mapping (jarvis -> worker slug) ---
@pytest.mark.parametrize(
- "jarvis_slug,openclaw_slug",
+ "jarvis_slug,worker_slug",
[
("gemini", "google"),
- # 2026-05-17 — claude-api now routes through OpenClaw's claude-cli
+ # 2026-05-17 — claude-api now routes through the worker's claude-cli
# backend (OAuth, Claude Max subscription) instead of `anthropic`
# (paid Messages API with extra-usage requirement). See
# provider_map.MAPPINGS docstring + docs/openclaw-bridge.md AD-6.
@@ -37,44 +37,44 @@ from jarvis.missions.worker_runtime.provider_map import (
("openrouter", "openrouter"),
],
)
-def test_to_provider_slug_known_providers(jarvis_slug: str, openclaw_slug: str) -> None:
- """Alle dokumentierten Provider mappen wie in AD-6 Amendment-Tabelle."""
- assert to_provider_slug(jarvis_slug) == openclaw_slug
+def test_to_worker_slug_known_providers(jarvis_slug: str, worker_slug: str) -> None:
+ """All documented providers map as in the AD-6 Amendment table."""
+ assert to_worker_slug(jarvis_slug) == worker_slug
-def test_to_provider_slug_grok_removed_raises() -> None:
+def test_to_worker_slug_grok_removed_raises() -> None:
"""Grok was removed as a brain/worker provider — its mapping is gone, so
the slug no longer resolves (only the grok-voice TTS + credential remain,
which never route through this provider map)."""
- with pytest.raises(UnknownJarvisProviderError):
- to_provider_slug("grok")
+ with pytest.raises(NoWorkerSlugMappingError):
+ to_worker_slug("grok")
-def test_to_provider_slug_unknown_raises() -> None:
- with pytest.raises(UnknownJarvisProviderError) as exc_info:
- to_provider_slug("ollama-local")
+def test_to_worker_slug_unknown_raises() -> None:
+ with pytest.raises(NoWorkerSlugMappingError) as exc_info:
+ to_worker_slug("ollama-local")
msg = str(exc_info.value)
assert "ollama-local" in msg
- assert "claude-api" in msg # Hinweis auf bekannte Mappings
- assert "MAPPINGS" in msg # Hinweis wo erweitern
+ assert "claude-api" in msg # hint about known mappings
+ assert "MAPPINGS" in msg # hint where to extend
-def test_to_provider_slug_empty_string_raises() -> None:
- with pytest.raises(UnknownJarvisProviderError):
- to_provider_slug("")
+def test_to_worker_slug_empty_string_raises() -> None:
+ with pytest.raises(NoWorkerSlugMappingError):
+ to_worker_slug("")
-def test_to_provider_slug_case_sensitive() -> None:
- """Slugs sind lowercase — Case-Mismatch ist kein Auto-Match."""
- with pytest.raises(UnknownJarvisProviderError):
- to_provider_slug("Gemini")
+def test_to_worker_slug_case_sensitive() -> None:
+ """Slugs are lowercase — case mismatch is not auto-matched."""
+ with pytest.raises(NoWorkerSlugMappingError):
+ to_worker_slug("Gemini")
-# --- Reverse-Mapping (openclaw -> jarvis) ---
+# --- Reverse-Mapping (worker slug -> jarvis) ---
@pytest.mark.parametrize(
- "openclaw_slug,jarvis_slug",
+ "worker_slug,jarvis_slug",
[
("google", "gemini"),
("claude-cli", "claude-api"),
@@ -82,19 +82,19 @@ def test_to_provider_slug_case_sensitive() -> None:
("openrouter", "openrouter"),
],
)
-def test_to_jarvis_slug_round_trip(openclaw_slug: str, jarvis_slug: str) -> None:
- assert to_jarvis_slug(openclaw_slug) == jarvis_slug
+def test_to_jarvis_from_worker_slug_round_trip(worker_slug: str, jarvis_slug: str) -> None:
+ assert to_jarvis_from_worker_slug(worker_slug) == jarvis_slug
-def test_to_jarvis_slug_unknown_raises() -> None:
- with pytest.raises(UnknownOpenclawProviderError) as exc_info:
- to_jarvis_slug("groq") # OpenClaw kennt das, Personal-Jarvis nicht
+def test_to_jarvis_from_worker_slug_unknown_raises() -> None:
+ with pytest.raises(NoJarvisFromWorkerSlugError) as exc_info:
+ to_jarvis_from_worker_slug("groq") # worker may know this, Jarvis does not
assert "groq" in str(exc_info.value)
-def test_round_trip_jarvis_openclaw_jarvis() -> None:
- for jarvis_slug in JARVIS_TO_OPENCLAW:
- assert to_jarvis_slug(to_provider_slug(jarvis_slug)) == jarvis_slug
+def test_round_trip_jarvis_worker_jarvis() -> None:
+ for jarvis_slug in JARVIS_TO_WORKER_SLUG:
+ assert to_jarvis_from_worker_slug(to_worker_slug(jarvis_slug)) == jarvis_slug
# --- ENV-Var-Mapping ---
@@ -112,17 +112,17 @@ def test_round_trip_jarvis_openclaw_jarvis() -> None:
def test_env_vars_for_known_providers(
jarvis_slug: str, expected_env: tuple[str, ...]
) -> None:
- """ENV-Var-Set matcht AD-6 Amendment, Reihenfolge: primary, fallback."""
+ """ENV-var set matches AD-6 Amendment, order: primary, fallback."""
assert env_vars_for(jarvis_slug) == expected_env
def test_env_vars_for_unknown_raises() -> None:
- with pytest.raises(UnknownJarvisProviderError):
+ with pytest.raises(NoWorkerSlugMappingError):
env_vars_for("ollama-local")
def test_env_vars_primary_always_first() -> None:
- """Bridge soll primary-ENV zuerst setzen — beide gesetzt ist robuster."""
+ """Bridge should set primary-ENV first — both set is more robust."""
primary, *_ = env_vars_for("gemini")
assert primary == "GEMINI_API_KEY"
@@ -138,7 +138,7 @@ def test_validate_configured_providers_all_mapped_returns_empty() -> None:
def test_validate_configured_providers_unmapped_listed() -> None:
configured = ["gemini", "ollama-local", "openai", "codex"]
unmapped = validate_configured_providers(configured)
- assert unmapped == ["codex", "ollama-local"] # alphabetisch sortiert
+ assert unmapped == ["codex", "ollama-local"] # alphabetically sorted
def test_validate_configured_providers_empty_input() -> None:
@@ -146,7 +146,7 @@ def test_validate_configured_providers_empty_input() -> None:
def test_validate_configured_providers_consumes_iterator() -> None:
- """Iterable-Argument darf auch ein Generator sein."""
+ """Iterable argument may also be a generator."""
def gen() -> object:
yield "gemini"
@@ -156,38 +156,38 @@ def test_validate_configured_providers_consumes_iterator() -> None:
def test_validate_configured_providers_order_stable() -> None:
- """Ergebnis ist alphabetisch sortiert, unabhaengig von Input-Reihenfolge."""
+ """Result is alphabetically sorted, independent of input order."""
a = validate_configured_providers(["zzz", "aaa", "mmm"])
b = validate_configured_providers(["aaa", "mmm", "zzz"])
assert a == b == ["aaa", "mmm", "zzz"]
-# --- Tabelle/Daten-Konsistenz ---
+# --- Table/data consistency ---
def test_mappings_are_unique_in_both_directions() -> None:
- """Kein doppelter jarvis-Slug, kein doppelter openclaw-Slug."""
+ """No duplicate jarvis slug, no duplicate worker slug."""
jarvis_slugs = [m.jarvis for m in MAPPINGS]
- openclaw_slugs = [m.openclaw for m in MAPPINGS]
+ worker_slugs = [m.worker_slug for m in MAPPINGS]
assert len(jarvis_slugs) == len(set(jarvis_slugs))
- assert len(openclaw_slugs) == len(set(openclaw_slugs))
+ assert len(worker_slugs) == len(set(worker_slugs))
def test_mappings_match_dict_size() -> None:
- """Drift-Guard: alle abgeleiteten Dicts haben dieselbe Groesse wie MAPPINGS."""
- assert len(JARVIS_TO_OPENCLAW) == len(MAPPINGS)
- assert len(OPENCLAW_TO_JARVIS) == len(MAPPINGS)
+ """Drift guard: all derived dicts have the same size as MAPPINGS."""
+ assert len(JARVIS_TO_WORKER_SLUG) == len(MAPPINGS)
+ assert len(WORKER_SLUG_TO_JARVIS) == len(MAPPINGS)
def test_provider_mapping_is_frozen() -> None:
- """ProviderMapping ist frozen — kein Runtime-Tampering."""
+ """ProviderMapping is frozen — no runtime tampering."""
m = ProviderMapping("test", "test", "TEST_KEY")
with pytest.raises((AttributeError, TypeError)):
m.jarvis = "hacked" # type: ignore[misc]
def test_ad6_table_is_complete() -> None:
- """AD-6 Amendment listet exakt 4 Provider — Drift-Schutz gegen versehentliches Loeschen.
+ """AD-6 Amendment lists exactly 4 providers — drift guard against accidental deletion.
Grok was removed as a brain/worker provider, so its ``grok->xai`` row is
gone from the table (only grok-voice TTS + the credential remain, neither of
@@ -195,8 +195,8 @@ def test_ad6_table_is_complete() -> None:
expected_jarvis_slugs = {"gemini", "claude-api", "openai", "openrouter"}
actual = {m.jarvis for m in MAPPINGS}
assert actual == expected_jarvis_slugs, (
- "AD-6 Amendment-Tabelle weicht ab — bitte docs/openclaw-bridge.md "
- "und MAPPINGS synchron halten."
+ "AD-6 Amendment table drifted — please keep docs/openclaw-bridge.md "
+ "and MAPPINGS in sync."
)
@@ -205,8 +205,8 @@ def test_ad6_table_is_complete() -> None:
def test_antigravity_subagent_slugs_ssot() -> None:
"""The Antigravity subagent slug set is the SSoT mirror of CODEX_SUBAGENT_SLUGS:
- it routes to the dedicated OAuth-CLI worker, NOT through MAPPINGS (no OpenClaw
- provider slug)."""
+ it routes to the dedicated OAuth-CLI worker, NOT through MAPPINGS (no worker
+ slug in the provider map)."""
from jarvis.missions.worker_runtime.provider_map import (
ANTIGRAVITY_SUBAGENT_CANONICAL,
ANTIGRAVITY_SUBAGENT_SLUGS,
@@ -214,8 +214,8 @@ def test_antigravity_subagent_slugs_ssot() -> None:
assert "antigravity" in ANTIGRAVITY_SUBAGENT_SLUGS
assert ANTIGRAVITY_SUBAGENT_CANONICAL == "antigravity"
- # Not a MAPPINGS provider (OAuth CLI has no OpenClaw slug, like codex).
- assert "antigravity" not in JARVIS_TO_OPENCLAW
+ # Not a MAPPINGS provider (OAuth CLI has no worker slug, like codex).
+ assert "antigravity" not in JARVIS_TO_WORKER_SLUG
def test_codex_subagent_slugs_accept_bare_codex_alias() -> None:
diff --git a/tests/unit/agents/test_registry.py b/tests/unit/agents/test_registry.py
index 63a8734f8a..675a66f3e3 100644
--- a/tests/unit/agents/test_registry.py
+++ b/tests/unit/agents/test_registry.py
@@ -1,4 +1,4 @@
-"""Unit-Tests fuer jarvis.agents.registry.SubAgentRegistry.
+"""Unit-Tests fuer jarvis.agents.registry.JarvisAgentRegistry.
Deckt:
- Event-Ingestion pro Event-Typ (9 Typen: OpenClawTask*, BrainTurn*, ToolCall*,
@@ -17,16 +17,16 @@ from uuid import uuid4
import pytest
-from jarvis.agents import AgentNode, SubAgentRegistry
+from jarvis.agents import AgentNode, JarvisAgentRegistry
from jarvis.core.bus import EventBus
from jarvis.core.events import (
BrainTurnCompleted,
BrainTurnStarted,
HarnessCompleted,
HarnessDispatched,
- OpenClawTaskCompleted,
- OpenClawReviewTriggered,
- OpenClawTaskStarted,
+ JarvisAgentTaskCompleted,
+ JarvisAgentReviewTriggered,
+ JarvisAgentTaskStarted,
ToolCallCompleted,
ToolCallStarted,
)
@@ -39,8 +39,8 @@ def bus() -> EventBus:
@pytest.fixture
-def registry(bus: EventBus) -> SubAgentRegistry:
- return SubAgentRegistry(bus, ttl_completed_s=3600).attach()
+def registry(bus: EventBus) -> JarvisAgentRegistry:
+ return JarvisAgentRegistry(bus, ttl_completed_s=3600).attach()
# ────────────────────────────────────────────────────────────────
@@ -49,11 +49,11 @@ def registry(bus: EventBus) -> SubAgentRegistry:
@pytest.mark.asyncio
async def test_openclaw_task_started_creates_running_node(
- bus: EventBus, registry: SubAgentRegistry
+ bus: EventBus, registry: JarvisAgentRegistry
) -> None:
tid = uuid4()
await bus.publish(
- OpenClawTaskStarted(
+ JarvisAgentTaskStarted(
trace_id=tid,
utterance="bau mir eine Flask-App",
context_hints=["Port 8000", "single file"],
@@ -65,7 +65,7 @@ async def test_openclaw_task_started_creates_running_node(
snap = registry.snapshot()
assert len(snap) == 1
node = snap[tid.hex]
- assert node.kind == "openclaw"
+ assert node.kind == "jarvis_agent"
assert node.status == "running"
assert node.utterance == "bau mir eine Flask-App"
assert node.context_hints == ["Port 8000", "single file"]
@@ -74,19 +74,19 @@ async def test_openclaw_task_started_creates_running_node(
# The display name is the neutral role only — engine/provider/model must
# never leak into it (Sub-Agents board hygiene). provider/model stay as
# structured fields above for internal aggregation.
- assert node.name == "Sub-Agent"
+ assert node.name == "Jarvis-Agent"
assert "opus" not in node.name
assert "OpenClaw" not in node.name
@pytest.mark.asyncio
async def test_openclaw_task_completed_marks_success_with_metrics(
- bus: EventBus, registry: SubAgentRegistry
+ bus: EventBus, registry: JarvisAgentRegistry
) -> None:
tid = uuid4()
- await bus.publish(OpenClawTaskStarted(trace_id=tid, provider="claude-api", model="haiku"))
+ await bus.publish(JarvisAgentTaskStarted(trace_id=tid, provider="claude-api", model="haiku"))
await bus.publish(
- OpenClawTaskCompleted(
+ JarvisAgentTaskCompleted(
trace_id=tid,
success=True,
summary="Fertig",
@@ -104,12 +104,12 @@ async def test_openclaw_task_completed_marks_success_with_metrics(
@pytest.mark.asyncio
async def test_openclaw_task_failed_marks_failed_with_error(
- bus: EventBus, registry: SubAgentRegistry
+ bus: EventBus, registry: JarvisAgentRegistry
) -> None:
tid = uuid4()
- await bus.publish(OpenClawTaskStarted(trace_id=tid))
+ await bus.publish(JarvisAgentTaskStarted(trace_id=tid))
await bus.publish(
- OpenClawTaskCompleted(
+ JarvisAgentTaskCompleted(
trace_id=tid,
success=False,
error="timeout after 1800s",
@@ -123,12 +123,12 @@ async def test_openclaw_task_failed_marks_failed_with_error(
@pytest.mark.asyncio
async def test_review_triggered_updates_iteration_counter(
- bus: EventBus, registry: SubAgentRegistry
+ bus: EventBus, registry: JarvisAgentRegistry
) -> None:
tid = uuid4()
- await bus.publish(OpenClawTaskStarted(trace_id=tid))
- await bus.publish(OpenClawReviewTriggered(trace_id=tid, iteration=1))
- await bus.publish(OpenClawReviewTriggered(trace_id=tid, iteration=2))
+ await bus.publish(JarvisAgentTaskStarted(trace_id=tid))
+ await bus.publish(JarvisAgentReviewTriggered(trace_id=tid, iteration=1))
+ await bus.publish(JarvisAgentReviewTriggered(trace_id=tid, iteration=2))
node = registry.snapshot()[tid.hex]
assert node.review_iterations == 2
@@ -139,10 +139,10 @@ async def test_review_triggered_updates_iteration_counter(
@pytest.mark.asyncio
async def test_brain_turn_tokens_aggregate_into_newest_openclaw(
- bus: EventBus, registry: SubAgentRegistry
+ bus: EventBus, registry: JarvisAgentRegistry
) -> None:
sj = uuid4()
- await bus.publish(OpenClawTaskStarted(trace_id=sj, provider="gemini", model="opus"))
+ await bus.publish(JarvisAgentTaskStarted(trace_id=sj, provider="gemini", model="opus"))
await bus.publish(
BrainTurnStarted(
trace_id=uuid4(),
@@ -169,11 +169,11 @@ async def test_brain_turn_tokens_aggregate_into_newest_openclaw(
@pytest.mark.asyncio
async def test_tool_call_started_appends_to_parent(
- bus: EventBus, registry: SubAgentRegistry
+ bus: EventBus, registry: JarvisAgentRegistry
) -> None:
sj = uuid4()
tc = uuid4()
- await bus.publish(OpenClawTaskStarted(trace_id=sj))
+ await bus.publish(JarvisAgentTaskStarted(trace_id=sj))
await bus.publish(
ToolCallStarted(
trace_id=tc,
@@ -190,11 +190,11 @@ async def test_tool_call_started_appends_to_parent(
@pytest.mark.asyncio
async def test_tool_call_completed_updates_matching_entry(
- bus: EventBus, registry: SubAgentRegistry
+ bus: EventBus, registry: JarvisAgentRegistry
) -> None:
sj = uuid4()
tc = uuid4()
- await bus.publish(OpenClawTaskStarted(trace_id=sj))
+ await bus.publish(JarvisAgentTaskStarted(trace_id=sj))
await bus.publish(
ToolCallStarted(trace_id=tc, parent_trace_id=sj, tool_name="run_shell", args_preview="ls")
)
@@ -216,11 +216,11 @@ async def test_tool_call_completed_updates_matching_entry(
@pytest.mark.asyncio
async def test_harness_dispatched_links_to_newest_running_openclaw(
- bus: EventBus, registry: SubAgentRegistry
+ bus: EventBus, registry: JarvisAgentRegistry
) -> None:
sj = uuid4()
harness = uuid4()
- await bus.publish(OpenClawTaskStarted(trace_id=sj, provider="gemini", model="opus"))
+ await bus.publish(JarvisAgentTaskStarted(trace_id=sj, provider="gemini", model="opus"))
await bus.publish(HarnessDispatched(trace_id=harness, harness="openclaw"))
snap = registry.snapshot()
@@ -233,11 +233,11 @@ async def test_harness_dispatched_links_to_newest_running_openclaw(
@pytest.mark.asyncio
async def test_harness_completed_nonzero_exit_marks_failed(
- bus: EventBus, registry: SubAgentRegistry
+ bus: EventBus, registry: JarvisAgentRegistry
) -> None:
sj = uuid4()
h = uuid4()
- await bus.publish(OpenClawTaskStarted(trace_id=sj))
+ await bus.publish(JarvisAgentTaskStarted(trace_id=sj))
await bus.publish(HarnessDispatched(trace_id=h, harness="openclaw"))
await bus.publish(
HarnessCompleted(
@@ -259,11 +259,11 @@ async def test_harness_completed_nonzero_exit_marks_failed(
@pytest.mark.asyncio
async def test_tree_returns_only_root_nodes(
- bus: EventBus, registry: SubAgentRegistry
+ bus: EventBus, registry: JarvisAgentRegistry
) -> None:
root_sj = uuid4()
harness = uuid4()
- await bus.publish(OpenClawTaskStarted(trace_id=root_sj))
+ await bus.publish(JarvisAgentTaskStarted(trace_id=root_sj))
await bus.publish(HarnessDispatched(trace_id=harness, harness="openclaw"))
tree = registry.tree()
@@ -273,9 +273,9 @@ async def test_tree_returns_only_root_nodes(
@pytest.mark.asyncio
async def test_to_json_is_serializable_shape(
- bus: EventBus, registry: SubAgentRegistry
+ bus: EventBus, registry: JarvisAgentRegistry
) -> None:
- await bus.publish(OpenClawTaskStarted(trace_id=uuid4(), utterance="x"))
+ await bus.publish(JarvisAgentTaskStarted(trace_id=uuid4(), utterance="x"))
payload = registry.to_json()
assert "roots" in payload
assert "all" in payload
@@ -292,10 +292,10 @@ async def test_to_json_is_serializable_shape(
@pytest.mark.asyncio
async def test_clear_removes_all_nodes(
- bus: EventBus, registry: SubAgentRegistry
+ bus: EventBus, registry: JarvisAgentRegistry
) -> None:
- await bus.publish(OpenClawTaskStarted(trace_id=uuid4()))
- await bus.publish(OpenClawTaskStarted(trace_id=uuid4()))
+ await bus.publish(JarvisAgentTaskStarted(trace_id=uuid4()))
+ await bus.publish(JarvisAgentTaskStarted(trace_id=uuid4()))
assert len(registry.snapshot()) == 2
registry.clear()
assert len(registry.snapshot()) == 0
@@ -308,10 +308,10 @@ async def test_clear_removes_all_nodes(
@pytest.mark.asyncio
async def test_ttl_removes_completed_node_after_timeout(bus: EventBus) -> None:
# Sehr kurzes TTL fuer den Test
- reg = SubAgentRegistry(bus, ttl_completed_s=0).attach()
+ reg = JarvisAgentRegistry(bus, ttl_completed_s=0).attach()
tid = uuid4()
- await bus.publish(OpenClawTaskStarted(trace_id=tid))
- await bus.publish(OpenClawTaskCompleted(trace_id=tid, success=True))
+ await bus.publish(JarvisAgentTaskStarted(trace_id=tid))
+ await bus.publish(JarvisAgentTaskCompleted(trace_id=tid, success=True))
# Event-Loop Runde lassen, damit der Cleanup-Task laeuft
await asyncio.sleep(0.05)
assert tid.hex not in reg.snapshot()
@@ -319,7 +319,7 @@ async def test_ttl_removes_completed_node_after_timeout(bus: EventBus) -> None:
@pytest.mark.asyncio
async def test_orphan_child_tolerated_without_parent(
- bus: EventBus, registry: SubAgentRegistry
+ bus: EventBus, registry: JarvisAgentRegistry
) -> None:
# HarnessDispatched ohne running Sub-Jarvis → Harness als Root (parent=None)
h = uuid4()
@@ -347,7 +347,7 @@ async def test_agent_node_default_fields_are_empty() -> None:
@pytest.mark.asyncio
async def test_mission_bus_bridge_creates_openclaw_node(
- registry: SubAgentRegistry,
+ registry: JarvisAgentRegistry,
) -> None:
"""attach_mission_bus: MissionDispatched -> AgentNode of kind=openclaw."""
from jarvis.missions.event_bus import MissionBus
@@ -375,7 +375,7 @@ async def test_mission_bus_bridge_creates_openclaw_node(
tid = mission_id.replace("-", "")
assert tid in snap, f"mission node not created. snap={snap.keys()}"
node = snap[tid]
- assert node.kind == "openclaw"
+ assert node.kind == "jarvis_agent"
assert node.status == "running"
assert node.utterance == "hello world"
@@ -404,7 +404,7 @@ async def test_mission_bus_bridge_creates_openclaw_node(
@pytest.mark.asyncio
async def test_mission_bus_bridge_failed_marks_failed(
- registry: SubAgentRegistry,
+ registry: JarvisAgentRegistry,
) -> None:
"""MissionFailed -> status=failed, error captured."""
from jarvis.missions.event_bus import MissionBus
@@ -446,7 +446,7 @@ async def test_mission_bus_bridge_failed_marks_failed(
@pytest.mark.asyncio
async def test_mission_bus_bridge_is_idempotent(
- registry: SubAgentRegistry,
+ registry: JarvisAgentRegistry,
) -> None:
"""attach_mission_bus twice must not double-subscribe."""
from jarvis.missions.event_bus import MissionBus
diff --git a/tests/unit/friends/test_status_filter.py b/tests/unit/friends/test_status_filter.py
index 3c9d41b0c3..87621c296a 100644
--- a/tests/unit/friends/test_status_filter.py
+++ b/tests/unit/friends/test_status_filter.py
@@ -2,7 +2,7 @@
"""Unit-Tests fuer :class:`jarvis.friends.status_filter.StatusFilter`.
Branch-portable: die echten Bus-Events (VoiceSessionStarted, MissionStarted,
-OpenClawTaskStarted, ...) existieren auf diesem Branch eventuell noch nicht.
+JarvisAgentTaskStarted, ...) existieren auf diesem Branch eventuell noch nicht.
Wir bauen Fake-DataClass-Events mit den passenden Class-Names — der Filter
arbeitet ueber ``type(event).__name__`` + ``hasattr``, also reicht das.
@@ -76,7 +76,7 @@ class MissionCompleted:
@dataclass
-class OpenClawTaskStarted:
+class JarvisAgentTaskStarted:
timestamp_ns: int = 5_000
summary: str = "Implementiert F4-Pipeline"
utterance: str = "leak me" # darf NICHT durchkommen
@@ -84,7 +84,7 @@ class OpenClawTaskStarted:
@dataclass
-class OpenClawTaskCompleted:
+class JarvisAgentTaskCompleted:
timestamp_ns: int = 6_000
summary: str = "Done"
success: bool = True
@@ -186,7 +186,7 @@ def test_minimal_blocks_mission_started() -> None:
def test_minimal_blocks_openclaw() -> None:
"""'minimal' blockiert Sub-Jarvis-Events (erst 'detailed')."""
- event = OpenClawTaskStarted()
+ event = JarvisAgentTaskStarted()
result = StatusFilter.filter(event, "minimal")
assert result is None
@@ -214,21 +214,21 @@ def test_standard_passes_mission_completed_with_success() -> None:
def test_standard_blocks_openclaw() -> None:
- """'standard' blockiert OpenClawTaskStarted."""
- event = OpenClawTaskStarted()
+ """'standard' blockiert JarvisAgentTaskStarted."""
+ event = JarvisAgentTaskStarted()
result = StatusFilter.filter(event, "standard")
assert result is None
def test_detailed_passes_openclaw_with_summary_only() -> None:
- """'detailed' laesst OpenClawTaskStarted durch, ABER nur summary-Field.
+ """'detailed' laesst JarvisAgentTaskStarted durch, ABER nur summary-Field.
KRITISCH: utterance + private_secret im Event duerfen NICHT durchkommen.
"""
- event = OpenClawTaskStarted()
+ event = JarvisAgentTaskStarted()
result = StatusFilter.filter(event, "detailed")
assert result is not None
- assert result.event_type == "OpenClawTaskStarted"
+ assert result.event_type == "JarvisAgentTaskStarted"
assert result.fields == {"summary": "Implementiert F4-Pipeline"}
assert "utterance" not in result.fields
assert "private_secret" not in result.fields
@@ -236,7 +236,7 @@ def test_detailed_passes_openclaw_with_summary_only() -> None:
def test_no_data_leak_via_unknown_field() -> None:
"""Erfundene Felder im Event leaken NICHT — Filter ist Whitelist-only."""
- event = OpenClawTaskStarted()
+ event = JarvisAgentTaskStarted()
result = StatusFilter.filter(event, "detailed")
assert result is not None
# Nur summary darf raus
@@ -252,7 +252,7 @@ def test_detailed_passes_voice_session_ended() -> None:
def test_detailed_passes_openclaw_completed() -> None:
- event = OpenClawTaskCompleted()
+ event = JarvisAgentTaskCompleted()
result = StatusFilter.filter(event, "detailed")
assert result is not None
assert result.fields == {"summary": "Done", "success": True}
diff --git a/tests/unit/runs/test_outcome_activity.py b/tests/unit/runs/test_outcome_activity.py
index 6b23401915..0eb28fc62b 100644
--- a/tests/unit/runs/test_outcome_activity.py
+++ b/tests/unit/runs/test_outcome_activity.py
@@ -89,7 +89,7 @@ def test_feature_tags_from_events():
events = [
_ev("ActionProposed", tool_name="computer_use"),
_ev("ActionProposed", tool_name="cli_gcloud"),
- _ev("OpenClawTaskStarted"),
+ _ev("JarvisAgentTaskStarted"),
]
tags = feature_tags_from_events(events)
assert "computer_use" in tags
diff --git a/tests/unit/speech/test_announcement_bridge.py b/tests/unit/speech/test_announcement_bridge.py
index ac0cc475d3..59829c288a 100644
--- a/tests/unit/speech/test_announcement_bridge.py
+++ b/tests/unit/speech/test_announcement_bridge.py
@@ -23,8 +23,8 @@ import pytest
from jarvis.core.bus import EventBus
from jarvis.core.events import (
AnnouncementRequested,
- OpenClawAnnouncement,
- OpenClawBackgroundCompleted,
+ JarvisAgentAnnouncement,
+ JarvisAgentBackgroundCompleted,
)
from jarvis.core.protocols import AudioChunk
from jarvis.speech.pipeline import SpeechPipeline
@@ -199,7 +199,7 @@ async def test_announcement_without_bus_is_safe() -> None:
@pytest.mark.asyncio
async def test_openclaw_spawn_announcement_is_silent() -> None:
- """``OpenClawAnnouncement`` darf NICHT mehr TTS-sprechen.
+ """``JarvisAgentAnnouncement`` darf NICHT mehr TTS-sprechen.
Spawn-ACK-History:
- 2026-04-25 .. 2026-05-10: stumm (User-Wunsch).
@@ -220,7 +220,7 @@ async def test_openclaw_spawn_announcement_is_silent() -> None:
_make_pipeline(tts, bus, player)
await bus.publish(
- OpenClawAnnouncement(
+ JarvisAgentAnnouncement(
trace_id=uuid4(),
action="den vom User beschriebenen Workflow",
target="",
@@ -236,14 +236,14 @@ async def test_openclaw_spawn_announcement_is_silent() -> None:
@pytest.mark.asyncio
async def test_openclaw_background_success_with_summary_speaks() -> None:
- """``OpenClawBackgroundCompleted(success=True, summary=...)`` → Voice-Ansage."""
+ """``JarvisAgentBackgroundCompleted(success=True, summary=...)`` → Voice-Ansage."""
bus = EventBus()
tts = FakeTTS()
player = FakePlayer()
_make_pipeline(tts, bus, player)
await bus.publish(
- OpenClawBackgroundCompleted(
+ JarvisAgentBackgroundCompleted(
success=True,
utterance="recherchier mir fuenf themen",
summary="Fuenf Recherche-Themen liegen bereit.",
@@ -267,7 +267,7 @@ async def test_openclaw_background_success_no_summary_speaks_fertig() -> None:
_make_pipeline(tts, bus, player)
await bus.publish(
- OpenClawBackgroundCompleted(
+ JarvisAgentBackgroundCompleted(
success=True, utterance="mach mir das", summary="", error="", duration_s=1.0,
)
)
@@ -285,7 +285,7 @@ async def test_openclaw_background_failure_speaks_error() -> None:
_make_pipeline(tts, bus, player)
await bus.publish(
- OpenClawBackgroundCompleted(
+ JarvisAgentBackgroundCompleted(
success=False, utterance="mach mir das", summary="",
error="rate-limit reached", duration_s=2.0,
)
@@ -380,7 +380,7 @@ async def test_openclaw_spawn_action_echo_is_not_spoken() -> None:
_make_pipeline(tts, bus, player)
await bus.publish(
- OpenClawAnnouncement(
+ JarvisAgentAnnouncement(
trace_id=uuid4(),
action="eine App baut",
target="im Workspace",
@@ -408,7 +408,7 @@ async def test_openclaw_completion_signal_does_speak_with_summary() -> None:
_make_pipeline(tts, bus, player)
await bus.publish(
- OpenClawBackgroundCompleted(
+ JarvisAgentBackgroundCompleted(
success=True,
utterance="baue mir etwas",
summary="Fertig gebaut",
@@ -497,7 +497,7 @@ async def test_plain_late_announcement_still_dropped_after_hangup() -> None:
@pytest.mark.asyncio
async def test_background_completed_speaks_after_hangup() -> None:
- """An OpenClawBackgroundCompleted readback is by definition fresh — it must
+ """An JarvisAgentBackgroundCompleted readback is by definition fresh — it must
be spoken even after hangup. RED before WS3b (the hangup gate dropped it)."""
bus = EventBus()
tts = FakeTTS()
@@ -506,7 +506,7 @@ async def test_background_completed_speaks_after_hangup() -> None:
pipeline._hangup_event.set() # type: ignore[attr-defined]
await bus.publish(
- OpenClawBackgroundCompleted(
+ JarvisAgentBackgroundCompleted(
success=True,
utterance="recherchier mir fuenf themen",
summary="Fuenf Recherche-Themen liegen bereit.",
diff --git a/tests/unit/speech/test_announcement_user_speaking_guard.py b/tests/unit/speech/test_announcement_user_speaking_guard.py
index 0cd43ccb3b..91ecfe6674 100644
--- a/tests/unit/speech/test_announcement_user_speaking_guard.py
+++ b/tests/unit/speech/test_announcement_user_speaking_guard.py
@@ -165,7 +165,7 @@ async def test_background_completion_while_user_speaking_is_deferred() -> None:
"""The direct OpenClaw-background readback path (which bypasses
``_on_announcement`` and plays straight to the player) must also respect the
floor: defer while the user speaks, flush at the boundary."""
- from jarvis.core.events import OpenClawBackgroundCompleted
+ from jarvis.core.events import JarvisAgentBackgroundCompleted
bus = EventBus()
tts = FakeTTS()
@@ -174,7 +174,7 @@ async def test_background_completion_while_user_speaking_is_deferred() -> None:
pipeline._turn_state = TurnTakingState.USER_SPEAKING # type: ignore[attr-defined]
await bus.publish(
- OpenClawBackgroundCompleted(
+ JarvisAgentBackgroundCompleted(
success=True, summary="Der Bericht liegt bereit.", duration_s=42.0
)
)
diff --git a/tests/unit/speech/test_background_readback_language.py b/tests/unit/speech/test_background_readback_language.py
index b1a6773fa0..c199da59be 100644
--- a/tests/unit/speech/test_background_readback_language.py
+++ b/tests/unit/speech/test_background_readback_language.py
@@ -14,7 +14,7 @@ from types import SimpleNamespace
import pytest
from jarvis.core.bus import EventBus
-from jarvis.core.events import OpenClawBackgroundCompleted
+from jarvis.core.events import JarvisAgentBackgroundCompleted
from tests.unit.speech.test_announcement_bridge import (
FakePlayer,
FakeTTS,
@@ -30,7 +30,7 @@ async def test_background_readback_speaks_english_for_english_conversation() ->
pipe._brain = SimpleNamespace(reply_language="auto", conversation_language="en")
await bus.publish(
- OpenClawBackgroundCompleted(success=True, summary="", duration_s=1.0)
+ JarvisAgentBackgroundCompleted(success=True, summary="", duration_s=1.0)
)
assert tts.calls, "expected a background readback to be synthesized"
@@ -47,7 +47,7 @@ async def test_background_readback_stays_german_for_german_conversation() -> Non
pipe._brain = SimpleNamespace(reply_language="auto", conversation_language="de")
await bus.publish(
- OpenClawBackgroundCompleted(success=True, summary="", duration_s=1.0)
+ JarvisAgentBackgroundCompleted(success=True, summary="", duration_s=1.0)
)
assert tts.calls, "expected a background readback to be synthesized"
diff --git a/tests/unit/speech/test_jarvis_agent_readback.py b/tests/unit/speech/test_jarvis_agent_readback.py
index 8a460debd3..1b6814b6c3 100644
--- a/tests/unit/speech/test_jarvis_agent_readback.py
+++ b/tests/unit/speech/test_jarvis_agent_readback.py
@@ -23,7 +23,7 @@ import pytest
from jarvis.core.bus import EventBus
from jarvis.core.events import (
AnnouncementRequested,
- OpenClawBackgroundCompleted,
+ JarvisAgentBackgroundCompleted,
SpeechSpoken,
SystemStateChanged,
)
@@ -232,7 +232,7 @@ async def test_background_completed_arms_readback_grace() -> None:
assert pipeline._last_announcement_spoken_monotonic is None # type: ignore[attr-defined]
await bus.publish(
- OpenClawBackgroundCompleted(
+ JarvisAgentBackgroundCompleted(
success=True,
utterance="recherchier mir fuenf themen",
summary="Fuenf Recherche-Themen liegen bereit.",
diff --git a/tests/unit/speech/test_pipeline_init_guard.py b/tests/unit/speech/test_pipeline_init_guard.py
index 3fad26241b..fc15866970 100644
--- a/tests/unit/speech/test_pipeline_init_guard.py
+++ b/tests/unit/speech/test_pipeline_init_guard.py
@@ -20,8 +20,8 @@ from jarvis.core.bus import EventBus
from jarvis.core.events import (
AnnouncementRequested,
AudioOutFirst,
- OpenClawAnnouncement,
- OpenClawBackgroundCompleted,
+ JarvisAgentAnnouncement,
+ JarvisAgentBackgroundCompleted,
VoiceMuteToggleRequested,
)
from jarvis.core.protocols import AudioChunk
@@ -62,8 +62,8 @@ def test_init_subscribes_the_known_announcement_and_audio_events() -> None:
for event_type in (
AnnouncementRequested,
- OpenClawBackgroundCompleted,
- OpenClawAnnouncement,
+ JarvisAgentBackgroundCompleted,
+ JarvisAgentAnnouncement,
VoiceMuteToggleRequested,
AudioOutFirst,
):
diff --git a/tests/unit/speech/test_spawn_watchdog.py b/tests/unit/speech/test_spawn_watchdog.py
index 1b1976e299..49a289e479 100644
--- a/tests/unit/speech/test_spawn_watchdog.py
+++ b/tests/unit/speech/test_spawn_watchdog.py
@@ -26,8 +26,8 @@ from jarvis.brain.ack_brain.spawn_announcement import STILL_RUNNING_PHRASES
from jarvis.core.bus import EventBus
from jarvis.core.events import (
AnnouncementRequested,
- OpenClawAnnouncement,
- OpenClawBackgroundCompleted,
+ JarvisAgentAnnouncement,
+ JarvisAgentBackgroundCompleted,
VoiceMuteToggleRequested,
)
from jarvis.core.protocols import AudioChunk
@@ -97,10 +97,10 @@ async def test_completion_within_window_cancels_watchdog() -> None:
announcements: list[AnnouncementRequested] = []
bus.subscribe(AnnouncementRequested, lambda ev: announcements.append(ev))
- await bus.publish(OpenClawAnnouncement(action="bauen", target="x"))
+ await bus.publish(JarvisAgentAnnouncement(action="bauen", target="x"))
await asyncio.sleep(0.02) # let the watchdog task get scheduled
- await bus.publish(OpenClawBackgroundCompleted(success=True, summary="ok"))
+ await bus.publish(JarvisAgentBackgroundCompleted(success=True, summary="ok"))
await asyncio.sleep(0.05)
progress = _heartbeats(announcements)
@@ -120,7 +120,7 @@ async def test_no_completion_triggers_watchdog_phrase() -> None:
announcements: list[AnnouncementRequested] = []
bus.subscribe(AnnouncementRequested, lambda ev: announcements.append(ev))
- await bus.publish(OpenClawAnnouncement(action="bauen", target="x"))
+ await bus.publish(JarvisAgentAnnouncement(action="bauen", target="x"))
# Wait long enough for the watchdog timer to fire.
await asyncio.sleep(0.3)
@@ -148,7 +148,7 @@ async def test_watchdog_respects_mute() -> None:
await bus.publish(VoiceMuteToggleRequested(source="test"))
assert pipe.is_muted is True
- await bus.publish(OpenClawAnnouncement(action="bauen", target="x"))
+ await bus.publish(JarvisAgentAnnouncement(action="bauen", target="x"))
await asyncio.sleep(0.3)
progress = _heartbeats(announcements)
@@ -169,12 +169,12 @@ async def test_multiple_spawns_each_get_a_watchdog() -> None:
announcements: list[AnnouncementRequested] = []
bus.subscribe(AnnouncementRequested, lambda ev: announcements.append(ev))
- await bus.publish(OpenClawAnnouncement(action="A", target="a"))
- await bus.publish(OpenClawAnnouncement(action="B", target="b"))
+ await bus.publish(JarvisAgentAnnouncement(action="A", target="a"))
+ await bus.publish(JarvisAgentAnnouncement(action="B", target="b"))
assert len(pipe._spawn_watchdog_tasks) == 2
# Complete only the first spawn -- the second's watchdog stays alive.
- await bus.publish(OpenClawBackgroundCompleted(success=True, summary="A done"))
+ await bus.publish(JarvisAgentBackgroundCompleted(success=True, summary="A done"))
await asyncio.sleep(0.3)
progress = _heartbeats(announcements)
@@ -192,7 +192,7 @@ async def test_finish_after_response_stays_listening_while_spawn_in_flight() ->
The fix re-uses the existing ``_spawn_watchdog_tasks`` FIFO as the
canonical 'spawns in flight' tracker: as long as at least one spawn
- has not yet emitted ``OpenClawBackgroundCompleted``, the turn is not
+ has not yet emitted ``JarvisAgentBackgroundCompleted``, the turn is not
semantically complete and the pipeline must stay LISTENING.
"""
from jarvis.speech.pipeline import TurnTakingState
@@ -202,7 +202,7 @@ async def test_finish_after_response_stays_listening_while_spawn_in_flight() ->
# Single-turn-mode: without the fix, _finish_after_response hangs up.
pipe._continue_listening_after_response = False
- await bus.publish(OpenClawAnnouncement(action="bauen", target="x"))
+ await bus.publish(JarvisAgentAnnouncement(action="bauen", target="x"))
await asyncio.sleep(0.02)
assert len(pipe._spawn_watchdog_tasks) == 1, "spawn must be tracked"
@@ -220,12 +220,12 @@ async def test_finish_after_response_stays_listening_while_spawn_in_flight() ->
)
assert pipe._session_end_reason is None, (
"_session_end_reason must NOT be set to HANGUP_TURN_COMPLETE -- the "
- "turn is not complete until OpenClawBackgroundCompleted fires."
+ "turn is not complete until JarvisAgentBackgroundCompleted fires."
)
# After the mission completes the watchdog is popped; a follow-up turn
# then respects single-turn-mode again.
- await bus.publish(OpenClawBackgroundCompleted(success=True, summary="ok"))
+ await bus.publish(JarvisAgentBackgroundCompleted(success=True, summary="ok"))
await asyncio.sleep(0.05)
assert pipe._spawn_watchdog_tasks == []
@@ -244,10 +244,10 @@ async def test_completion_after_watchdog_fires_is_still_clean() -> None:
bus = EventBus()
pipe = _pipeline(bus, watchdog_delay_s=0.02)
- await bus.publish(OpenClawAnnouncement(action="x", target="y"))
+ await bus.publish(JarvisAgentAnnouncement(action="x", target="y"))
await asyncio.sleep(0.2) # watchdog fires
# Completing afterwards must not raise.
- await bus.publish(OpenClawBackgroundCompleted(success=True, summary="ok"))
+ await bus.publish(JarvisAgentBackgroundCompleted(success=True, summary="ok"))
await asyncio.sleep(0.05)
assert pipe._spawn_watchdog_tasks == []
@@ -257,7 +257,7 @@ async def test_fired_watchdog_self_removes_from_inflight_list() -> None:
"""Bound for the idle-timeout / finish-after-response override.
In production a *successful* background mission never publishes
- ``OpenClawBackgroundCompleted`` — the readback travels the MissionAnnouncer
+ ``JarvisAgentBackgroundCompleted`` — the readback travels the MissionAnnouncer
path (MissionApproved → AnnouncementRequested), and ``_on_background_completed``
(the only code that pops ``_spawn_watchdog_tasks``) fires solely on the crash
path. So the watchdog is never *cancelled*; it simply *fires* after the delay.
@@ -269,7 +269,7 @@ async def test_fired_watchdog_self_removes_from_inflight_list() -> None:
bus = EventBus()
pipe = _pipeline(bus, watchdog_delay_s=0.05)
- await bus.publish(OpenClawAnnouncement(action="bauen", target="x"))
+ await bus.publish(JarvisAgentAnnouncement(action="bauen", target="x"))
await asyncio.sleep(0.02)
assert len(pipe._spawn_watchdog_tasks) == 1, "spawn must arm a watchdog"
@@ -298,7 +298,7 @@ async def test_finish_after_response_hangs_up_once_watchdog_has_fired() -> None:
pipe = _pipeline(bus, watchdog_delay_s=0.05)
pipe._continue_listening_after_response = False # single-turn mode
- await bus.publish(OpenClawAnnouncement(action="bauen", target="x"))
+ await bus.publish(JarvisAgentAnnouncement(action="bauen", target="x"))
await asyncio.sleep(0.02)
assert await pipe._finish_after_response(barged=False) is True # in flight
@@ -327,7 +327,7 @@ async def test_heartbeat_repeats_and_varies_until_capped() -> None:
announcements: list[AnnouncementRequested] = []
bus.subscribe(AnnouncementRequested, lambda ev: announcements.append(ev))
- await bus.publish(OpenClawAnnouncement(action="eine grosse Analyse", target=""))
+ await bus.publish(JarvisAgentAnnouncement(action="eine grosse Analyse", target=""))
await asyncio.sleep(0.3)
beats = _heartbeats(announcements)
@@ -352,7 +352,7 @@ async def test_heartbeat_follows_conversation_language(lang: str) -> None:
announcements: list[AnnouncementRequested] = []
bus.subscribe(AnnouncementRequested, lambda ev: announcements.append(ev))
- await bus.publish(OpenClawAnnouncement(action="x", target="y"))
+ await bus.publish(JarvisAgentAnnouncement(action="x", target="y"))
await asyncio.sleep(0.2)
beats = _heartbeats(announcements)
@@ -372,7 +372,7 @@ async def test_completion_readback_cancels_pending_heartbeat() -> None:
announcements: list[AnnouncementRequested] = []
bus.subscribe(AnnouncementRequested, lambda ev: announcements.append(ev))
- await bus.publish(OpenClawAnnouncement(action="bauen", target="x"))
+ await bus.publish(JarvisAgentAnnouncement(action="bauen", target="x"))
await asyncio.sleep(0.02)
assert len(pipe._spawn_watchdog_tasks) == 1
@@ -405,7 +405,7 @@ async def test_heartbeat_dropped_not_deferred_while_user_holds_floor() -> None:
pipe = _pipeline(bus, watchdog_delay_s=0.03)
pipe._turn_state = TurnTakingState.USER_SPEAKING # user holds the floor
- await bus.publish(OpenClawAnnouncement(action="bauen", target="x"))
+ await bus.publish(JarvisAgentAnnouncement(action="bauen", target="x"))
await asyncio.sleep(0.2) # heartbeat fires into _on_announcement
assert pipe._player.plays == [], "heartbeat was spoken over the user"
@@ -431,7 +431,7 @@ async def test_heartbeat_dropped_not_deferred_while_turn_is_processing() -> None
pipe = _pipeline(bus, watchdog_delay_s=0.03)
pipe._turn_state = TurnTakingState.PROCESSING
- await bus.publish(OpenClawAnnouncement(action="bauen", target="x"))
+ await bus.publish(JarvisAgentAnnouncement(action="bauen", target="x"))
await asyncio.sleep(0.2) # heartbeat fires into _on_announcement
assert pipe._player.plays == [], "heartbeat was spoken during a foreground turn"
diff --git a/tests/unit/test_jarvis_agent_board_listing.py b/tests/unit/test_jarvis_agent_board_listing.py
index 494e8dc31d..8609db3ee4 100644
--- a/tests/unit/test_jarvis_agent_board_listing.py
+++ b/tests/unit/test_jarvis_agent_board_listing.py
@@ -2,7 +2,7 @@
Locks the post-Welle-4 wiring: ``spawn_openclaw`` dispatches a Mission, the
MissionManager publishes Phase-6 ``EventEnvelope``s on its ``MissionBus``, and
-the ``SubAgentRegistry`` (bridged via :meth:`attach_mission_bus`) must translate
+the ``JarvisAgentRegistry`` (bridged via :meth:`attach_mission_bus`) must translate
them into ``AgentNode``s that ``GET /api/sub-agents/tree`` serves.
This is the regression guard for the question "does a spawned sub-agent get
@@ -17,7 +17,7 @@ import asyncio
import pytest
-from jarvis.agents.registry import SubAgentRegistry
+from jarvis.agents.registry import JarvisAgentRegistry
from jarvis.core.bus import EventBus
from jarvis.missions.event_bus import MissionBus
from jarvis.missions.events import (
@@ -36,8 +36,8 @@ async def _settle() -> None:
await asyncio.sleep(0)
-def _openclaw_node(registry: SubAgentRegistry) -> dict:
- nodes = [n for n in registry.to_json()["all"].values() if n["kind"] == "openclaw"]
+def _openclaw_node(registry: JarvisAgentRegistry) -> dict:
+ nodes = [n for n in registry.to_json()["all"].values() if n["kind"] == "jarvis_agent"]
assert len(nodes) == 1, registry.to_json()
return nodes[0]
@@ -45,7 +45,7 @@ def _openclaw_node(registry: SubAgentRegistry) -> dict:
@pytest.mark.asyncio
async def test_dispatched_mission_appears_in_tree() -> None:
bus = MissionBus()
- registry = SubAgentRegistry(bus=EventBus())
+ registry = JarvisAgentRegistry(bus=EventBus())
registry.attach_mission_bus(bus)
try:
mission_id = uuid7_str()
@@ -70,7 +70,7 @@ async def test_dispatched_mission_appears_in_tree() -> None:
@pytest.mark.asyncio
async def test_worker_spawn_and_approval_update_node() -> None:
bus = MissionBus()
- registry = SubAgentRegistry(bus=EventBus())
+ registry = JarvisAgentRegistry(bus=EventBus())
registry.attach_mission_bus(bus)
try:
mission_id = uuid7_str()
@@ -129,7 +129,7 @@ async def test_worker_spawn_and_approval_update_node() -> None:
@pytest.mark.asyncio
async def test_failed_mission_marks_node_failed() -> None:
bus = MissionBus()
- registry = SubAgentRegistry(bus=EventBus())
+ registry = JarvisAgentRegistry(bus=EventBus())
registry.attach_mission_bus(bus)
try:
mission_id = uuid7_str()
diff --git a/tests/unit/test_jarvis_agent_harness_config.py b/tests/unit/test_jarvis_agent_harness_config.py
index 5c984cd260..1d1e32e817 100644
--- a/tests/unit/test_jarvis_agent_harness_config.py
+++ b/tests/unit/test_jarvis_agent_harness_config.py
@@ -1,11 +1,11 @@
-"""Tests fuer OpenClawConfig + OpenClawNotificationConfig (Welle 2).
+"""Tests for JarvisAgentHarnessConfig + JarvisAgentNotificationConfig (Wave 2).
-Drei Bloecke gemaess docs/openclaw-bridge.md §4.2:
- 1. Schema-Defaults (Pydantic-Konstruktion ohne TOML-Daten)
- 2. Live-Load aus jarvis.toml + Pydantic-Auto-Unmarshal
- 3. Validierungs-Fehlerpfade (ungueltige Werte, fehlende Required-Felder)
+Three blocks per docs/openclaw-bridge.md §4.2:
+ 1. Schema defaults (Pydantic construction without TOML data)
+ 2. Live-load from jarvis.toml + Pydantic auto-unmarshal
+ 3. Validation error paths (invalid values, missing required fields)
-Pattern uebernommen aus tests/unit/test_router_vision_config.py (Wave-1 B4).
+Pattern adopted from tests/unit/test_router_vision_config.py (Wave-1 B4).
"""
from __future__ import annotations
@@ -17,202 +17,200 @@ from pydantic import ValidationError
from jarvis.core.config import (
DEFAULT_CONFIG_FILE,
HarnessConfig,
- OpenClawConfig,
- OpenClawNotificationConfig,
+ JarvisAgentHarnessConfig,
+ JarvisAgentNotificationConfig,
load_config,
)
# ----------------------------------------------------------------------
-# 1. Schema-Defaults — gueltiger minimaler Block
+# 1. Schema defaults — valid minimal block
# ----------------------------------------------------------------------
-def test_openclaw_config_defaults_with_required_version():
- """Minimaler gueltiger Block: nur ``version`` (AD-21 Pin), Rest Defaults."""
- cfg = OpenClawConfig(version="2026.5.7")
- assert cfg.enabled is False # default off bis Welle 3
+def test_jarvis_agent_harness_config_defaults_with_required_version():
+ """Minimal valid block: only ``version`` (AD-21 pin), rest are defaults."""
+ cfg = JarvisAgentHarnessConfig(version="2026.5.7")
+ assert cfg.enabled is False # default off until Wave 3
assert cfg.version == "2026.5.7"
assert cfg.binary_path == "openclaw"
- # AD-6: leer = Bridge resolved aus cfg.brain.primary, kein Anthropic-Lock.
+ # AD-6: empty = bridge resolves from cfg.brain.primary, no Anthropic lock.
assert cfg.model is None
assert cfg.time_cap_min == 30 # AD-19
assert cfg.concurrency == 3 # AD-13
assert cfg.cost_cap_eur is None # AD-20 reserved
assert cfg.state_dir_root == "data/openclaw_state" # AD-23
- # Notification-Sub-Block traegt eigene Defaults.
- assert isinstance(cfg.notification, OpenClawNotificationConfig)
+ # Notification sub-block carries its own defaults.
+ assert isinstance(cfg.notification, JarvisAgentNotificationConfig)
assert cfg.notification.via == "announcement_bus"
assert cfg.notification.toast is True
assert cfg.notification.voice_when_active is True
-def test_openclaw_notification_defaults():
- """Notification-Sub-Config laedt sauber ohne Args."""
- n = OpenClawNotificationConfig()
+def test_jarvis_agent_notification_defaults():
+ """Notification sub-config loads cleanly without args."""
+ n = JarvisAgentNotificationConfig()
assert n.via == "announcement_bus" # AD-17
assert n.toast is True
assert n.voice_when_active is True
def test_harness_config_openclaw_optional_default_none():
- """Ohne expliziten Block bleibt ``HarnessConfig.openclaw is None``.
+ """Without an explicit block, ``HarnessConfig.openclaw is None``.
- Garantiert: bestehende Configs ohne ``[harness.openclaw]`` laden weiter.
+ Guarantees: existing configs without ``[harness.openclaw]`` still load.
"""
h = HarnessConfig()
assert h.openclaw is None
-def test_openclaw_model_can_be_pinned_explicitly():
- """Wer pinnen will, kann jede Provider/Model-Combo angeben — kein
- Anthropic-Lock im Schema."""
+def test_jarvis_agent_harness_model_can_be_pinned_explicitly():
+ """Anyone who wants to pin can specify any provider/model combo —
+ no Anthropic lock in the schema."""
for slug in (
"anthropic/claude-opus-4-7",
"google/gemini-3.1-pro-preview",
"xai/grok-4-fast",
"openai/gpt-4o",
):
- cfg = OpenClawConfig(version="2026.5.7", model=slug)
+ cfg = JarvisAgentHarnessConfig(version="2026.5.7", model=slug)
assert cfg.model == slug
# ----------------------------------------------------------------------
-# 2. Live-Load aus jarvis.toml
+# 2. Live-load from jarvis.toml
# ----------------------------------------------------------------------
def test_openclaw_section_present_in_jarvis_toml():
- """Raw-TOML: ``[harness.openclaw]`` existiert mit Plan-Werten."""
+ """Raw-TOML: ``[harness.openclaw]`` exists with planned values."""
toml_path = DEFAULT_CONFIG_FILE
- assert toml_path.exists(), f"jarvis.toml nicht an {toml_path}"
+ assert toml_path.exists(), f"jarvis.toml not found at {toml_path}"
with toml_path.open("rb") as f:
data = tomllib.load(f)
- assert "harness" in data, "[harness] Top-Level fehlt"
- assert "openclaw" in data["harness"], "[harness.openclaw] fehlt"
+ assert "harness" in data, "[harness] top-level key missing"
+ assert "openclaw" in data["harness"], "[harness.openclaw] missing"
sec = data["harness"]["openclaw"]
- # Pflicht-Schema-Felder pro Bridge-Doku §4.2.
- assert sec["enabled"] is True # default on since Welle 4 merged
+ # Required schema fields per bridge docs §4.2.
+ assert sec["enabled"] is True # default on since Wave 4 merged
assert isinstance(sec["version"], str) and sec["version"]
assert sec["binary_path"] == "openclaw"
assert sec["time_cap_min"] == 30
assert sec["concurrency"] == 3
assert sec["state_dir_root"] == "data/openclaw_state"
- # Notification-Subsektion — AD-17.
+ # Notification sub-section — AD-17.
assert "notification" in sec
notif = sec["notification"]
assert notif["via"] == "announcement_bus"
assert notif["toast"] is True
assert notif["voice_when_active"] is True
- # ``model`` und ``cost_cap_eur`` sind bewusst NICHT in der TOML
- # gesetzt (auskommentiert) — der Loader muss sie als None auffassen.
+ # ``model`` and ``cost_cap_eur`` are intentionally NOT set in TOML
+ # (commented out) — the loader must treat them as None.
assert "model" not in sec
assert "cost_cap_eur" not in sec
-def test_openclaw_config_unmarshalled_via_load_config():
- """Pydantic-Auto-Unmarshal landet im richtigen Feld."""
+def test_jarvis_agent_harness_config_unmarshalled_via_load_config():
+ """Pydantic auto-unmarshal lands in the correct field."""
cfg = load_config(DEFAULT_CONFIG_FILE)
- assert cfg.harness.openclaw is not None, "[harness.openclaw] nicht geparsed"
+ assert cfg.harness.openclaw is not None, "[harness.openclaw] not parsed"
oc = cfg.harness.openclaw
- assert isinstance(oc, OpenClawConfig)
+ assert isinstance(oc, JarvisAgentHarnessConfig)
assert oc.enabled is True
- assert oc.version # AD-21 Pin gesetzt
+ assert oc.version # AD-21 pin set
assert oc.binary_path == "openclaw"
- assert oc.model is None # auskommentiert in TOML
+ assert oc.model is None # commented out in TOML
assert oc.time_cap_min == 30
assert oc.concurrency == 3
- assert oc.cost_cap_eur is None # auskommentiert in TOML
+ assert oc.cost_cap_eur is None # commented out in TOML
assert oc.state_dir_root == "data/openclaw_state"
- assert isinstance(oc.notification, OpenClawNotificationConfig)
+ assert isinstance(oc.notification, JarvisAgentNotificationConfig)
assert oc.notification.via == "announcement_bus"
assert oc.notification.toast is True
assert oc.notification.voice_when_active is True
# ----------------------------------------------------------------------
-# 3. Validierungs-Fehlerpfade
+# 3. Validation error paths
# ----------------------------------------------------------------------
-def test_openclaw_missing_version_raises():
- """``version`` ist Required (AD-21 Pin). Ohne -> ValidationError."""
+def test_jarvis_agent_harness_missing_version_raises():
+ """``version`` is Required (AD-21 pin). Without it -> ValidationError."""
with pytest.raises(ValidationError) as exc_info:
- OpenClawConfig() # noqa: PIE790 — wir wollen den Fehler
+ JarvisAgentHarnessConfig() # noqa: PIE790 — we want the error
msg = str(exc_info.value).lower()
assert "version" in msg
-def test_openclaw_concurrency_must_be_positive():
- """``concurrency`` hat Field(ge=1). 0 oder negativ -> ValidationError."""
+def test_jarvis_agent_harness_concurrency_must_be_positive():
+ """``concurrency`` has Field(ge=1). 0 or negative -> ValidationError."""
with pytest.raises(ValidationError):
- OpenClawConfig(version="2026.5.7", concurrency=0)
+ JarvisAgentHarnessConfig(version="2026.5.7", concurrency=0)
with pytest.raises(ValidationError):
- OpenClawConfig(version="2026.5.7", concurrency=-1)
+ JarvisAgentHarnessConfig(version="2026.5.7", concurrency=-1)
-def test_openclaw_concurrency_capped_at_ten():
- """``concurrency`` hat Field(le=10). 11 -> ValidationError.
+def test_jarvis_agent_harness_concurrency_capped_at_ten():
+ """``concurrency`` has Field(le=10). 11 -> ValidationError.
- Schutz vor versehentlich exorbitanter Parallel-Last (AD-13: 3 default,
- Range 1..10 ist die operativ vernuenftige Spanne).
+ Guards against accidentally enormous parallel load (AD-13: default 3,
+ range 1..10 is the operationally sensible span).
"""
with pytest.raises(ValidationError):
- OpenClawConfig(version="2026.5.7", concurrency=11)
+ JarvisAgentHarnessConfig(version="2026.5.7", concurrency=11)
-def test_openclaw_time_cap_min_must_be_positive():
- """``time_cap_min`` hat Field(ge=1). 0 -> ValidationError."""
+def test_jarvis_agent_harness_time_cap_min_must_be_positive():
+ """``time_cap_min`` has Field(ge=1). 0 -> ValidationError."""
with pytest.raises(ValidationError):
- OpenClawConfig(version="2026.5.7", time_cap_min=0)
+ JarvisAgentHarnessConfig(version="2026.5.7", time_cap_min=0)
-def test_openclaw_cost_cap_eur_must_be_non_negative():
- """``cost_cap_eur`` hat Field(ge=0). Negativ -> ValidationError."""
+def test_jarvis_agent_harness_cost_cap_eur_must_be_non_negative():
+ """``cost_cap_eur`` has Field(ge=0). Negative -> ValidationError."""
with pytest.raises(ValidationError):
- OpenClawConfig(version="2026.5.7", cost_cap_eur=-1.0)
+ JarvisAgentHarnessConfig(version="2026.5.7", cost_cap_eur=-1.0)
-def test_openclaw_rejects_unknown_keys():
- """``extra="forbid"`` faengt Tippfehler im TOML.
+def test_jarvis_agent_harness_rejects_unknown_keys():
+ """``extra="forbid"`` catches typos in TOML.
- Gegen Three-Layer-Drift (BUG-008): wenn jemand ``[harness.openclaw]``
- um ``concurrencey = 3`` (Tippfehler) erweitert, soll Pydantic schreien
- statt den Wert stillschweigend zu droppen.
+ Against three-layer drift (BUG-008): if someone extends
+ ``[harness.openclaw]`` with ``concurrencey = 3`` (typo), Pydantic
+ should raise instead of silently dropping the value.
"""
with pytest.raises(ValidationError) as exc_info:
- OpenClawConfig(version="2026.5.7", concurrencey=3)
+ JarvisAgentHarnessConfig(version="2026.5.7", concurrencey=3)
assert "extra" in str(exc_info.value).lower()
-def test_openclaw_notification_rejects_unknown_keys():
- """Notification-Subblock erbt strict-mode."""
+def test_jarvis_agent_notification_rejects_unknown_keys():
+ """Notification sub-block inherits strict mode."""
with pytest.raises(ValidationError):
- OpenClawNotificationConfig(via="bus", unknown_flag=True)
+ JarvisAgentNotificationConfig(via="bus", unknown_flag=True)
-def test_openclaw_enabled_must_be_bool():
- """``enabled`` ist bool-typed; String-Wert wird im strict-mode abgelehnt.
+def test_jarvis_agent_harness_enabled_must_be_bool():
+ """``enabled`` is bool-typed; a dict value is rejected.
- Pydantic-v2 coerced normalerweise "true"/"false" zu bool; mit
- ``model_config = ConfigDict(extra="forbid")`` bleibt diese Coercion
- erhalten, aber harte Typ-Verletzungen wie int/float werden gefangen
- sobald sie keinen sauberen bool-Cast haben.
+ Pydantic-v2 normally coerces "true"/"false" to bool; with
+ ``model_config = ConfigDict(extra="forbid")`` that coercion is preserved,
+ but hard type violations like passing a dict are caught.
"""
- # Klare Typ-Verletzung: dict statt bool.
with pytest.raises(ValidationError):
- OpenClawConfig(version="2026.5.7", enabled={"foo": "bar"})
+ JarvisAgentHarnessConfig(version="2026.5.7", enabled={"foo": "bar"})
-def test_openclaw_round_trip_with_full_block():
- """Vollstaendiger Block — alle Felder explizit — laedt sauber."""
- cfg = OpenClawConfig(
+def test_jarvis_agent_harness_round_trip_with_full_block():
+ """Full block — all fields explicit — loads cleanly."""
+ cfg = JarvisAgentHarnessConfig(
version="2026.5.7",
enabled=True,
binary_path="C:/tools/openclaw/openclaw.cmd",
@@ -221,7 +219,7 @@ def test_openclaw_round_trip_with_full_block():
concurrency=2,
cost_cap_eur=8.5,
state_dir_root="C:/jarvis/openclaw_state",
- notification=OpenClawNotificationConfig(
+ notification=JarvisAgentNotificationConfig(
via="announcement_bus",
toast=False,
voice_when_active=False,
diff --git a/tests/unit/ui/test_orb_bus_bridge.py b/tests/unit/ui/test_orb_bus_bridge.py
index ec4a894452..6956533800 100644
--- a/tests/unit/ui/test_orb_bus_bridge.py
+++ b/tests/unit/ui/test_orb_bus_bridge.py
@@ -32,7 +32,7 @@ except ModuleNotFoundError: # pragma: no cover
from jarvis.core.events import (
AudioOutFirst,
- OpenClawBackgroundCompleted,
+ JarvisAgentBackgroundCompleted,
ResponseGenerated,
SystemStateChanged,
TranscriptionUpdate,
@@ -940,7 +940,7 @@ async def test_orb_pops_in_when_background_task_finishes_while_idle() -> None:
orb = _FakeOrb()
bridge = OrbBusBridge(bus=_FakeBus(), orb=orb, idle_animations_enabled=False) # type: ignore[arg-type]
- await bridge._on_background_completed(OpenClawBackgroundCompleted(success=True)) # noqa: SLF001
+ await bridge._on_background_completed(JarvisAgentBackgroundCompleted(success=True)) # noqa: SLF001
assert ("show", "speak") in orb.calls