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.
Python agent-orchestrationai-agentai-coding-assistantclaude-codecoding-agentcomputer-usedesktop-applocal-firstmcppersonal-jarvisvoice-assistantvoice-coding
fix(voice): keep status polling off WebView thread
Ruben Lütke613d5b473b29
diff --git a/jarvis/ui/web/settings_routes.py b/jarvis/ui/web/settings_routes.pyindex 2b1ce89d86..036372ac88 100644--- a/jarvis/ui/web/settings_routes.py+++ b/jarvis/ui/web/settings_routes.py@@ -25,7 +25,6 @@ Wired into the WebServer in ``server.py::_build_app`` viafrom __future__ import annotationsimport asyncio-import jsonimport loggingimport sysimport threading@@ -86,42 +85,6 @@ async def _realtime_transport_offer_ready(required: bool) -> bool | None:return await broker.pending_count() > 0-async def _embedded_realtime_capabilities(- request: Request, required: bool-) -> tuple[bool | None, bool | None, bool | None]:- """Read only non-secret WebRTC capability flags from the desktop WebView."""- if not required:- return None, None, None- desktop = getattr(request.app.state, "desktop_app", None)- window = getattr(desktop, "_window", None)- if window is None:- return None, None, None- script = (- "JSON.stringify({"- "embedded:Boolean(window.__JARVIS_EMBEDDED_DESKTOP),"- "brokerToken:Boolean(window.__JARVIS_REALTIME_BROKER_TOKEN),"- "webrtc:typeof window.RTCPeerConnection==='function'"- "})"- )- try:- raw = await asyncio.wait_for(- asyncio.to_thread(window.evaluate_js, script), timeout=1.0- )- payload = json.loads(raw) if isinstance(raw, str) else raw- if not isinstance(payload, dict):- return None, None, None- return (- bool(payload.get("embedded")),- bool(payload.get("brokerToken")),- bool(payload.get("webrtc")),- )- except (TimeoutError, TypeError, ValueError):- return None, None, None- except Exception as exc: # noqa: BLE001 - diagnostics never break mode status- log.debug("Embedded Realtime capability probe failed: %s", exc)- return None, None, None--class ReplyLanguageBody(BaseModel):language: str = Field(..., min_length=1)persist: bool = Field(default=True, description="Persist as boot default in jarvis.toml")@@ -271,11 +234,6 @@ async def get_voice_mode(request: Request) -> dict[str, object]:transport_offer_ready = await _realtime_transport_offer_ready(requires_webrtc_offer)- (- transport_client_embedded,- transport_client_capability,- transport_client_webrtc,- ) = await _embedded_realtime_capabilities(request, requires_webrtc_offer)transport_offer_detail: str | None = Noneif requires_webrtc_offer:transport_offer_detail = str(@@ -296,9 +254,6 @@ async def get_voice_mode(request: Request) -> dict[str, object]:"requires_webrtc_offer": requires_webrtc_offer,"transport_offer_ready": transport_offer_ready,"transport_offer_detail": transport_offer_detail,- "transport_client_embedded": transport_client_embedded,- "transport_client_capability": transport_client_capability,- "transport_client_webrtc": transport_client_webrtc,"active_provider": prov,# Sidebar-footer display fields: the pretty provider name + the model# an idle realtime session would use (configured pin or catalogdiff --git a/tests/unit/web/test_voice_mode_route.py b/tests/unit/web/test_voice_mode_route.pyindex 633e789aa7..7564d904dd 100644--- a/tests/unit/web/test_voice_mode_route.py+++ b/tests/unit/web/test_voice_mode_route.py@@ -81,9 +81,6 @@ def test_get_voice_mode(monkeypatch):assert body["requires_webrtc_offer"] is Falseassert body["transport_offer_ready"] is Noneassert body["transport_offer_detail"] is None- assert body["transport_client_embedded"] is None- assert body["transport_client_capability"] is None- assert body["transport_client_webrtc"] is Noneassert body["active_provider"] == "openai-realtime"# Sidebar display fields: registry label + the catalog-default model (no# pin configured in this app fixture).@@ -115,14 +112,6 @@ def test_get_voice_mode_reports_browser_offer_capability(monkeypatch):_offer_ready,)- async def _client_capabilities(_request, _required: bool):- return True, True, True-- monkeypatch.setattr(- settings_routes,- "_embedded_realtime_capabilities",- _client_capabilities,- )body = TestClient(_app(mode="realtime")).get("/api/settings/voice-mode").json()@@ -130,9 +119,6 @@ def test_get_voice_mode_reports_browser_offer_capability(monkeypatch):assert body["requires_webrtc_offer"] is Trueassert body["transport_offer_ready"] is Trueassert body["transport_offer_detail"] == "Embedded desktop WebRTC offer is ready."- assert body["transport_client_embedded"] is True- assert body["transport_client_capability"] is True- assert body["transport_client_webrtc"] is Truedef test_get_voice_mode_cross_family_gemini_only(monkeypatch):