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(overlay): decouple CU mouse tools from the OS-Level IPC install

Ruben Lütke18cadc7c1412
diff --git a/jarvis/brain/factory.py b/jarvis/brain/factory.py
index 1e7e7df8dc..638b710877 100644
--- a/jarvis/brain/factory.py
+++ b/jarvis/brain/factory.py
@@ -1063,7 +1063,16 @@ def _phase2_full_brain(
if _inst.name not in cu_tools:
cu_tools[_inst.name] = _inst
except Exception as _exc: # noqa: BLE001
- log.debug("CU extra tool '%s' not loadable: %s", _ep.name, _exc)
+ # WARNING, not debug: a CU tool that silently vanishes
+ # here makes every plan that names it fail at execute
+ # time with "tool not wired" — invisible at default log
+ # level for months (2026-07-06 forensic: click/
+ # click_element/move_mouse were dropped on every host
+ # without the OS-Level editable install).
+ log.warning(
+ "CU tool '%s' failed to load and is DROPPED from the "
+ "Computer-Use tool set: %s", _ep.name, _exc,
+ )
# The `drag` action has no entry-point plugin (it was historically
# handled inline); inject it directly so the CU loop routes drag
# through the ToolExecutor for risk-tier / blacklist / audit parity
@@ -1074,7 +1083,10 @@ def _phase2_full_brain(
cu_tools.setdefault("drag", DragTool())
except Exception as _exc: # noqa: BLE001
- log.debug("CU drag tool not loadable: %s", _exc)
+ log.warning(
+ "CU drag tool failed to load and is DROPPED from the "
+ "Computer-Use tool set: %s", _exc,
+ )
# Wave 3: optionally build the native Gemini computer_use engine.
# Returns None unless [computer_use].prefer_native is on AND the
# active provider is Gemini, so the default (hand-rolled) path is
diff --git a/jarvis/control/mouse.py b/jarvis/control/mouse.py
index 2966fe2646..ef61002eb6 100644
--- a/jarvis/control/mouse.py
+++ b/jarvis/control/mouse.py
@@ -20,7 +20,6 @@ from typing import Iterator, Optional
from jarvis.overlay import (
ActionKind,
- get_overlay,
overlay_action_sync,
)
from jarvis.overlay.cursor_writer import CursorStreamer
@@ -72,7 +71,15 @@ def click(
"""
import pyautogui # lazy
- bridge = get_overlay()
+ # Lazy + defensive: get_overlay pulls the IPC bridge stack (OS-Level
+ # schema package). On a host without that install the ripple overlay
+ # degrades to a no-op — the click itself must never depend on it.
+ try:
+ from jarvis.overlay import get_overlay # noqa: PLC0415
+
+ bridge = get_overlay()
+ except Exception: # noqa: BLE001
+ bridge = None
# Pre-resolve click coordinates so emit_click receives the real values
# (pyautogui.click(x=None) uses the current cursor position).
if x is None or y is None:
diff --git a/jarvis/overlay/__init__.py b/jarvis/overlay/__init__.py
index 9200665ec9..e26ba85428 100644
--- a/jarvis/overlay/__init__.py
+++ b/jarvis/overlay/__init__.py
@@ -16,26 +16,47 @@ same API. Caller code notices nothing structurally.
from __future__ import annotations
-from .bridge import (
- NoOpOverlayBridge,
- OverlayBridge,
- is_sub_agent_process,
-)
-from .integration import (
- get_overlay,
- is_overlay_enabled,
- set_overlay,
- start_overlay,
- stop_overlay,
-)
-from .supervisor import OverlaySupervisor
-from .triggers import (
- ActionKind,
- overlay_action,
- overlay_action_scope,
- overlay_action_scope_sync,
- overlay_action_sync,
-)
+from importlib import import_module
+from typing import Any
+
+# PEP 562 lazy re-exports. The eager form pulled ``.bridge`` -> ``.schema`` ->
+# the OS-Level ``overlay.schema`` package (+ its ``ulid`` dependency) into
+# EVERY import of ANY ``jarvis.overlay`` submodule — so a host without the
+# OS-Level editable install could not even import ``virtual_cursor`` /
+# ``system_cursor``, which silently killed the Computer-Use mouse tools
+# (click / click_element / move_mouse) at plugin load (2026-07-06 forensic:
+# the tools loaded only on the maintainer's interpreter, where a manual
+# ``pip install -e OS-Level`` existed). Lazy resolution keeps the public API
+# identical while only the names someone actually uses pay their import cost.
+_EXPORTS: dict[str, str] = {
+ "NoOpOverlayBridge": ".bridge",
+ "OverlayBridge": ".bridge",
+ "is_sub_agent_process": ".bridge",
+ "get_overlay": ".integration",
+ "is_overlay_enabled": ".integration",
+ "set_overlay": ".integration",
+ "start_overlay": ".integration",
+ "stop_overlay": ".integration",
+ "OverlaySupervisor": ".supervisor",
+ "ActionKind": ".triggers",
+ "overlay_action": ".triggers",
+ "overlay_action_scope": ".triggers",
+ "overlay_action_scope_sync": ".triggers",
+ "overlay_action_sync": ".triggers",
+}
+
+
+def __getattr__(name: str) -> Any:
+ submodule = _EXPORTS.get(name)
+ if submodule is None:
+ raise AttributeError(f"module {__name__!r} has no attribute {name!r}")
+ value = getattr(import_module(submodule, __name__), name)
+ globals()[name] = value # cache: subsequent lookups skip __getattr__
+ return value
+
+
+def __dir__() -> list[str]:
+ return sorted(set(globals()) | set(_EXPORTS))
__all__ = [
"ActionKind",
diff --git a/jarvis/overlay/schema.py b/jarvis/overlay/schema.py
index ecc2bbb033..8011d4b522 100644
--- a/jarvis/overlay/schema.py
+++ b/jarvis/overlay/schema.py
@@ -3,17 +3,30 @@
AD-15: single source. Every change to the wire format happens in
``OS-Level/src/overlay/schema.py``; here only re-imports.
-The ``OS-Level/src`` directory must be on ``sys.path`` for
-``import overlay.schema`` to work. The main-Jarvis bootstrap path
-(``jarvis.overlay.server.start_ipc_server``) extends ``sys.path`` lazily
-on first call, so the import doesn't already fail at module load
-if someone imports ``jarvis.overlay`` in isolation.
+The ``overlay`` package resolves either from a real install (``pip install
+-e OS-Level``) or — fallback — from the in-repo ``OS-Level/src`` tree, which
+this module puts on ``sys.path`` itself when the first import misses.
"""
from __future__ import annotations
-# sys.path extension handled lazily in jarvis/overlay/__init__.py.
-from overlay.schema import ( # noqa: F401 (re-exports)
+import sys
+from pathlib import Path
+
+# Self-sufficient resolution of the OS-Level package (2026-07-06). The old
+# comment claimed a lazy sys.path extension elsewhere — it never existed, so
+# this import only worked on hosts with a manual ``pip install -e OS-Level``
+# (the maintainer's interpreter). In a full repo checkout, fall back to
+# putting ``OS-Level/src`` on sys.path; on a proper install the probe import
+# succeeds and the fallback never runs.
+try:
+ import overlay.schema # noqa: F401 — probe only
+except ModuleNotFoundError:
+ _os_level_src = Path(__file__).resolve().parents[2] / "OS-Level" / "src"
+ if _os_level_src.is_dir() and str(_os_level_src) not in sys.path:
+ sys.path.append(str(_os_level_src))
+
+from overlay.schema import ( # noqa: E402,F401 (re-exports)
AckEnvelope,
AckPayload,
ActionEndedEnvelope,