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(realtime): declare the empty credential slot, or the card is not loaded

rubenluetke10-beep53f40fa73e32
diff --git a/jarvis/plugins/realtime/openai_realtime.py b/jarvis/plugins/realtime/openai_realtime.py
index 09386c4e11..52dc275b43 100644
--- a/jarvis/plugins/realtime/openai_realtime.py
+++ b/jarvis/plugins/realtime/openai_realtime.py
@@ -1258,9 +1258,14 @@ class LocalRealtimeProvider:
implicit_usage_fallback_allowed = False
input_sample_rate = _INPUT_RATE
output_sample_rate = _OUTPUT_RATE
- # No credential_candidates: this is the keyless path, so the factory builds
- # it through ``external_login_ready`` + ``from_runtime_config`` rather than
- # handing it a key.
+ # EMPTY, not absent. The keyless path is chosen by this tuple being empty
+ # (the factory then builds the provider through ``external_login_ready`` +
+ # ``from_runtime_config`` instead of handing it a key), but the RealtimeProvider
+ # protocol requires the attribute to EXIST. Leaving it off made the class fail
+ # the runtime protocol check, so the loader rejected it, the factory produced no
+ # candidate at all, and a call on this card sat on "connecting" forever with
+ # nothing ever reaching the server.
+ credential_candidates: tuple[tuple[str, str | None], ...] = ()
def __init__(
self, *, base_url: str = "", api_key: str = "", model: str = ""
diff --git a/tests/unit/realtime/test_local_realtime.py b/tests/unit/realtime/test_local_realtime.py
index bcc8bd666f..85f9885f50 100644
--- a/tests/unit/realtime/test_local_realtime.py
+++ b/tests/unit/realtime/test_local_realtime.py
@@ -79,6 +79,53 @@ def test_never_an_implicit_fallback() -> None:
assert LocalRealtimeProvider.implicit_usage_fallback_allowed is False
+def test_the_class_satisfies_the_provider_protocol() -> None:
+ """Live failure 2026-08-06: leaving ``credential_candidates`` off the class
+ (it is empty for a keyless card, so it felt redundant) made the runtime
+ protocol check fail. The loader then rejected the plugin, the factory
+ produced no candidate, and a call sat on "connecting" forever while nothing
+ ever reached the server. Declaring the attribute empty is what selects the
+ keyless path; omitting it removes the provider from the product.
+ """
+ from jarvis.realtime.protocol import RealtimeProvider
+
+ assert isinstance(LocalRealtimeProvider(), RealtimeProvider)
+ assert LocalRealtimeProvider.credential_candidates == ()
+
+
+def test_the_factory_actually_builds_it_when_selected() -> None:
+ """The contract that matters is not "the class looks right", it is "a call
+ that selects this card gets a provider object". The protocol failure above
+ was invisible to every check that stopped at the class."""
+ from jarvis.core.config import BrainConfig, BrainProviderConfig, BrainTierConfig, JarvisConfig
+ from jarvis.realtime import factory
+
+ cfg = JarvisConfig(
+ brain=BrainConfig(
+ providers={
+ "local-realtime": BrainProviderConfig(base_url="http://localhost:8765")
+ },
+ realtime=BrainTierConfig(provider="local-realtime"),
+ )
+ )
+
+ candidates = factory._provider_candidates(cfg)
+
+ assert [type(c).__name__ for c in candidates] == ["LocalRealtimeProvider"]
+
+
+def test_an_unconfigured_card_yields_no_candidate() -> None:
+ """The other half: without a server address it must stay out of the chain."""
+ from jarvis.core.config import BrainConfig, BrainTierConfig, JarvisConfig
+ from jarvis.realtime import factory
+
+ cfg = JarvisConfig(
+ brain=BrainConfig(realtime=BrainTierConfig(provider="local-realtime"))
+ )
+
+ assert factory._provider_candidates(cfg) == []
+
+
async def test_open_session_without_an_address_says_what_to_do() -> None:
with pytest.raises(RuntimeError) as err:
await LocalRealtimeProvider().open_session(SimpleNamespace())