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): never speak announcements through TTS outside an open voice session
rubenluetke10-beep5b765e1c9e6d
diff --git a/jarvis/speech/pipeline.py b/jarvis/speech/pipeline.pyindex bda004ce6d..b702bca9fd 100644--- a/jarvis/speech/pipeline.py+++ b/jarvis/speech/pipeline.py@@ -5225,12 +5225,17 @@ class SpeechPipeline:self._requeue_unvoiced_reply(event)return- async def _on_announcement(self, event: AnnouncementRequested) -> None:+ async def _on_announcement(+ self, event: AnnouncementRequested, *, cancel_heartbeats: bool = True+ ) -> None:"""Deliver a readback through the live voice or the classic TTS path.Agent replies wait for an open call. Interrupt-priority announcementsretain the existing player-stop behavior. Classic playback uses- synthesize() and play_chunks(), the same path as ordinary answers.+ synthesize() and play_chunks(), the same path as ordinary answers,+ and only inside an open voice session. ``cancel_heartbeats=False``+ lets a caller that already retired its own spawn watchdog keep the+ other missions' heartbeats alive."""event_kind = getattr(event, "kind", None)is_readback = event_kind in _READBACK_KINDS@@ -5293,6 +5298,9 @@ class SpeechPipeline:# preamble / untagged late announcement stays dropped. Live bug# 2026-06-14: a heavy research mission's result was silently dropped# because the user hung up 13 s after the optimistic ACK.+ # Since 2026-10-05 a readback passes this gate only to reach a live+ # call that is still open; the classic-voice gate further down keeps+ # it silent once no voice session is open.if hangup is not None and hangup.is_set() and not is_readback:log.info("Announcement nach Hangup unterdrückt: %r", event.text[:80]@@ -5302,7 +5310,7 @@ class SpeechPipeline:# pending "still on it" heartbeats so a reassurance never lands AFTER the# result (the success path does not publish JarvisAgentBackgroundCompleted,# so the heartbeat is not otherwise drained on completion). 2026-06-19.- if is_readback:+ if is_readback and cancel_heartbeats:self._cancel_spawn_heartbeats()log.info("📢 Announcement: %r (prio=%s lang=%s)",@@ -5617,18 +5625,22 @@ class SpeechPipeline:if is_agent_reply and self._agent_reply_needs_session():self._defer_agent_reply(event)return- # Re-check the hangup gate at the moment of SPEAKING, not only at- # arrival: the user can hang up during the seconds between the two- # (scrub, dedup, the realtime-delivery probe), and the entry check- # has already passed by then. A stale ephemeral line then plays into- # or right after the ended call as a phantom second voice (forensic- # 2026-07-13 18:37: hotkey hang-up landed 1.2 s after the preamble- # entered this handler). Owed readbacks still punch through, exactly- # like at the entry gate (AD-OE5/OE6).- if hangup is not None and hangup.is_set() and not is_readback:+ # The classic TTS voice speaks only inside a conversation the user+ # opened. Checked at the moment of SPEAKING, not only at arrival: the+ # user can hang up during the scrub/dedup/realtime probe above. Every+ # kind is covered — a mission, routine or sub-agent result that lands+ # while no session is open, or after a hang-up, is not voiced out of+ # nowhere (user decision 2026-10-05, replaces the AD-OE6 readback+ # punch-through). The result stays in the app and in the realtime+ # announcement memory mirrored at the top of this handler.+ if not self._classic_voice_session_open():+ if is_agent_reply:+ # Owed to the user at the next call, delivered once.+ self._defer_agent_reply(event)+ returnlog.info(- "Announcement dropped — session hung up while it was being "- "prepared: %r",+ "Announcement not spoken — no open voice session (kind=%s): %r",+ event_kind or "normal",event.text[:80],)return@@ -5726,6 +5738,23 @@ class SpeechPipeline:"""return self._realtime_voice_handle() is not None+ def _classic_voice_session_open(self) -> bool:+ """True while the user is in an open classic-pipeline conversation.++ The classic TTS voice may speak an announcement only here. With no+ session (idle, hung up, or still choosing its engine), a classic+ readback would be Jarvis talking out of nowhere in a second voice;+ background results stay in the app and the conversation memory.+ """+ hangup = getattr(self, "_hangup_event", None)+ return bool(+ getattr(self, "_current_voice_session_id", None) is not None+ and not (hangup is not None and hangup.is_set())+ and not getattr(self, "_voice_engine_transitioning", False)+ and getattr(self, "_turn_state", TurnTakingState.IDLE)+ is not TurnTakingState.IDLE+ )+def _schedule_delegation_results(self) -> None:"""One coalescing task; a user's conversation always keeps the floor."""inbox = getattr(self, "_delegation_inbox", None)@@ -6229,17 +6258,12 @@ class SpeechPipeline:async def _on_background_completed(self, event: JarvisAgentBackgroundCompleted) -> None:- """Proaktive Voice-Ansage wenn ein Background-Jarvis-Agent-Task fertig wird.-- User-Wunsch 2026-05-11 (Bug-Report Voice-Spawn-Latenz): Completion-- Voice-Meldung soll hoerbar sein, damit der User auch dann Bescheid- weiss, wenn er zwischenzeitlich anderes gemacht hat. Phrasen sind- fix + ohne "Sir" + ohne Engineering-Jargon, damit der Output-Filter- (``scrub_for_voice``) nicht den Spruch komplett wegwirft.+ """Announce a finished background Jarvis-Agent task.- Vorher (2026-04-25 .. 2026-05-10) war dieser Pfad mit einem fruehen- ``return`` suppress't — Wunsch damals war "keine standardisierten- Bestaetigungs-Phrasen". 2026-05-11 widerrufen.+ The readback goes through ``_on_announcement`` like every other+ announcement: an open realtime call speaks it, an open classic+ session speaks it, and with no open voice session it is not voiced+ at all (user decision 2026-10-05: no spoken news out of nowhere).CRIT-5 (2026-05-17): cancel the oldest pending spawn-watchdog --FIFO matches the sequential dispatch model. If the watchdog has@@ -6328,71 +6352,25 @@ class SpeechPipeline:returncleaned = scrubbed.cleaned.strip()log.info(- "Jarvis-Agent background fertig (success=%s, dauer=%.1fs) — Ansage: %r",+ "Jarvis-Agent background finished (success=%s, duration=%.1fs) — readback: %r",event.success, event.duration_s, cleaned,)- # AD-OE5: this path plays straight to the player, bypassing- # ``_on_announcement``. If the user holds the floor, park the readback- # as a completion announcement and let the turn-boundary flush replay it- # through the choke point (which then emits it to the session log + plays- # it). Returning here means it is neither logged-as-spoken nor played- # until the floor clears — no barge, no double-emit.- if getattr(self, "_turn_state", TurnTakingState.IDLE) in _USER_HOLDS_FLOOR_STATES:- self._deferred_announcements.append(- AnnouncementRequested(- source_layer="harness.jarvis_agent.background",- text=cleaned,- language=lang,- priority="normal",- kind="subagent",- )- )- log.info(- "Background completion deferred — user holds the floor: %r",- cleaned[:80],- )- return- # Document the sub-agent readback in the session log — it is voiced- # through this background path, not _speak, so it would otherwise be- # invisible in the Transcription view. Tagged ``subagent`` so it renders- # on the attributed "Jarvis Sub-Agent / Output" track.- # Re-arm the readback grace exactly like ``_on_announcement`` (:2386): a- # background result delivered through THIS direct path also hands the- # floor back to the user, so ``_active_session`` must keep the mic open- # afterward instead of idle-hanging-up seconds later (2026-06-19).- self._last_announcement_spoken_monotonic = time.monotonic()- # Laufendes Playback stoppen damit die Ansage prompt durchkommt.- try:- self._player.stop()- except Exception as exc: # noqa: BLE001- log.warning("Player-Stop vor Background-Ansage fehlgeschlagen: %s", exc)- # Animate the mascot/orb for this readback too (same as _on_announcement);- # restore DETERMINISTICALLY afterward — IDLE if the user hung up, else- # LISTENING. No prior-state capture, so this never races a concurrently- # flushed deferred announcement.- animate = self._supervisor is not None- hangup = getattr(self, "_hangup_event", None)- if animate:- await self._transition("SPEAKING")- self._assistant_work_count = getattr(self, "_assistant_work_count", 0) + 1- try:- self._register_assistant_speech(cleaned)- try:- chunks = self._tts.synthesize(cleaned, language_code=self._bcp47(lang))- except TypeError:- chunks = self._tts.synthesize(cleaned)- playback_result = await self._player.play_chunks(chunks)- self._touch_assistant_speech_activity()- if self._playback_confirmed(playback_result):- self._emit_spoken(cleaned, lang, SPOKEN_KIND_SUBAGENT)- except Exception as exc: # noqa: BLE001- log.warning("Background-completed Voice-Ansage failed: %s", exc)- finally:- self._assistant_work_count -= 1- self._last_announcement_spoken_monotonic = time.monotonic()- if animate:- hungup = hangup is not None and hangup.is_set()- await self._transition("IDLE" if hungup else "LISTENING")+ # One choke point for every spoken announcement: ``_on_announcement``+ # hands the readback to an open realtime call, defers it while the+ # user holds the floor, and never lets the classic TTS voice speak+ # it outside an open voice session.+ await self._on_announcement(+ AnnouncementRequested(+ source_layer="harness.jarvis_agent.background",+ text=cleaned,+ language=lang,+ priority="normal",+ kind="subagent",+ ),+ # The FIFO pop above retired this mission's own watchdog; a+ # newer mission that is still running keeps its heartbeat.+ cancel_heartbeats=False,+ )async def _on_spawn_announcement(self, event: JarvisAgentAnnouncement) -> None:"""Spawn-ACK ist auf User-Wunsch (2026-05-12) deaktiviert.diff --git a/tests/fakes/voice_session.py b/tests/fakes/voice_session.pynew file mode 100644index 0000000000..de6f551439--- /dev/null+++ b/tests/fakes/voice_session.py@@ -0,0 +1,20 @@+"""Put a test ``SpeechPipeline`` inside an open classic voice conversation.++The classic TTS voice speaks an announcement only while the user is in an+open voice session (``SpeechPipeline._classic_voice_session_open``). Tests+that exercise that playback path open a session with this helper; tests+that prove the "no voice out of nowhere" rule leave it closed.+"""+from __future__ import annotations++from typing import Any+++def open_classic_voice_session(pipeline: Any, *, session_id: str = "test-session") -> Any:+ """Mark ``pipeline`` as being inside an open classic voice session."""+ from jarvis.speech.pipeline import TurnTakingState++ pipeline._current_voice_session_id = session_id+ if getattr(pipeline, "_turn_state", TurnTakingState.IDLE) is TurnTakingState.IDLE:+ pipeline._turn_state = TurnTakingState.LISTENING+ return pipelinediff --git a/tests/integration/test_ack_flow.py b/tests/integration/test_ack_flow.pyindex c8ed99cf4c..c05d4135e1 100644--- a/tests/integration/test_ack_flow.py+++ b/tests/integration/test_ack_flow.py@@ -153,6 +153,7 @@ async def test_happy_path_announcement_handler_calls_tts_once() -> None:_is_agent_reply=SpeechPipeline._is_agent_reply,_deliver_announcement_via_realtime=_not_delivered_via_realtime,_realtime_session_owns_voice=lambda: False,+ _classic_voice_session_open=lambda: True,_register_assistant_speech=lambda _text: None,_playback_confirmed=lambda _result: True,# Instant acknowledgment (2026-08-17): the handler compares the sourcediff --git a/tests/unit/speech/test_agent_reply_readbacks.py b/tests/unit/speech/test_agent_reply_readbacks.pyindex 6d5ce8346a..969e286d60 100644--- a/tests/unit/speech/test_agent_reply_readbacks.py+++ b/tests/unit/speech/test_agent_reply_readbacks.py@@ -137,6 +137,7 @@ async def test_classic_playback_failure_keeps_the_agent_reply():pipe, _, _, _ = _pipeline(accepted=False)pipe._active_voice_mode = "pipeline"pipe._active_realtime_handle = None+ pipe._current_voice_session_id = "classic-session"class Player:async def play_chunks(self, chunks, **kwargs):diff --git a/tests/unit/speech/test_announcement_bridge.py b/tests/unit/speech/test_announcement_bridge.pyindex d1edcbf60d..538c6ccffc 100644--- a/tests/unit/speech/test_announcement_bridge.py+++ b/tests/unit/speech/test_announcement_bridge.py@@ -29,6 +29,7 @@ from jarvis.core.events import ()from jarvis.core.protocols import AudioChunkfrom jarvis.speech.pipeline import SpeechPipeline+from tests.fakes.voice_session import open_classic_voice_session@dataclass@@ -90,7 +91,7 @@ def _make_pipeline(pipeline = SpeechPipeline(tts=tts, bus=bus, enable_whisper_wake=False)if player is not None:pipeline._player = player # type: ignore[assignment]- return pipeline+ return open_classic_voice_session(pipeline)@pytest.mark.asyncio@@ -467,10 +468,9 @@ async def test_jarvis_agent_completion_signal_does_speak_with_summary() -> None:@pytest.mark.asyncio-async def test_completion_announcement_speaks_after_hangup() -> None:- """A kind="completion" announcement must be SPOKEN even after hangup — it is- the offloaded answer, a fresh turn. RED before WS3b (the hangup gate drops- every announcement regardless of kind)."""+async def test_completion_announcement_stays_silent_after_hangup() -> None:+ """After a hang-up the classic TTS voice does not speak a completion —+ Jarvis never talks out of nowhere (2026-10-05). The result stays in the app."""bus = EventBus()tts = FakeTTS()player = FakePlayer()@@ -486,8 +486,8 @@ async def test_completion_announcement_speaks_after_hangup() -> None:))- assert tts.calls == [("Deine Reise-Recherche ist fertig.", "de-DE")] # i18n-allow: matches simulated German voice output above- assert player.plays == 1+ assert tts.calls == []+ assert player.plays == 0@pytest.mark.asyncio@@ -532,9 +532,9 @@ async def test_plain_late_announcement_still_dropped_after_hangup() -> None:@pytest.mark.asyncio-async def test_background_completed_speaks_after_hangup() -> None:- """An JarvisAgentBackgroundCompleted readback is by definition fresh — it must- be spoken even after hangup. RED before WS3b (the hangup gate dropped it)."""+async def test_background_completed_stays_silent_after_hangup() -> None:+ """A JarvisAgentBackgroundCompleted readback after a hang-up is not voiced+ by the classic TTS voice (2026-10-05: no voice out of nowhere)."""bus = EventBus()tts = FakeTTS()player = FakePlayer()@@ -551,10 +551,8 @@ async def test_background_completed_speaks_after_hangup() -> None:))- assert tts.calls == [- ("Fertig. Fuenf Recherche-Themen liegen bereit.", "de-DE") # i18n-allow: matches simulated German voice output above- ]- assert player.plays == 1+ assert tts.calls == []+ assert player.plays == 0@pytest.mark.asynciodiff --git a/tests/unit/speech/test_announcement_user_speaking_guard.py b/tests/unit/speech/test_announcement_user_speaking_guard.pyindex eec406d984..52e4a87913 100644--- a/tests/unit/speech/test_announcement_user_speaking_guard.py+++ b/tests/unit/speech/test_announcement_user_speaking_guard.py@@ -30,6 +30,7 @@ from jarvis.core.bus import EventBusfrom jarvis.core.events import AnnouncementRequestedfrom jarvis.core.protocols import AudioChunkfrom jarvis.speech.pipeline import SpeechPipeline, TurnTakingState+from tests.fakes.voice_session import open_classic_voice_session@dataclass@@ -78,7 +79,7 @@ class FakePlayer:def _make_pipeline(tts: FakeTTS, bus: EventBus, player: FakePlayer) -> SpeechPipeline:pipeline = SpeechPipeline(tts=tts, bus=bus, enable_whisper_wake=False)pipeline._player = player # type: ignore[assignment]- return pipeline+ return open_classic_voice_session(pipeline)async def _flush_deferred() -> None:diff --git a/tests/unit/speech/test_idle_keeps_session_during_cu.py b/tests/unit/speech/test_idle_keeps_session_during_cu.pyindex 7ef1940cd2..8e0acde3f3 100644--- a/tests/unit/speech/test_idle_keeps_session_during_cu.py+++ b/tests/unit/speech/test_idle_keeps_session_during_cu.py@@ -26,6 +26,7 @@ from jarvis.harness.computer_use_context import (register_active_cu_token,)from jarvis.speech.pipeline import SpeechPipeline+from tests.fakes.voice_session import open_classic_voice_session@dataclass@@ -85,7 +86,9 @@ def test_cu_mission_active_false_for_cancelled_token() -> None:def _pipeline(bus: EventBus) -> SpeechPipeline:- return SpeechPipeline(tts=FakeTTS(), bus=bus, enable_whisper_wake=False)+ return open_classic_voice_session(+ SpeechPipeline(tts=FakeTTS(), bus=bus, enable_whisper_wake=False)+ )@pytest.mark.asynciodiff --git a/tests/unit/speech/test_instant_ack_pipeline.py b/tests/unit/speech/test_instant_ack_pipeline.pyindex 23a53ae0f8..def6b369f0 100644--- a/tests/unit/speech/test_instant_ack_pipeline.py+++ b/tests/unit/speech/test_instant_ack_pipeline.py@@ -24,6 +24,7 @@ from jarvis.core.events import AnnouncementRequestedfrom jarvis.core.protocols import AudioChunkfrom jarvis.speech.pipeline import SpeechPipeline, TurnTakingStatefrom jarvis.voice import instant_ack as instant_ack_module+from tests.fakes.voice_session import open_classic_voice_session@dataclass@@ -101,7 +102,7 @@ def _make_pipeline(pipeline._brain = SimpleNamespace(_readback_composer=composer) # type: ignore[attr-defined]pipeline._turn_state = TurnTakingState.PROCESSINGpipeline._brain_first_frame_played = False- return pipeline+ return open_classic_voice_session(pipeline)def _instant_acks(published: list[AnnouncementRequested]) -> list[AnnouncementRequested]:diff --git a/tests/unit/speech/test_interim_ack_gates.py b/tests/unit/speech/test_interim_ack_gates.pyindex 56a5f3b2cd..02554a7384 100644--- a/tests/unit/speech/test_interim_ack_gates.py+++ b/tests/unit/speech/test_interim_ack_gates.py@@ -28,6 +28,7 @@ from jarvis.core.bus import EventBusfrom jarvis.core.events import AnnouncementRequestedfrom jarvis.core.protocols import AudioChunkfrom jarvis.speech.pipeline import SpeechPipeline, TurnTakingState+from tests.fakes.voice_session import open_classic_voice_session@dataclass@@ -89,7 +90,7 @@ def _make_pipeline(preamble_rate_limit_per_min=rate_limit_per_min,))- return pipeline+ return open_classic_voice_session(pipeline)def _preamble(text: str, *, source_layer: str = "") -> AnnouncementRequested:diff --git a/tests/unit/speech/test_jarvis_agent_readback.py b/tests/unit/speech/test_jarvis_agent_readback.pyindex cc05666994..47e9d5edf8 100644--- a/tests/unit/speech/test_jarvis_agent_readback.py+++ b/tests/unit/speech/test_jarvis_agent_readback.py@@ -3,13 +3,14 @@Three behaviours, all on the out-of-band announcement path:* **Distinct attribution** — a spawned sub-agent / mission / worker readback is- tagged ``spoken_kind="subagent"`` (the attributed sibling of ``completion``),- yet keeps the exact same hangup punch-through + afterglow handling so an- offloaded result is never silently dropped (AD-OE6).+ tagged ``spoken_kind="subagent"`` (the attributed sibling of ``completion``).* **Speaking indicator** — the readback drives the Supervisor ``SPEAKING`` statewhile it plays (so the mascot/orb animates), then restores the prior state.-* **Keep listening** — the Jarvis-Agent-background direct path stamps the readback+* **Keep listening** — the Jarvis-Agent-background readback stamps the readbackgrace timestamp so ``_active_session`` keeps the mic open afterward.+* **No voice out of nowhere** (2026-10-05) — the classic TTS voice speaks a+ readback only inside an open voice session; after a hang-up or while idle+ it stays silent.Companion to ``test_announcement_bridge.py``; reuses its fake shapes."""@@ -29,7 +30,7 @@ from jarvis.core.events import ()from jarvis.core.protocols import AudioChunkfrom jarvis.sessions.constants import SPOKEN_KIND_SUBAGENT-from jarvis.speech.pipeline import SpeechPipeline, _announcement_spoken_kind+from jarvis.speech.pipeline import SpeechPipeline, TurnTakingState, _announcement_spoken_kindfrom jarvis.state.supervisor import Supervisor@@ -67,9 +68,16 @@ def _make_pipeline(pipeline = SpeechPipeline(tts=tts, bus=bus, enable_whisper_wake=False)if player is not None:pipeline._player = player # type: ignore[assignment]+ _open_classic_session(pipeline)return pipeline+def _open_classic_session(pipeline: SpeechPipeline) -> None:+ """Put the pipeline inside an open classic voice conversation."""+ pipeline._current_voice_session_id = "session-1" # type: ignore[attr-defined]+ pipeline._turn_state = TurnTakingState.LISTENING # type: ignore[attr-defined]++# --------------------------------------------------------------------------# Task 2 — distinct `subagent` kind, every readback guard intact# --------------------------------------------------------------------------@@ -80,9 +88,9 @@ def test_announcement_spoken_kind_maps_subagent_to_itself() -> None:@pytest.mark.asyncio-async def test_subagent_announcement_punches_through_hangup() -> None:- """A kind="subagent" readback is the offloaded answer — it must be spoken- even after the user hung up, exactly like kind="completion" (AD-OE5/OE6)."""+async def test_subagent_announcement_stays_silent_after_hangup() -> None:+ """After the user hung up, a finished sub-agent is not voiced by the classic+ TTS voice — Jarvis never speaks out of nowhere (2026-10-05)."""bus = EventBus()tts = FakeTTS()player = FakePlayer()@@ -98,8 +106,34 @@ async def test_subagent_announcement_punches_through_hangup() -> None:))- assert tts.calls == [("Deine Recherche ist fertig.", "de-DE")] # i18n-allow- assert player.plays == 1+ assert tts.calls == []+ assert player.plays == 0+++async def test_subagent_announcement_stays_silent_without_a_session() -> None:+ """A result that lands while no voice session is open is not spoken."""+ bus = EventBus()+ tts = FakeTTS()+ player = FakePlayer()+ pipeline = SpeechPipeline(tts=tts, bus=bus, enable_whisper_wake=False)+ pipeline._player = player # type: ignore[assignment]++ await bus.publish(+ AnnouncementRequested(text="Erledigt.", language="de", kind="subagent")+ )+ await bus.publish(+ JarvisAgentBackgroundCompleted(+ success=True,+ utterance="recherchier mir fuenf themen",+ summary="Fuenf Recherche-Themen liegen bereit.", # i18n-allow+ error="",+ duration_s=12.3,+ )+ )++ assert tts.calls == []+ assert player.plays == 0@pytest.mark.asyncio@@ -170,9 +204,9 @@ async def test_readback_animates_speaking_then_restores_to_listening() -> None:@pytest.mark.asyncio-async def test_readback_restores_to_idle_after_hangup() -> None:- """If the user already hung up, the readback still animates but restores to- IDLE — no surprising 'mic open' signal after a deliberate hangup."""+async def test_readback_after_hangup_neither_speaks_nor_animates() -> None:+ """If the user already hung up, the readback is not voiced, so the orb+ never flips to SPEAKING and no 'mic open' signal appears."""bus = EventBus()tts = FakeTTS()supervisor = Supervisor(bus=bus)@@ -186,8 +220,8 @@ async def test_readback_restores_to_idle_after_hangup() -> None:AnnouncementRequested(text="Erledigt.", language="de", kind="subagent"))- assert player.state_during_play == "SPEAKING"- assert supervisor.state == "IDLE"+ assert player.plays == 0+ assert supervisor.state != "SPEAKING"@pytest.mark.asyncio@@ -222,8 +256,7 @@ async def test_preamble_does_not_animate_speaking() -> None:@pytest.mark.asyncioasync def test_background_completed_arms_readback_grace() -> None:- """The Jarvis-Agent-background DIRECT path plays straight to the player (not via- _on_announcement), so it must stamp the readback-grace timestamp itself —+ """The Jarvis-Agent-background readback stamps the readback-grace timestamp —otherwise _active_session idle-times-out seconds after the result."""bus = EventBus()tts = FakeTTS()diff --git a/tests/unit/speech/test_pipeline_mute_toggle.py b/tests/unit/speech/test_pipeline_mute_toggle.pyindex 45307cb811..5470b7d666 100644--- a/tests/unit/speech/test_pipeline_mute_toggle.py+++ b/tests/unit/speech/test_pipeline_mute_toggle.py@@ -29,6 +29,7 @@ from jarvis.core.events import ()from jarvis.core.protocols import AudioChunkfrom jarvis.speech.pipeline import SpeechPipeline+from tests.fakes.voice_session import open_classic_voice_session@dataclass@@ -65,7 +66,7 @@ def _make_pipeline(bus: EventBus) -> tuple[SpeechPipeline, FakeTTS, FakePlayer]:player = FakePlayer()pipeline = SpeechPipeline(tts=tts, bus=bus, enable_whisper_wake=False)pipeline._player = player # type: ignore[assignment]- return pipeline, tts, player+ return open_classic_voice_session(pipeline), tts, player@pytest.mark.asynciodiff --git a/tests/unit/speech/test_post_interrupt_quiet_window.py b/tests/unit/speech/test_post_interrupt_quiet_window.pyindex 36e045e387..9f269ab3d3 100644--- a/tests/unit/speech/test_post_interrupt_quiet_window.py+++ b/tests/unit/speech/test_post_interrupt_quiet_window.py@@ -39,6 +39,7 @@ from jarvis.core.bus import EventBusfrom jarvis.core.events import AnnouncementRequestedfrom jarvis.core.protocols import AudioChunkfrom jarvis.speech.pipeline import SpeechPipeline+from tests.fakes.voice_session import open_classic_voice_session@dataclass@@ -80,7 +81,7 @@ def _make_pipeline("""SpeechPipeline wired with fakes — no real audio I/O."""pipeline = SpeechPipeline(tts=tts, bus=bus, enable_whisper_wake=False)pipeline._player = player # type: ignore[assignment]- return pipeline+ return open_classic_voice_session(pipeline)class _FakeClock:diff --git a/tests/unit/speech/test_realtime_announcement_bridge.py b/tests/unit/speech/test_realtime_announcement_bridge.pyindex aa4061700c..e80287020e 100644--- a/tests/unit/speech/test_realtime_announcement_bridge.py+++ b/tests/unit/speech/test_realtime_announcement_bridge.py@@ -128,9 +128,11 @@ async def test_muted_subagent_readback_is_remembered_without_audio() -> None:@pytest.mark.asyncioasync def test_dead_session_rejection_preserves_classic_tts_fallback() -> None:- """Classic TTS resumes only after the realtime handle is fully removed."""+ """Classic TTS resumes only after the realtime handle is fully removed,+ and only while the user's voice session is still open."""pipeline, tts, player, realtime = _pipeline(accepted=False)pipeline._active_realtime_handle = None+ pipeline._current_voice_session_id = "fallback-session"await pipeline._on_announcement(AnnouncementRequested(@@ -224,8 +226,9 @@ async def test_hangup_during_delivery_drops_the_stale_preamble() -> None:@pytest.mark.asyncio-async def test_hangup_during_delivery_keeps_the_owed_readback() -> None:- """An owed completion still punches through, like at the entry gate."""+async def test_hangup_during_delivery_silences_the_classic_voice() -> None:+ """A hang-up during delivery leaves no open session, so the classic voice+ stays silent instead of speaking out of nowhere (2026-10-05)."""pipeline, tts, player, _realtime = _pipeline(accepted=False)hangup = asyncio.Event()pipeline._hangup_event = hangup@@ -240,8 +243,8 @@ async def test_hangup_during_delivery_keeps_the_owed_readback() -> None:))- assert tts.calls == [("The research report is ready.", "en-US")]- assert player.plays == 1+ assert tts.calls == []+ assert player.plays == 0@pytest.mark.asynciodiff --git a/tests/unit/speech/test_spawn_watchdog.py b/tests/unit/speech/test_spawn_watchdog.pyindex d353a09dcb..48feabe873 100644--- a/tests/unit/speech/test_spawn_watchdog.py+++ b/tests/unit/speech/test_spawn_watchdog.py@@ -32,6 +32,7 @@ from jarvis.core.events import ()from jarvis.core.protocols import AudioChunkfrom jarvis.speech.pipeline import SpeechPipeline+from tests.fakes.voice_session import open_classic_voice_session# Every "still on it" heartbeat phrase across de/en/es — the watchdog now picks# a varied, language-resolved reassurance instead of the old fixed@@ -84,7 +85,7 @@ def _pipeline(bus: EventBus, *, watchdog_delay_s: float) -> SpeechPipeline:pipe._player = FakePlayer() # type: ignore[assignment]pipe._spawn_watchdog_delay_s = watchdog_delay_spipe._heartbeat_max_count = 1- return pipe+ return open_classic_voice_session(pipe)@pytest.mark.asynciodiff --git a/tests/unit/speech/test_spoken_emit.py b/tests/unit/speech/test_spoken_emit.pyindex 3a2903c7b8..8a51d569ae 100644--- a/tests/unit/speech/test_spoken_emit.py+++ b/tests/unit/speech/test_spoken_emit.py@@ -26,6 +26,7 @@ from jarvis.core.events import ListeningStarted, SpeechSpokenfrom jarvis.core.protocols import AudioChunkfrom jarvis.sessions.constants import SPOKEN_KINDSfrom jarvis.speech.pipeline import SpeechPipeline, _announcement_spoken_kind+from tests.fakes.voice_session import open_classic_voice_session# --- minimal __new__ pipe for the pure _emit_spoken helper -----------------@@ -155,7 +156,7 @@ def _make_speak_pipeline(bus: EventBus) -> SpeechPipeline:return Falsepipeline._barge_monitor = _never_barge # type: ignore[assignment]- return pipeline+ return open_classic_voice_session(pipeline)@pytest.mark.asyncio