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): move the one-speaker rule onto the channel the voice model actually reads

rubenluetke10-beep70d69e941386
diff --git a/jarvis/realtime/session.py b/jarvis/realtime/session.py
index 7b753e7d74..fafd74abd8 100644
--- a/jarvis/realtime/session.py
+++ b/jarvis/realtime/session.py
@@ -898,6 +898,26 @@ _TOOL_ROLE_DIRECTIVE = (
)
+# One voice, one side, one reply. Lives in the SESSION instructions — the
+# channel every realtime transport provably delivers to its voice model —
+# because the equivalent rule in the Codex thread-start base instructions is
+# demonstrably inert there: three live calls in a row the voice performed
+# BOTH sides of a greeting exchange and hung itself up ("…Take care. Will do.
+# Catch you later. Later. Bye.", 2026-08-05 20:42) while rules delivered via
+# developer context (the ack ban, the language pin) were honored. Whatever
+# thread-start instructions configure, it is not the live voice.
+_ONE_SPEAKER_DIRECTIVE = (
+ "Live-call discipline: you are ONE voice in a two-party phone-style "
+ "conversation. Produce exactly one reply to the user's latest actual "
+ "spoken turn, then STOP and wait silently for the user's next real "
+ "utterance. Never speak both sides of the conversation, never invent, "
+ "quote, or role-play the user's answer, and never continue chatting with "
+ "yourself — a pause is the user thinking or acting, not an invitation to "
+ "fill it. Do not say goodbye, wrap up, or close the exchange unless the "
+ "user clearly did so first."
+)
+
+
# Cap for the user agent-instructions content inside the realtime session
# instructions. The block is re-sent with every per-turn session update, so a
# pathologically large file must never bloat that hot path; typical files are
@@ -1045,6 +1065,7 @@ def _session_instructions(
# for THIS user (tone, dialect, address, defaults) and must frame the
# whole spoken output, while safety and tool rules below stay above them.
preferences,
+ _ONE_SPEAKER_DIRECTIVE,
tool_directive,
# The live workspace roster sits with the tool directive because it is
# a routing rule, not background colour: it names the one class of word
diff --git a/tests/unit/realtime/test_session.py b/tests/unit/realtime/test_session.py
index 3fd41dd91a..0756c48717 100644
--- a/tests/unit/realtime/test_session.py
+++ b/tests/unit/realtime/test_session.py
@@ -7005,3 +7005,21 @@ async def test_speech_edge_keeps_the_untranscribed_answer_head_buffered():
await _drive_speech_edge(sess)
assert sess._gate.pending_audio_ms == 0
await sess.end(reason="test")
+
+
+async def test_session_instructions_carry_the_one_speaker_discipline():
+ """The one-speaker rule must travel on the channel the voice model reads.
+
+ The equivalent rule in the Codex thread-start base instructions is
+ demonstrably inert for the live voice: three calls in a row it performed
+ BOTH sides of a greeting exchange and hung itself up (2026-08-05 20:42),
+ while rules delivered via the session/developer-context channel (the ack
+ ban, the language pin) were honored.
+ """
+ from jarvis.realtime.session import _session_instructions
+
+ text = _session_instructions("de")
+ assert "ONE voice" in text
+ assert "Never speak both sides" in text
+ assert "Do not say goodbye" in text