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.

feat(web-api): update missions, provider & server routes

Ruben Lütkeaaf14f738551
diff --git a/jarvis/ui/web/missions_routes.py b/jarvis/ui/web/missions_routes.py
index 24dad75d86..5c69c428fd 100644
--- a/jarvis/ui/web/missions_routes.py
+++ b/jarvis/ui/web/missions_routes.py
@@ -189,10 +189,10 @@ async def get_mission(mission_id: str, request: Request) -> dict[str, Any]:
if env.payload.event_type == "CriticVerdictReady"
]
- # Phase 9 (Welle 4 UI): OpenClaw-Worker-Snapshots fuer die UI-Spalten
- # (Modell / Cost / State-Dir / Logfile / Reattach-Status). Pure Aggregation
- # ueber den vorhandenen Event-Stream — kein Schema-Drift, kein Live-Lookup.
- openclaw_workers = extract_worker_missions(envelopes)
+ # Phase 9 (Welle 4 UI): Worker-Snapshots for the UI columns
+ # (model / cost / state-dir / logfile / reattach status). Pure aggregation
+ # over the existing event stream — no schema drift, no live lookup.
+ worker_snapshots = extract_worker_missions(envelopes)
return {
"mission": {
@@ -207,7 +207,7 @@ async def get_mission(mission_id: str, request: Request) -> dict[str, Any]:
},
"events": events_dump,
"verdicts": verdicts,
- "openclaw_workers": openclaw_workers,
+ "worker_snapshots": worker_snapshots,
}
diff --git a/jarvis/ui/web/provider_routes.py b/jarvis/ui/web/provider_routes.py
index cbed8737a3..a64ba5b63a 100644
--- a/jarvis/ui/web/provider_routes.py
+++ b/jarvis/ui/web/provider_routes.py
@@ -372,11 +372,11 @@ def _codex_binary_path(request: Request | None = None) -> str | None:
return getattr(getattr(cfg, "codex", None), "binary_path", "") or None
-def _apply_sub_jarvis_in_memory(request: Request, provider: str) -> None:
+def _apply_worker_in_memory(request: Request, provider: str) -> None:
"""Best-effort in-memory update of ``cfg.brain.sub_jarvis.provider``.
- So the next ``/openclaw/status`` reflects the choice immediately (the worker
- itself only re-reads at restart). Frozen / detached cfg is not an error.
+ So the next ``/jarvis-agent/status`` reflects the choice immediately (the
+ worker itself only re-reads at restart). Frozen / detached cfg is not an error.
"""
cfg = _resolve_cfg(request)
if cfg is None or getattr(cfg, "brain", None) is None:
@@ -393,10 +393,10 @@ def _apply_sub_jarvis_in_memory(request: Request, provider: str) -> None:
log.debug("In-memory sub_jarvis.provider update skipped: %s", exc)
-def _apply_sub_jarvis_model_in_memory(request: Request, model: str) -> None:
+def _apply_worker_model_in_memory(request: Request, model: str) -> None:
"""Best-effort in-memory update of ``cfg.brain.sub_jarvis.model``.
- Mirrors :func:`_apply_sub_jarvis_in_memory`; a missing ``sub_jarvis``
+ Mirrors :func:`_apply_worker_in_memory`; a missing ``sub_jarvis``
block is created with the router primary as provider so the override is
never silently dropped.
"""
@@ -578,7 +578,7 @@ async def _tier_section_health(cfg: Any, spec: ProviderSpec | None) -> SectionHe
)
-def _subagent_worker_usable(provider: str) -> bool:
+def _worker_usable(provider: str) -> bool:
"""Best-effort "is the selected heavy-task worker connected/keyed?".
Provider-agnostic: a CLI login (Codex / Antigravity / Claude) is usable when
@@ -608,7 +608,7 @@ def _subagent_worker_usable(provider: str) -> bool:
return False
-def _subagent_section_health(cfg: Any) -> SectionHealth:
+def _jarvis_agent_section_health(cfg: Any) -> SectionHealth:
"""Subagents tab: reflects whether the SELECTED heavy-task worker is usable.
A real "does it answer" call for a CLI worker is heavy, so v1 reports the
@@ -634,7 +634,7 @@ def _subagent_section_health(cfg: Any) -> SectionHealth:
)
spec = get_spec(provider)
label = spec.label if spec is not None else provider
- if _subagent_worker_usable(provider):
+ if _worker_usable(provider):
return SectionHealth(
status=_section_health.OK, reason="ok", detail=f"Subagent worker: {label}"
)
@@ -707,7 +707,7 @@ async def section_health(request: Request, refresh: bool = False) -> SectionHeal
_tier_section_health(cfg, stt_spec),
)
try:
- sections["subagents"] = _subagent_section_health(cfg)
+ sections["subagents"] = _jarvis_agent_section_health(cfg)
except Exception as exc: # noqa: BLE001
log.warning("section-health subagent check failed: %s", exc)
sections["subagents"] = SectionHealth()
@@ -1529,8 +1529,8 @@ async def stt_switch(body: SwitchBody, request: Request) -> dict[str, Any]:
}
[email protected]("/subagent/switch")
-async def subagent_switch(body: SwitchBody, request: Request) -> dict[str, Any]:
[email protected]("/jarvis-agent/switch")
+async def jarvis_agent_switch(body: SwitchBody, request: Request) -> dict[str, Any]:
"""Wechselt den aktiven SUBAGENT-Provider (``[brain.sub_jarvis].provider``).
Das ist der Heavy-Task-Worker (lies Repo, baue Feature, reproduziere Bug) —
@@ -1556,17 +1556,17 @@ async def subagent_switch(body: SwitchBody, request: Request) -> dict[str, Any]:
nach Voice-/App-Restart: ``restart_required: true`` (wie bei STT).
"""
from jarvis.missions.worker_runtime.provider_map import (
- JARVIS_TO_OPENCLAW,
- canonical_subagent_provider,
+ JARVIS_TO_WORKER_SLUG,
+ canonical_worker_provider,
)
# Normalize (lower/strip + ``openclaw-claude`` -> ``claude-api``) so the
# accepted set matches what the UI cards display.
- provider = canonical_subagent_provider(body.provider) or ""
+ provider = canonical_worker_provider(body.provider) or ""
- # Codex is a DIRECT worker (CodexDirectWorker) with no OpenClaw slug — it is
- # not in JARVIS_TO_OPENCLAW. Handle it explicitly: it can be backed by the
- # ChatGPT subscription (OAuth, ``codex login``) OR an OpenAI API key.
+ # Codex is a DIRECT worker (CodexDirectWorker) with no worker-harness slug —
+ # it is not in JARVIS_TO_WORKER_SLUG. Handle it explicitly: it can be backed by
+ # the ChatGPT subscription (OAuth, ``codex login``) OR an OpenAI API key.
if provider in _CODEX_SUBAGENT_SLUGS:
codex_connected = CodexAuthService(_codex_binary_path(request)).status().connected
has_key = bool(
@@ -1594,7 +1594,7 @@ async def subagent_switch(body: SwitchBody, request: Request) -> dict[str, Any]:
raise HTTPException(
status_code=500, detail=f"TOML-Write fehlgeschlagen: {exc}"
) from exc
- _apply_sub_jarvis_in_memory(request, _CODEX_SUBAGENT_CANONICAL)
+ _apply_worker_in_memory(request, _CODEX_SUBAGENT_CANONICAL)
await _emit(request, SecretConfigured(key="brain.sub_jarvis.provider", action="set"))
return {
"ok": True,
@@ -1642,7 +1642,7 @@ async def subagent_switch(body: SwitchBody, request: Request) -> dict[str, Any]:
raise HTTPException(
status_code=500, detail=f"TOML-Write fehlgeschlagen: {exc}"
) from exc
- _apply_sub_jarvis_in_memory(request, ANTIGRAVITY_SUBAGENT_CANONICAL)
+ _apply_worker_in_memory(request, ANTIGRAVITY_SUBAGENT_CANONICAL)
await _emit(request, SecretConfigured(key="brain.sub_jarvis.provider", action="set"))
return {
"ok": True,
@@ -1651,8 +1651,8 @@ async def subagent_switch(body: SwitchBody, request: Request) -> dict[str, Any]:
"restart_required": True,
}
- if provider not in JARVIS_TO_OPENCLAW:
- known = ", ".join(sorted(JARVIS_TO_OPENCLAW))
+ if provider not in JARVIS_TO_WORKER_SLUG:
+ known = ", ".join(sorted(JARVIS_TO_WORKER_SLUG))
raise HTTPException(
status_code=404,
detail=(
@@ -1698,9 +1698,9 @@ async def subagent_switch(body: SwitchBody, request: Request) -> dict[str, Any]:
status_code=500, detail=f"TOML-Write fehlgeschlagen: {exc}"
) from exc
- # Best-effort in-memory update so the next /openclaw/status reflects the
+ # Best-effort in-memory update so the next /jarvis-agent/status reflects the
# choice immediately (the worker itself only re-reads on restart).
- _apply_sub_jarvis_in_memory(request, provider)
+ _apply_worker_in_memory(request, provider)
await _emit(request, SecretConfigured(key="brain.sub_jarvis.provider", action="set"))
@@ -1720,13 +1720,13 @@ class SubagentModelBody(BaseModel):
persist: bool = Field(default=True)
[email protected]("/subagent/model")
-async def subagent_model(body: SubagentModelBody, request: Request) -> dict[str, Any]:
- """Pin which MODEL the heavy-task sub-agents run (``[brain.sub_jarvis].model``).
[email protected]("/jarvis-agent/model")
+async def jarvis_agent_model(body: SubagentModelBody, request: Request) -> dict[str, Any]:
+ """Pin which MODEL the Jarvis-Agent worker runs (``[brain.sub_jarvis].model``).
- The dedicated subagent LLM, separate from the router brain: the worker
+ The dedicated worker LLM, separate from the router brain: the worker
chain reads it per spawn (``provider_chain._resolve_provider_chain``) and
- ``/openclaw/status`` displays it as ``sub_model_override`` /
+ ``/jarvis-agent/status`` displays it as ``sub_model_override`` /
``model_resolved``. No allowlist on the model id — providers add models
faster than we could pin them; a typo simply falls back at the provider
when rejected. Empty string = the documented sentinel for "provider's
@@ -1752,9 +1752,9 @@ async def subagent_model(body: SubagentModelBody, request: Request) -> dict[str,
status_code=500, detail=f"TOML write failed: {exc}"
) from exc
- # Best-effort in-memory update so the next /openclaw/status reflects the
+ # Best-effort in-memory update so the next /jarvis-agent/status reflects the
# choice immediately (workers resolve their chain per spawn from config).
- _apply_sub_jarvis_model_in_memory(request, model)
+ _apply_worker_model_in_memory(request, model)
await _emit(request, SecretConfigured(key="brain.sub_jarvis.model", action="set"))
diff --git a/jarvis/ui/web/server.py b/jarvis/ui/web/server.py
index 0455053e9a..28864be806 100644
--- a/jarvis/ui/web/server.py
+++ b/jarvis/ui/web/server.py
@@ -205,13 +205,13 @@ class WebServer:
# Sub-Agent-Registry (Dashboard-Feature) — abonniert sofort den Bus.
try:
- from jarvis.agents import SubAgentRegistry
+ from jarvis.agents import JarvisAgentRegistry
- sub_agent_registry = SubAgentRegistry(bus=self.bus)
+ sub_agent_registry = JarvisAgentRegistry(bus=self.bus)
sub_agent_registry.attach()
app.state.sub_agent_registry = sub_agent_registry
except Exception as exc: # noqa: BLE001
- logger.opt(exception=exc).warning("SubAgentRegistry-Setup fehlgeschlagen")
+ logger.opt(exception=exc).warning("JarvisAgentRegistry setup failed")
app.state.sub_agent_registry = None
# MCP-, Tool-, Provider-, Profile-, Task-, Skills-, CLI- und Sub-Agents-
@@ -735,8 +735,8 @@ class WebServer:
"""
return {"ready": bool(getattr(self, "_voice_ready", False))}
- @app.get("/api/openclaw/status")
- async def openclaw_status() -> dict[str, Any]:
+ @app.get("/api/jarvis-agent/status")
+ async def jarvis_agent_status() -> dict[str, Any]:
"""OpenClaw-Bridge-Status fuer die SettingsView (Welle 3).
Read-only Snapshot:
@@ -767,13 +767,13 @@ class WebServer:
try:
from jarvis.missions.worker_runtime.provider_map import (
MAPPINGS,
- canonical_subagent_provider,
- to_provider_slug,
+ canonical_worker_provider,
+ to_worker_slug,
)
except Exception: # noqa: BLE001
MAPPINGS = () # type: ignore[assignment]
- to_provider_slug = None # type: ignore[assignment]
- canonical_subagent_provider = None # type: ignore[assignment]
+ to_worker_slug = None # type: ignore[assignment]
+ canonical_worker_provider = None # type: ignore[assignment]
# The HEAVY-TASK subagent runs on ``[brain.sub_jarvis].provider`` —
# NOT on ``brain.primary`` (that is only the lightweight router
@@ -788,8 +788,8 @@ class WebServer:
getattr(sub_cfg, "provider", None) if sub_cfg is not None else None
)
sub_provider = (
- canonical_subagent_provider(sub_raw)
- if canonical_subagent_provider is not None
+ canonical_worker_provider(sub_raw)
+ if canonical_worker_provider is not None
else None
)
primary = sub_provider or router_primary
@@ -809,9 +809,9 @@ class WebServer:
)
provider_slug: str | None = None
- if to_provider_slug is not None:
+ if to_worker_slug is not None:
try:
- provider_slug = to_provider_slug(primary)
+ provider_slug = to_worker_slug(primary)
except Exception: # noqa: BLE001
provider_slug = None
@@ -873,7 +873,7 @@ class WebServer:
mapping_rows.append(
{
"jarvis": mapping.jarvis,
- "openclaw": mapping.openclaw,
+ "worker_slug": mapping.worker_slug,
"env_var": mapping.env_var,
"env_fallback": mapping.env_fallback,
"key_set": key_set,
@@ -2035,33 +2035,33 @@ class WebServer:
from jarvis.brain.factory import (
set_kontrollierer,
set_mission_manager,
- set_openclaw_bootstrap_failed,
+ set_worker_bootstrap_failed,
)
set_mission_manager(result["manager"])
set_kontrollierer(result["kontrollierer"])
- set_openclaw_bootstrap_failed(False)
- self.app.state.openclaw_available = True
+ set_worker_bootstrap_failed(False)
+ self.app.state.worker_available = True
except Exception as exc: # noqa: BLE001
logger.warning(
"set_mission_manager/kontrollierer-Wiring fehlgeschlagen — "
"spawn_worker wird in diesem Run deaktiviert: %s", exc,
)
# Surface the failure for both downstream readers:
- # - `self.app.state.openclaw_available` lets REST routes and
- # UI components show an explicit "OpenClaw unavailable" hint
+ # - `self.app.state.worker_available` lets REST routes and
+ # UI components show an explicit "worker unavailable" hint
# instead of permanently rendering "loading" / "pending".
# - the factory-level singleton lets the Brain's spawn_worker
# tool short-circuit at execute()-time with an honest
# "konnte nicht initialisiert werden" message instead of the
# transient "noch nicht bereit" the in-progress path returns.
- self.app.state.openclaw_available = False
+ self.app.state.worker_available = False
try:
- from jarvis.brain.factory import set_openclaw_bootstrap_failed
- set_openclaw_bootstrap_failed(True)
+ from jarvis.brain.factory import set_worker_bootstrap_failed
+ set_worker_bootstrap_failed(True)
except Exception as inner_exc: # noqa: BLE001
logger.warning(
- "set_openclaw_bootstrap_failed wiring failed: %s",
+ "set_worker_bootstrap_failed wiring failed: %s",
inner_exc,
)