Skip to content

Dodaios is an open-source agent OS for your desktop: it runs your coding agents, browser and apps by voice or chat, on your own machine. Formerly Personal Jarvis.

fix(local-models): the setup assistant always runs on Jarvis' brain — a CLI seat has none of its tools

rubenluetke10-beepd019b2c241d2
diff --git a/jarvis/agent_chat/service.py b/jarvis/agent_chat/service.py
index 7f705ac150..45a68980e0 100644
--- a/jarvis/agent_chat/service.py
+++ b/jarvis/agent_chat/service.py
@@ -69,8 +69,14 @@ def resolve_runner(provider: str, *, surface: str = "agent") -> str:
subscription only pays for the vendor's own loop — and run as Jarvis
(see :mod:`jarvis.agent_chat.jarvis_harness`).
"""
- api_runner = "brain" if kit_for(surface).brain_runner else "api"
+ kit = kit_for(surface)
+ api_runner = "brain" if kit.brain_runner else "api"
row = provider_row(provider)
+ if kit.brain_only:
+ # The surface's tools only exist inside the brain loop: a CLI seat
+ # (agy-cli, codex-cli, claude-cli) would run the vendor's coding agent
+ # without them, so any provider the brain knows is driven by the brain.
+ return "brain" if row is not None or supports_api_runner(provider) else "unknown"
if row is None:
return api_runner if supports_api_runner(provider) else "unknown"
if row.id == "claude-api":
diff --git a/jarvis/agent_chat/surface_kits.py b/jarvis/agent_chat/surface_kits.py
index 5aa31b3bda..126b116c21 100644
--- a/jarvis/agent_chat/surface_kits.py
+++ b/jarvis/agent_chat/surface_kits.py
@@ -68,6 +68,11 @@ class SurfaceKit:
surface: str
brain_runner: bool = False
+ #: Every provider is driven by the brain runner, CLI seats included. A
+ #: coding agent's own loop has none of this surface's tools, so a seat
+ #: whose provider also ships a brain plugin (antigravity, codex, claude)
+ #: must run through Jarvis' brain here rather than its vendor CLI.
+ brain_only: bool = False
ladder: str | None = None
uses_stance: bool = False
tools: ToolsBuilder | None = None
@@ -155,6 +160,7 @@ _KITS: Final[dict[str, SurfaceKit]] = {
LOCAL_MODELS_SURFACE: SurfaceKit(
surface=LOCAL_MODELS_SURFACE,
brain_runner=True,
+ brain_only=True,
ladder=_JARVIS_LADDER,
uses_stance=True,
tools=_local_models_tools,
diff --git a/tests/unit/agent_chat/test_surface_kits.py b/tests/unit/agent_chat/test_surface_kits.py
index 6afb3ffcdd..64e8d75490 100644
--- a/tests/unit/agent_chat/test_surface_kits.py
+++ b/tests/unit/agent_chat/test_surface_kits.py
@@ -117,3 +117,14 @@ async def test_search_fn_wraps_the_brains_search_web_tool() -> None:
assert rows == [{"title": "t", "url": "u", "snippet": "s"}]
assert search.queries == ["qwen3.5 LMArena"]
assert surface_kits.local_models_search_fn(_Brain(_cfg(), {})) is None
+
+
+def test_local_models_surface_drives_cli_seats_through_the_brain() -> None:
+ """A coding agent's loop has none of the lm_* tools, so a seat whose
+ provider also ships a brain plugin runs through Jarvis' brain here."""
+ from jarvis.agent_chat.service import resolve_runner
+
+ assert resolve_runner("antigravity", surface="local-models") == "brain"
+ assert resolve_runner("gemini", surface="local-models") == "brain"
+ # The Jarvis surface keeps the vendor CLI for a subscription seat.
+ assert resolve_runner("antigravity", surface="jarvis") != "brain"