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(voice-engine): refuse local voice setup where the engine has no wheels

rubenluetke10-beep657ab075ac80
diff --git a/jarvis/realtime/local_voice_setup.py b/jarvis/realtime/local_voice_setup.py
index cac834a014..643c697576 100644
--- a/jarvis/realtime/local_voice_setup.py
+++ b/jarvis/realtime/local_voice_setup.py
@@ -133,6 +133,40 @@ def platform_name() -> str:
return "linux"
+def unsupported_reason(
+ *,
+ system: str | None = None,
+ arch: str | None = None,
+ mac_version: str | None = None,
+ glibc: str | None = None,
+) -> str:
+ """Why the pinned speech runtimes cannot install here; ``""`` when they can.
+
+ Read from the wheels the pins resolve to (``uv pip compile`` per platform):
+ onnxruntime 1.30 ships macOS builds for Apple Silicon on macOS 14+ only
+ and Linux builds for glibc 2.28+; torch has no Intel Mac builds. Saying so
+ before a download beats a failed install halfway through.
+ """
+ import platform as _platform # noqa: PLC0415
+
+ system = system if system is not None else sys.platform
+ arch = (arch if arch is not None else _platform.machine()).lower()
+ if system == "darwin":
+ if arch not in ("arm64", "aarch64"):
+ return ("Local voice needs a Mac with Apple Silicon; its speech runtimes have "
+ "no builds for Intel Macs.")
+ version = mac_version if mac_version is not None else _platform.mac_ver()[0]
+ major = int(version.split(".")[0]) if version.split(".")[0].isdigit() else 0
+ if 0 < major < 14:
+ return "Local voice needs macOS 14 or newer."
+ elif system.startswith("linux"):
+ libc = glibc if glibc is not None else _platform.libc_ver()[1]
+ parts = [int(p) for p in libc.split(".")[:2] if p.isdigit()]
+ if len(parts) == 2 and tuple(parts) < (2, 28):
+ return "Local voice needs a Linux with glibc 2.28 or newer."
+ return ""
+
+
def machine_class(probe: Callable[[], tuple[float, str]] | None = None) -> str:
"""``nvidia`` | ``apple`` | ``gpu`` | ``cpu`` from the shared accelerator probe.
@@ -261,6 +295,7 @@ class SetupDeps:
configured_voice: Callable[[], str]
languages: Callable[[], list[str]]
selftest: Callable[[], dict[str, Any]] | None = None
+ unsupported: Callable[[], str] = unsupported_reason
package_source: Path = field(
default_factory=lambda: Path(__file__).resolve().parent.parent / "voice_engine")
@@ -353,6 +388,9 @@ def _copy_engine(source: Path, home: Path) -> None:
def _run_setup(deps: SetupDeps) -> None:
home = deps.home
+ blocked = deps.unsupported()
+ if blocked:
+ raise SetupError(blocked)
home.mkdir(parents=True, exist_ok=True)
env = _uv_env(home)
@@ -592,13 +630,14 @@ async def card_status(
llm_source = "default"
llm_installed = None if llm_error else any(_same_tag(llm_model, n) for n in names)
+ blocked = unsupported_reason()
engine = LocalVoiceProvider._engine # noqa: SLF001 - never create one for a status read
live = engine if engine is not None and engine.settings == settings else None
if run["running"]:
phase, stage, progress, reason = "installing", run["stage"], run["progress"], run["detail"]
elif not installed:
phase = "failed" if run["error"] else "not_installed"
- stage, progress, reason = "", 0.0, run["error"] or NOT_SET_UP_REASON
+ stage, progress, reason = "", 0.0, run["error"] or blocked or NOT_SET_UP_REASON
else:
phase, stage, progress, reason = _live_state(live)
selftest = await asyncio.to_thread(load_selftest, home, settings)
@@ -609,6 +648,9 @@ async def card_status(
"progress": round(float(progress), 3),
"reason": reason,
"installed": installed,
+ # False where the pinned runtimes have no builds (Intel Mac, macOS < 14,
+ # old glibc); ``reason`` then says why and the card offers no setup.
+ "supported": not blocked,
"setup": run,
"llm_model": llm_model,
"llm_source": llm_source,
diff --git a/jarvis/ui/web/frontend/src/components/providers/LocalVoicePanel.test.tsx b/jarvis/ui/web/frontend/src/components/providers/LocalVoicePanel.test.tsx
index 5f1b3ee23b..89be81109d 100644
--- a/jarvis/ui/web/frontend/src/components/providers/LocalVoicePanel.test.tsx
+++ b/jarvis/ui/web/frontend/src/components/providers/LocalVoicePanel.test.tsx
@@ -20,6 +20,7 @@ const NOT_INSTALLED: LocalVoiceStatus = {
progress: 0,
reason: "Local voice is not set up on this machine yet.",
installed: false,
+ supported: true,
setup: {
running: false,
stage: "",
@@ -101,6 +102,18 @@ describe("LocalVoicePanel", () => {
expect(screen.queryByTestId("local-voice-setup")).toBeNull();
});
+ it("explains an unsupported machine and offers no setup", async () => {
+ serve(() => ({
+ ...NOT_INSTALLED,
+ supported: false,
+ reason: "Local voice needs a Mac with Apple Silicon.",
+ }));
+ render(<LocalVoicePanel onChanged={() => {}} />);
+
+ expect(await screen.findByText("Local voice needs a Mac with Apple Silicon.")).toBeTruthy();
+ expect(screen.queryByTestId("local-voice-setup")).toBeNull();
+ });
+
it("shows the backend's own reason when the engine failed", async () => {
serve(() => ({
...NOT_INSTALLED,
diff --git a/jarvis/ui/web/frontend/src/components/providers/LocalVoicePanel.tsx b/jarvis/ui/web/frontend/src/components/providers/LocalVoicePanel.tsx
index efdfd79f6a..c326f58504 100644
--- a/jarvis/ui/web/frontend/src/components/providers/LocalVoicePanel.tsx
+++ b/jarvis/ui/web/frontend/src/components/providers/LocalVoicePanel.tsx
@@ -123,7 +123,10 @@ export function LocalVoicePanel({ onChanged }: { onChanged: () => void }) {
const moving = status.phase === "installing" || status.phase === "starting";
const stage = stageKey(status.stage);
const stageLabel = stage ? t(`apikeys_view.local_voice_stage_${stage}`) : "";
- const showSetup = !status.setup.running && (!status.installed || Boolean(status.setup.error));
+ const showSetup =
+ status.supported &&
+ !status.setup.running &&
+ (!status.installed || Boolean(status.setup.error));
const figure = latencyFigure(status.expected_latency, locale);
return (
@@ -142,7 +145,9 @@ export function LocalVoicePanel({ onChanged }: { onChanged: () => void }) {
<p className="font-medium text-foreground">{phaseLabel}</p>
{/* The backend's sentence explains a failure or a stop; "not set up"
is already said by the translated phase label above. */}
- {status.reason && status.phase !== "installing" && status.phase !== "not_installed" && (
+ {status.reason &&
+ status.phase !== "installing" &&
+ (status.phase !== "not_installed" || !status.supported) && (
<p className="text-muted-foreground">{status.reason}</p>
)}
</div>
diff --git a/jarvis/ui/web/frontend/src/lib/localVoice.ts b/jarvis/ui/web/frontend/src/lib/localVoice.ts
index 0ad37a8c32..dee0bd1ee3 100644
--- a/jarvis/ui/web/frontend/src/lib/localVoice.ts
+++ b/jarvis/ui/web/frontend/src/lib/localVoice.ts
@@ -83,6 +83,8 @@ export interface LocalVoiceStatus {
/** The backend's own sentence when not ready; rendered verbatim. */
reason: string;
installed: boolean;
+ /** False where the engine's runtimes have no builds; `reason` says why. */
+ supported: boolean;
setup: LocalVoiceSetupRun;
llm_model: string;
llm_source: "config" | "setup" | "default";
diff --git a/jarvis/voice_engine/requirements-engine.txt b/jarvis/voice_engine/requirements-engine.txt
index 4a22825fe4..3df8331bb1 100644
--- a/jarvis/voice_engine/requirements-engine.txt
+++ b/jarvis/voice_engine/requirements-engine.txt
@@ -7,8 +7,11 @@
#
# Derived from the P0/P1 measuring environment (Windows x64, CPython 3.12,
# 2026-10-01). Per-platform hashed locks are P3 work (plan section 4.10); until
-# then these exact pins are the contract. Only Windows x64 was installed from
-# this list so far; macOS and Linux resolve from the same pins unverified.
+# then these exact pins are the contract. `uv pip compile --torch-backend cpu`
+# resolves them for Windows x64/arm64, Linux x64/arm64 (glibc 2.28+) and
+# macOS 14+ on Apple Silicon. Intel Macs and older macOS have no onnxruntime
+# 1.30 wheels; setup refuses there up front (unsupported_reason). Installs
+# were run on Windows x64 only.
# --- direct dependencies of jarvis/voice_engine ---
numpy==2.5.3
diff --git a/tests/fakes/fake_voice_engine_setup.py b/tests/fakes/fake_voice_engine_setup.py
index aabf3a6b7e..ab75c13afc 100644
--- a/tests/fakes/fake_voice_engine_setup.py
+++ b/tests/fakes/fake_voice_engine_setup.py
@@ -29,6 +29,8 @@ class FakeSetupWorld:
voice: str = "pocket"
languages: list[str] = field(default_factory=lambda: ["de", "en"])
fail_command: str = ""
+ #: Non-empty: this machine cannot run the engine (see ``unsupported_reason``).
+ blocked: str = ""
selftest_report: dict[str, Any] | None = field(default_factory=lambda: {"ok": True})
commands: list[list[str]] = field(default_factory=list)
envs: list[dict[str, str]] = field(default_factory=list)
@@ -98,5 +100,6 @@ class FakeSetupWorld:
configured_voice=lambda: self.voice,
languages=lambda: list(self.languages),
selftest=self.selftest if self.selftest_report is not None else None,
+ unsupported=lambda: self.blocked,
package_source=package_source,
)
diff --git a/tests/unit/voice_engine/test_local_voice_setup.py b/tests/unit/voice_engine/test_local_voice_setup.py
index 637618a922..6922a2f167 100644
--- a/tests/unit/voice_engine/test_local_voice_setup.py
+++ b/tests/unit/voice_engine/test_local_voice_setup.py
@@ -101,6 +101,30 @@ def test_a_package_failure_stops_setup_at_that_stage(_isolated_home: Path) -> No
assert world.fetched == []
+def test_an_unsupported_machine_is_refused_before_any_download(_isolated_home: Path) -> None:
+ world = _world(_isolated_home, blocked="Local voice needs macOS 14 or newer.")
+ setup.run_setup_blocking(world.deps(PACKAGE))
+ assert setup.setup_snapshot()["error"] == "Local voice needs macOS 14 or newer."
+ assert world.commands == [] and world.fetched == [] and not _isolated_home.exists()
+
+
+ ("kwargs", "blocked"),
+ [
+ ({"system": "darwin", "arch": "x86_64", "mac_version": "14.5"}, True),
+ ({"system": "darwin", "arch": "arm64", "mac_version": "13.6"}, True),
+ ({"system": "darwin", "arch": "arm64", "mac_version": "15.1"}, False),
+ ({"system": "linux", "arch": "x86_64", "glibc": "2.17"}, True),
+ ({"system": "linux", "arch": "aarch64", "glibc": "2.36"}, False),
+ ({"system": "linux", "arch": "x86_64", "glibc": ""}, False),
+ ({"system": "win32", "arch": "AMD64"}, False),
+ ({"system": "win32", "arch": "ARM64"}, False),
+ ],
+)
+def test_unsupported_platforms_match_the_pinned_wheels(kwargs, blocked) -> None:
+ assert bool(setup.unsupported_reason(**kwargs)) is blocked
+
+
def test_requirements_pin_every_package_exactly() -> None:
lines = [
line.split(";")[0].strip()