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(setup): honest pip-failure diagnosis + wheel-only local-speech install (BUG-059)

Ruben Lütkefc130c42207d
diff --git a/docs/BUGS.md b/docs/BUGS.md
index ae3fcf6554..be70fc324b 100644
--- a/docs/BUGS.md
+++ b/docs/BUGS.md
@@ -4239,3 +4239,52 @@ init/teardown must be serialized behind a lock, and any macOS
permission-gated native surface (mic, event tap, screen) must preflight a
non-prompting probe and degrade honestly instead of letting the OS kill
the process.
+
+## BUG-059: Local speech pack install blamed the internet — missing cp314 wheel sent pip into an FFmpeg source build (MEDIUM, FIXED 2026-07-14)
+
+**Symptom.** First real-Mac onboarding (BUG-056..058 fixed, app running):
+the wake-word step's "Install the local speech pack" fails with "Install
+failed. Check your internet connection and try again." on a perfectly
+healthy connection. The pip tail underneath shows the truth: seven FFmpeg
+``Package 'libav*' not found`` lines from pkg-config, ending in
+``Failed to build 'av' when getting requirements to build wheel``.
+
+**Root cause (three layers).**
+
+1. **No cp314 wheel.** The venv is Python 3.14 (install.sh preferred the
+ newest candidate); ``av`` (a faster-whisper dependency) publishes no
+ 3.14/macOS wheel yet, so pip silently fell back to a SOURCE build that
+ needs FFmpeg dev libraries no end user has. Same wheel gap as
+ onnxruntime/webrtcvad on darwin+3.14 (pyproject markers exclude them
+ there — wake/VAD degrade, related open item).
+2. **The installer invited the source build.** ``install_pip_package`` ran
+ plain ``pip install`` — nothing told pip that an end-user machine must
+ never compile native packages.
+3. **The UI lied about the cause.** The ``enable_local_error`` string
+ hardcoded "Check your internet connection" for EVERY failure.
+
+**Fix (2026-07-14).**
+
+- ``classify_pip_failure`` (jarvis/setup/dependencies.py): missing-wheel /
+ source-build signatures → an honest "No prebuilt package exists for
+ Python X.Y on this system yet … Python 3.12 or 3.13 has full prebuilt
+ support"; only genuine network signatures name the network; unknown
+ stays the raw pip tail. The diagnosis leads the returned message.
+- ``install_pip_package(..., only_binary=True)`` adds
+ ``--only-binary=:all:``; the enable-local-speech route pins it so pip
+ fails fast with the diagnosis instead of attempting a toolchain build.
+- ``enable_local_error`` rewritten in en/de/es: the details name the
+ cause; only a connection error in the details means a network problem.
+- install.sh candidate order: ``python3.13 python3.12 python3.11
+ python3.14 …`` — 3.14 stays a working core fallback until the native
+ stack ships cp314 wheels (comment marks the revert condition).
+
+Guards: ``tests/unit/setup/test_pip_failure_diagnosis.py``,
+``tests/unit/ui/test_wake_local_speech_install.py::test_install_is_wheel_only_for_end_users``,
+``tests/unit/install/test_install_sh_python_detection.py::test_prefers_python_with_full_native_wheel_support``.
+
+**Class rule.** An in-app installer on an end-user machine is wheel-only:
+a source-build fallback is never satisfiable there, and every failure
+message must name the actual failing layer — "check your internet" as a
+catch-all turns a version gap into user gaslighting. "Newest Python
+first" is wrong while the native wheel ecosystem lags a fresh CPython.
diff --git a/install/install.sh b/install/install.sh
index fb8afb320b..e02bb69cc2 100755
--- a/install/install.sh
+++ b/install/install.sh
@@ -112,7 +112,11 @@ find_python() {
_py_try "$JARVIS_PYTHON"
return $?
fi
- for candidate in python3.14 python3.13 python3.12 python3.11 python3 python; do
+ # 3.13/3.12/3.11 before 3.14 (BUG-059): the local-voice native stack
+ # (av / ctranslate2 / onnxruntime) publishes no cp314 wheels yet, so a
+ # 3.14 venv boots fine but cannot install the local speech pack. 3.14
+ # stays as a working core fallback; move it forward once wheels exist.
+ for candidate in python3.13 python3.12 python3.11 python3.14 python3 python; do
command -v "$candidate" >/dev/null 2>&1 || continue
if _py_try "$candidate"; then return 0; fi
done
diff --git a/jarvis/setup/dependencies.py b/jarvis/setup/dependencies.py
index 56dbbeb3b9..e139120109 100644
--- a/jarvis/setup/dependencies.py
+++ b/jarvis/setup/dependencies.py
@@ -243,7 +243,58 @@ def install_npm_package(package: str, *, timeout_s: float = 300.0) -> tuple[bool
return True, (result.stdout or "").strip()[:400] or "install reported success"
-def install_pip_package(package: str, *, timeout_s: float = 600.0) -> tuple[bool, str]:
+# Marker substrings for classify_pip_failure, matched case-insensitively.
+# Network first would be wrong: a source-build log can mention retries, so the
+# more specific build/no-wheel signatures win before network generalities.
+_PIP_NO_WHEEL_MARKERS = (
+ "failed to build",
+ "getting requirements to build wheel",
+ "pkg-config could not find",
+ "no matching distribution found",
+ "could not find a version that satisfies",
+ "microsoft visual c++",
+ "fatal error:",
+)
+_PIP_NETWORK_MARKERS = (
+ "newconnectionerror",
+ "temporary failure in name resolution",
+ "connection refused",
+ "readtimeouterror",
+ "network is unreachable",
+ "proxyerror",
+ "ssl: certificate",
+)
+
+
+def classify_pip_failure(stderr: str) -> str | None:
+ """Turn pip's stderr tail into an honest one-line diagnosis, or ``None``.
+
+ BUG-059: on the first real-Mac onboarding a missing cp314/macOS wheel for
+ ``av`` sent pip into an FFmpeg SOURCE build that no end user can satisfy —
+ and the UI blamed the internet connection. A missing prebuilt wheel (or
+ the source build it triggers) must be named as such; only genuine network
+ signatures may point at the network.
+ """
+ s = (stderr or "").lower()
+ if any(marker in s for marker in _PIP_NO_WHEEL_MARKERS):
+ ver = f"{sys.version_info[0]}.{sys.version_info[1]}"
+ return (
+ f"No prebuilt package exists for Python {ver} on this system yet "
+ "(pip tried to build it from source, which needs developer "
+ "libraries). Python 3.12 or 3.13 has full prebuilt support - "
+ "install one from python.org and re-run the Jarvis installer."
+ )
+ if any(marker in s for marker in _PIP_NETWORK_MARKERS):
+ return (
+ "Network problem reaching the package index - check your "
+ "connection or proxy and try again."
+ )
+ return None
+
+
+def install_pip_package(
+ package: str, *, timeout_s: float = 600.0, only_binary: bool = False
+) -> tuple[bool, str]:
"""Best-effort ``<python> -m pip install <package>`` into the RUNNING
interpreter. Never raises. Returns ``(ok, message)``.
@@ -255,17 +306,27 @@ def install_pip_package(package: str, *, timeout_s: float = 600.0) -> tuple[bool
host does not flash a console (AP-1). Cross-platform: ``python -m pip`` is
the one install invocation that behaves identically on Windows/macOS/Linux.
A frozen/no-pip interpreter fails cleanly with a message instead of raising.
+
+ ``only_binary=True`` adds ``--only-binary=:all:`` — for end-user-facing
+ installs of native packages, so pip fails fast with the honest no-wheel
+ diagnosis instead of attempting a source build (FFmpeg/toolchain) that no
+ end user can satisfy (BUG-059).
"""
if not sys.executable:
return False, "no Python interpreter available to run pip"
- logger.info("install_pip_package: %s -m pip install %s", sys.executable, package)
+ cmd = [
+ sys.executable, "-m", "pip", "install",
+ "--disable-pip-version-check",
+ ]
+ if only_binary:
+ cmd += ["--only-binary", ":all:"]
+ cmd.append(package)
+
+ logger.info("install_pip_package: %s", " ".join(cmd))
try:
result = subprocess.run( # noqa: S603 -- args are controlled, not user input
- [
- sys.executable, "-m", "pip", "install",
- "--disable-pip-version-check", package,
- ],
+ cmd,
capture_output=True,
text=True,
timeout=timeout_s,
@@ -280,7 +341,9 @@ def install_pip_package(package: str, *, timeout_s: float = 600.0) -> tuple[bool
# The tail of stderr carries pip's actual reason (resolver conflict,
# no matching wheel for the platform, network error).
stderr = (result.stderr or "").strip()[-600:]
- return False, f"pip exited {result.returncode}: {stderr or 'no stderr'}"
+ raw = f"pip exited {result.returncode}: {stderr or 'no stderr'}"
+ diagnosis = classify_pip_failure(stderr)
+ return False, f"{diagnosis} [{raw}]" if diagnosis else raw
return True, (result.stdout or "").strip()[-400:] or "install reported success"
@@ -307,5 +370,6 @@ __all__ = [
"check_openclaw",
"install_claude_cli",
"install_npm_package",
+ "classify_pip_failure",
"install_pip_package",
]
diff --git a/jarvis/ui/web/frontend/src/i18n/locales/de.json b/jarvis/ui/web/frontend/src/i18n/locales/de.json
index cdfd3b4f04..7e4265e002 100644
--- a/jarvis/ui/web/frontend/src/i18n/locales/de.json
+++ b/jarvis/ui/web/frontend/src/i18n/locales/de.json
@@ -1121,7 +1121,7 @@
"enable_local_button": "Beliebiges Wake-Word aktivieren",
"enable_local_installing": "Sprachpaket wird installiert… das kann einen Moment dauern.",
"enable_local_done": "Sprachpaket installiert. Dein Wake-Word ist ohne Neustart bereit.",
- "enable_local_error": "Installation fehlgeschlagen. Prüfe deine Internetverbindung und versuche es erneut.",
+ "enable_local_error": "Installation fehlgeschlagen - die Details unten nennen die Ursache. Meist gibt es für diese Python-Version oder dieses System noch kein fertiges Paket; nur ein Verbindungsfehler in den Details bedeutet ein Netzwerkproblem.",
"enable_local_retry": "Erneut versuchen",
"enable_local_restart": "Jetzt neu starten",
"restarting": "Neustart…",
diff --git a/jarvis/ui/web/frontend/src/i18n/locales/en.json b/jarvis/ui/web/frontend/src/i18n/locales/en.json
index b36d56a7e5..2c1868ed27 100644
--- a/jarvis/ui/web/frontend/src/i18n/locales/en.json
+++ b/jarvis/ui/web/frontend/src/i18n/locales/en.json
@@ -1122,7 +1122,7 @@
"enable_local_button": "Enable any wake word",
"enable_local_installing": "Installing the local speech pack… this can take a minute.",
"enable_local_done": "Local speech pack installed. Your wake word is ready without a restart.",
- "enable_local_error": "Install failed. Check your internet connection and try again.",
+ "enable_local_error": "Install failed - the details below name the cause. Most often no prebuilt package exists yet for this Python version or system; only a connection error in the details means a network problem.",
"enable_local_retry": "Try again",
"enable_local_restart": "Restart now",
"restarting": "Restarting…",
diff --git a/jarvis/ui/web/frontend/src/i18n/locales/es.json b/jarvis/ui/web/frontend/src/i18n/locales/es.json
index e3c3d5bace..e64646bc19 100644
--- a/jarvis/ui/web/frontend/src/i18n/locales/es.json
+++ b/jarvis/ui/web/frontend/src/i18n/locales/es.json
@@ -1121,7 +1121,7 @@
"enable_local_button": "Activar cualquier palabra de activación",
"enable_local_installing": "Instalando el paquete de voz local… puede tardar un momento.",
"enable_local_done": "Paquete de voz local instalado. Tu palabra de activación está lista sin reiniciar.",
- "enable_local_error": "Error en la instalación. Comprueba tu conexión a Internet e inténtalo de nuevo.",
+ "enable_local_error": "La instalación falló: los detalles de abajo indican la causa. Lo más habitual es que aún no exista un paquete precompilado para esta versión de Python o este sistema; solo un error de conexión en los detalles significa un problema de red.",
"enable_local_retry": "Intentar de nuevo",
"enable_local_restart": "Reiniciar ahora",
"restarting": "Reiniciando…",
diff --git a/jarvis/ui/web/settings_routes.py b/jarvis/ui/web/settings_routes.py
index a5e233e0cf..e5d47a81bd 100644
--- a/jarvis/ui/web/settings_routes.py
+++ b/jarvis/ui/web/settings_routes.py
@@ -538,7 +538,11 @@ def _run_local_speech_install() -> None:
from jarvis.setup.dependencies import install_pip_package
- ok, message = install_pip_package(_LOCAL_SPEECH_PACKAGE)
+ # only_binary: this runs on an END USER's machine — pip must never fall
+ # back to a source build (av needs FFmpeg dev libs, ctranslate2 a
+ # toolchain). No wheel for this Python/OS → fail fast with the honest
+ # classify_pip_failure diagnosis instead (BUG-059).
+ ok, message = install_pip_package(_LOCAL_SPEECH_PACKAGE, only_binary=True)
# Let this same process's find_spec see the freshly-installed package, so the
# status endpoint flips to available without a restart (the wake PIPELINE
# still needs a restart to actually use it — the UI says so).
diff --git a/tests/unit/install/test_install_sh_python_detection.py b/tests/unit/install/test_install_sh_python_detection.py
index 0bd13ee2a0..b140fbeb8d 100644
--- a/tests/unit/install/test_install_sh_python_detection.py
+++ b/tests/unit/install/test_install_sh_python_detection.py
@@ -214,3 +214,14 @@ def test_ps1_failure_reports_what_was_found() -> None:
bootstrap must also name the too-old interpreter it found."""
ps1 = (REPO / "install" / "install.ps1").read_text(encoding="utf-8")
assert "Closest match" in ps1
+
+
+def test_prefers_python_with_full_native_wheel_support() -> None:
+ """BUG-059: the local-voice native stack (av / ctranslate2 / onnxruntime)
+ ships no cp314 wheels yet — a 3.14 venv boots but cannot install the
+ local speech pack. The finder must prefer 3.13/3.12/3.11 and keep 3.14
+ only as a working core fallback."""
+ src = INSTALL_SH.read_text(encoding="utf-8")
+ line = next(ln for ln in src.splitlines() if "for candidate in" in ln)
+ for older in ("python3.13", "python3.12", "python3.11"):
+ assert line.index(older) < line.index("python3.14"), older
diff --git a/tests/unit/setup/test_pip_failure_diagnosis.py b/tests/unit/setup/test_pip_failure_diagnosis.py
new file mode 100644
index 0000000000..94ecb3fd79
--- /dev/null
+++ b/tests/unit/setup/test_pip_failure_diagnosis.py
@@ -0,0 +1,95 @@
+"""Honest pip-failure diagnosis + wheel-only install (BUG-059).
+
+On the first real-Mac onboarding, enabling the local speech pack failed with
+"Failed to build 'av'" (no cp314/macOS wheel -> pip fell back to a SOURCE
+build that needs FFmpeg dev libraries no end user has) — and the UI blamed
+the user's internet connection. Two contracts locked here:
+
+1. ``classify_pip_failure`` names the real cause: a missing prebuilt wheel /
+ source-build failure is reported as such (with the running Python
+ version), and only genuine network errors mention the network.
+2. ``install_pip_package(..., only_binary=True)`` passes
+ ``--only-binary=:all:`` so an end-user install NEVER attempts a source
+ build — it fails fast with the honest no-wheel message instead.
+"""
+from __future__ import annotations
+
+import sys
+from types import SimpleNamespace
+
+from jarvis.setup import dependencies as deps
+
+_FFMPEG_BUILD_STDERR = (
+ "Package 'libavformat' not found Package 'libavcodec' not found "
+ "pkg-config could not find libraries ['avformat', 'avcodec'] "
+ "[end of output] note: This error originates from a subprocess, and is "
+ "likely not a problem with pip. ERROR: Failed to build 'av' when "
+ "getting requirements to build wheel"
+)
+
+
+def test_source_build_failure_is_diagnosed_as_missing_wheel() -> None:
+ msg = deps.classify_pip_failure(_FFMPEG_BUILD_STDERR)
+ assert msg is not None
+ assert "prebuilt" in msg.lower()
+ ver = f"{sys.version_info[0]}.{sys.version_info[1]}"
+ assert ver in msg # names the running Python so the fix is actionable
+ assert "internet" not in msg.lower()
+
+
+def test_no_matching_distribution_is_diagnosed_as_missing_wheel() -> None:
+ msg = deps.classify_pip_failure(
+ "ERROR: Could not find a version that satisfies the requirement av "
+ "(from versions: none)\nERROR: No matching distribution found for av"
+ )
+ assert msg is not None
+ assert "prebuilt" in msg.lower()
+
+
+def test_network_failure_is_diagnosed_as_network() -> None:
+ msg = deps.classify_pip_failure(
+ "WARNING: Retrying (Retry(total=0)) after connection broken by "
+ "'NewConnectionError(': Failed to establish a new connection: "
+ "[Errno -3] Temporary failure in name resolution')'"
+ )
+ assert msg is not None
+ assert "network" in msg.lower()
+
+
+def test_unknown_failure_returns_none_for_generic_fallback() -> None:
+ assert deps.classify_pip_failure("something entirely unexpected") is None
+
+
+def _fake_run_recorder(record: list) -> object:
+ def _run(cmd, **_kw):
+ record.append(cmd)
+ return SimpleNamespace(returncode=0, stdout="ok", stderr="")
+
+ return _run
+
+
+def test_only_binary_flag_forbids_source_builds(monkeypatch) -> None:
+ cmds: list[list[str]] = []
+ monkeypatch.setattr(deps.subprocess, "run", _fake_run_recorder(cmds))
+ ok, _ = deps.install_pip_package("faster-whisper>=1.0", only_binary=True)
+ assert ok is True
+ assert "--only-binary" in cmds[0]
+ assert ":all:" in cmds[0]
+
+
+def test_default_install_keeps_todays_command_shape(monkeypatch) -> None:
+ cmds: list[list[str]] = []
+ monkeypatch.setattr(deps.subprocess, "run", _fake_run_recorder(cmds))
+ deps.install_pip_package("rich")
+ assert "--only-binary" not in cmds[0] # opt-in only — AD-7 for other callers
+
+
+def test_failed_install_message_leads_with_the_diagnosis(monkeypatch) -> None:
+ def _run(cmd, **_kw):
+ return SimpleNamespace(returncode=1, stdout="", stderr=_FFMPEG_BUILD_STDERR)
+
+ monkeypatch.setattr(deps.subprocess, "run", _run)
+ ok, msg = deps.install_pip_package("faster-whisper>=1.0", only_binary=True)
+ assert ok is False
+ assert msg.lower().startswith("no prebuilt")
+ assert "pip exited 1" in msg # raw tail preserved below the diagnosis
diff --git a/tests/unit/ui/test_wake_local_speech_install.py b/tests/unit/ui/test_wake_local_speech_install.py
index 2a4bd40e9c..14a4d98913 100644
--- a/tests/unit/ui/test_wake_local_speech_install.py
+++ b/tests/unit/ui/test_wake_local_speech_install.py
@@ -143,3 +143,21 @@ def test_available_pack_reapplies_current_wake_plan_live(monkeypatch) -> None:
assert pipeline.plan is not None
assert pipeline.plan.phrase == "Hey Fable"
assert pipeline.plan.wake_available is True
+
+
+def test_install_is_wheel_only_for_end_users(monkeypatch) -> None:
+ # BUG-059: pip must never fall back to a source build on an end-user
+ # machine (av needs FFmpeg dev libs) — the route pins only_binary=True.
+ _reset_state()
+ monkeypatch.setattr(sr, "_local_whisper_available", lambda: False)
+ kwargs: list[dict] = []
+
+ def fake_install(pkg, **kw):
+ kwargs.append(kw)
+ return True, "ok"
+
+ monkeypatch.setattr("jarvis.setup.dependencies.install_pip_package", fake_install)
+ monkeypatch.setattr(sr.threading, "Thread", _SyncThread)
+ _client().post("/api/settings/wake-word/enable-local-speech")
+ assert kwargs and kwargs[0].get("only_binary") is True
+ _reset_state()