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): reject jarvis_action on every native turn, not just public facts

Haraldbc9f1d525283
diff --git a/jarvis/realtime/session.py b/jarvis/realtime/session.py
index 01ed64553c..d8e24c80ad 100644
--- a/jarvis/realtime/session.py
+++ b/jarvis/realtime/session.py
@@ -47,7 +47,6 @@ from jarvis.brain.turn_planner import (
TurnPath,
TurnPlan,
TurnReason,
- is_public_fact_question,
plan_turn,
)
from jarvis.core.protocols import AudioChunk, BrainMessage
@@ -9162,19 +9161,18 @@ class RealtimeVoiceSession:
not self._delegate_required_for_turn
and not local_plan.requires_orchestrator
and not provider_plan.requires_orchestrator
- and is_public_fact_question(self._last_user_text)
- and is_public_fact_question(
- provider_request or self._last_user_text
- )
):
# Provider prompt compliance is not a correctness boundary.
- # Gemini called jarvis_action for ordinary public-knowledge
- # questions in the 2026-07-20 live run, consuming ~96k Tool
- # Model input tokens before the shared Google cap stopped the
- # call. Reject the unnecessary action and keep the answer in
- # the already-open realtime model. A provider that adds real
- # private/current/local intent to its normalized request still
- # reaches the orchestrator (the vague-Wiki gate-miss path).
+ # The live model calls jarvis_action for greetings, smalltalk,
+ # opinions and calendar trivia even after the discouraged
+ # turn-mode line (live 2026-08-18/19: "Was geht ab?" 10 s,
+ # "Okay." 7 s, music recommendations 17 s, "was morgen für
+ # ein Tag" 14 s into google_calendar). Each hop is a full
+ # Tool Model generate. Reject ANY native/native pair and keep
+ # the answer on the already-open realtime model. A provider
+ # that adds real private/current/local/action intent to its
+ # request still reaches the orchestrator (the vague-Wiki
+ # gate-miss path in test_gate_miss_lets_the_model_reach_the_wiki).
log.info(
"realtime[%s] rejected unnecessary delegate call for a "
"native realtime turn",
@@ -9187,8 +9185,7 @@ class RealtimeVoiceSession:
"success": False,
"error": (
"No Jarvis action is needed. Answer the user's "
- "general-knowledge request directly in this "
- "realtime response."
+ "request directly in this realtime response."
),
},
)
diff --git a/tests/unit/realtime/test_session.py b/tests/unit/realtime/test_session.py
index 969b36bf3b..8fca3eeabb 100644
--- a/tests/unit/realtime/test_session.py
+++ b/tests/unit/realtime/test_session.py
@@ -5155,6 +5155,65 @@ async def test_native_knowledge_turn_rejects_unnecessary_jarvis_action():
await sess.end(reason="test")
+ "utterance",
+ [
+ "Was geht ab?", # i18n-allow: live 2026-08-18 smalltalk, 10 s hop
+ "Okay.",
+ "Hallo, was geht ab?", # i18n-allow: live greeting
+ "Kannst du mir mal sagen, was du für Musik empfehlen würdest?", # i18n-allow
+ "Kannst mal bitte gucken, was morgen für ein Tag ist?", # i18n-allow: date trivia
+ "Ich habe das Premium Abo demnächst", # i18n-allow
+ ],
+)
+async def test_native_conversation_turn_rejects_unnecessary_jarvis_action(
+ utterance: str,
+) -> None:
+ """Smalltalk and opinions must not pay a Tool Model round trip.
+
+ The public-fact-only reject (2026-07-20) left these shapes through:
+ the planner already marks them native, but Gemini Live still called
+ ``jarvis_action`` and the hop ran a full generate (5–18 s of silence).
+ """
+ from jarvis.brain.turn_planner import plan_turn
+
+ assert plan_turn(utterance).requires_orchestrator is False
+
+ brain = FakeBrain(replies=("This must not be called.",))
+ provider = FakeProvider(
+ [
+ RealtimeEvent(
+ type="input_transcript",
+ text=utterance,
+ is_final=True,
+ ),
+ RealtimeEvent(
+ type="tool_call",
+ call_id="c-native-chat",
+ tool_name="jarvis_action",
+ tool_args={"request": utterance},
+ ),
+ RealtimeEvent(
+ type="output_transcript_delta",
+ text="Alles klar.",
+ is_final=True,
+ ),
+ RealtimeEvent(type="turn_complete"),
+ ]
+ )
+ sess = _session(provider, brain=brain)
+
+ await sess.handle_control({"type": "audio_start", "sample_rate": 16_000})
+ await sess.wait_finished()
+
+ assert brain.calls == []
+ result = provider.session.tool_results[0][2]
+ assert result["success"] is False
+ assert "Answer" in result["error"]
+ await sess.end(reason="test")
+
+
@pytest.mark.asyncio
async def test_provider_down_apology_is_not_reported_as_delegate_success():
"""A non-empty Brain outage phrase is still a failed Tool Model turn."""