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(sessions): stop the transcript dropping utterances the user actually said
Ruben Lütke1fb665861068
diff --git a/docs/BUGS.md b/docs/BUGS.mdindex e47db4b4b9..e857c0df13 100644--- a/docs/BUGS.md+++ b/docs/BUGS.md@@ -8054,3 +8054,79 @@ worst stall the process actually produces, and measure that instead of assumingthe remote end is at fault. What the third cause shows is the other half of therule: log an attributable cause at the boundary, or an intermittent gap staysunfalsifiable forever.++## BUG-116: the Transcription view drops whole utterances and hides entire conversations (HIGH, FIXED 2026-07-27)++**Symptom (desktop field report).** "I don't think my last transcription is+11 minutes old, and I'm fairly sure I had more than just two turns." <!-- i18n-allow: quoted maintainer report, translated -->+The list looked stale and sessions read short.++**What the recording actually lost.** An audit of the live store (842 sessions,+32 079 events) found three separate holes, all silent:++- **18 turns swallowed a user utterance.** A turn received two DIFFERENT final+ transcripts and only one survived. 07-17 19:21:03 "Wie viel Kilometer sind es <!-- i18n-allow: quoted user utterance from the forensic session -->+ im Schnitt?" and 07-15 19:56:11 "Ich möchte Business Class fliegen." appear <!-- i18n-allow: quoted user utterance from the forensic session -->+ nowhere in their transcripts.+- **18 sessions carried duplicate turn indices**, so `get_turns` (ORDER BY idx)+ returned them in arbitrary order and the view numbered the same turn twice.+- **12 finished sessions were invisible in the list** although speech was+ recorded in them — including four whose user utterance had been swallowed by+ the first defect, and eight whose only content was a voiced mission readback+ ("Done. The file is in your Outputs folder.").++**Root cause — a final transcript was bound to `VoiceTurnStarted`.**+`SessionRecorder._on_transcription_update` returned unless an OPEN turn with an+explicit lifecycle existed. Realtime does not always announce its turns: the+layer opens one silently while an out-of-band readback is speaking and+withholds `VoiceTurnStarted` (`_ensure_turn_started` publishes only when+`_external_update is None`), and the BUG-103 recovery only re-announces it+while the readback is still silent. Once the readback had audio out, the user's+next utterance arrived at a recorder whose current turn was already finalized —+and was dropped on the floor, taking the turn count with it. The bus can+produce the same gap on its own: the recorder is a wildcard subscriber, so a+dispatch past `_WILDCARD_HANDLER_TIMEOUT_S` is abandoned (seen once on+2026-07-27 15:21:32). The classic path had solved this long ago —+`_on_transcript_final` invents a turn via `_ensure_turn_open` — realtime simply+never got the same treatment. The duplicate indices were the second half of the+same split: explicit turns numbered from `event.turn_index`, invented ones from+`turn_count`, two counters that collide as soon as both kinds occur in one+session.++**Fix.**++- `jarvis/sessions/recorder.py` — a final transcript arriving with no open turn+ now opens one instead of returning (logged as a recovered turn). An open+ explicit turn still takes the whole-utterance snapshot, and the classic+ pipeline still lets `TranscriptFinal` own `user_text`, gated on a new+ `explicit_turn_lifecycle` flag so a stray STT partial can never invent a turn.+- One monotonic index allocator (`_allocate_idx`) serves both turn kinds:+ provider numbering is honoured while it leads, anything at or behind the+ high-water mark is bumped past it. A turn announced twice keeps its row.+- `jarvis/sessions/store.py` — "has content" now includes the SPOKEN track, and+ a session with no user text previews its first voiced phrase. JSON1 is probed+ once at `open()` (optional before SQLite 3.38) and the lookup degrades to+ turn text where it is missing. `schema.sql` gains+ `idx_events_session_kind`; the list query measures 1-5 ms on the real store.++**Verified on production data.** The recorded events of four real sessions were+replayed through the fixed recorder: 07-17 19:17 went from 13 turn rows (two+blank, two duplicate indices, two utterances missing) to 14 correct ones,+07-15 19:54 regained "Ich möchte Business Class fliegen.", 07-20 08:21 filled <!-- i18n-allow: quoted user utterance from the forensic session -->+its blank last turn, and the unaffected 07-27 19:08 session came out+byte-identical.++**Regression guard.** `tests/unit/sessions/test_recorder_realtime.py` — an+unannounced final becomes its own turn with its own reply, recovered and+announced turns never share an index, and a classic-pipeline partial still+invents nothing. `tests/unit/sessions/test_empty_session_visibility.py` — a+spoken-only session stays listed and previews its phrase, while a blank spoken+event does not resurrect an empty attempt.++**Class rule.** A recorder must never make the RECORD conditional on a+lifecycle event it does not control. Every producer of turn boundaries+eventually skips one — deliberately (a silent readback turn), or because the+bus abandoned the subscriber — and the honest fallback is to open a turn from+the evidence in hand, not to discard the evidence. The corollary bit the list+query too: "did anything happen here?" must be asked of every track the detail+view renders, or a conversation the user definitely heard becomes unreachable.diff --git a/jarvis/sessions/recorder.py b/jarvis/sessions/recorder.pyindex c103ec0c65..e990379fcc 100644--- a/jarvis/sessions/recorder.py+++ b/jarvis/sessions/recorder.py@@ -210,6 +210,18 @@ class _SessionState:total_tokens_in: int = 0total_tokens_out: int = 0providers_used: set[str] = field(default_factory=set)+ # Next free turn index. Explicit (provider-numbered) turns and recorder-+ # invented auto turns used to draw from two independent counters —+ # ``event.turn_index`` and ``turn_count`` — which collide as soon as both+ # kinds occur in one session: two rows shared an idx and ``get_turns``+ # (ORDER BY idx) returned them in arbitrary order, so the view numbered+ # "Turn 3" twice. One monotonic allocator keeps the ordering honest.+ next_idx: int = 0+ # True once the pipeline has published a VoiceTurnStarted for this session+ # — i.e. the turn boundaries are owned by an explicit lifecycle (realtime).+ # A final transcript arriving with no open turn is then a real utterance+ # whose VoiceTurnStarted never reached us, not a classic-pipeline partial.+ explicit_turn_lifecycle: bool = Falsecurrent_turn: _TurnState | None = None# The most recently FINALIZED turn of this session. A surface-TTS fallback# confirms playback only after its audio fully drained, so its honest@@ -516,10 +528,17 @@ class SessionRecorder:def _on_turn_started(self, event: VoiceTurnStarted) -> None:assert self._state is not None+ self._state.explicit_turn_lifecycle = True+ current = self._state.current_turn+ if current is not None and current.turn_id == event.turn_id:+ # Same turn announced twice (the realtime layer announces a turn it+ # had opened silently for an out-of-band readback once real user+ # input claims it). Re-allocating an index here would move the row.+ return# If a previous turn wasn't cleanly finalized — auto-close- if self._state.current_turn and not self._state.current_turn.finalized:+ if current and not current.finalized:self._finalize_current_turn(end_ms=event.timestamp_ns // 1_000_000)- idx = event.turn_index if event.turn_index >= 0 else self._state.turn_count+ idx = self._allocate_idx(event.turn_index)ts_ms = event.timestamp_ns // 1_000_000self._state.current_turn = _TurnState(turn_id=event.turn_id,@@ -572,6 +591,19 @@ class SessionRecorder:t.voice_provider = str(getattr(event, "voice_provider", None) or "")self._finalize_current_turn(end_ms=event.timestamp_ns // 1_000_000)+ def _allocate_idx(self, preferred: int = -1) -> int:+ """Hand out a turn index that no earlier turn of this session holds.++ The pipeline's own numbering is honoured whenever it is still ahead of+ ours (so a provider-numbered gap stays visible); anything at or behind+ the high-water mark is bumped past it.+ """+ assert self._state is not None+ idx = preferred if preferred >= 0 else self._state.next_idx+ idx = max(idx, self._state.next_idx)+ self._state.next_idx = idx + 1+ return idx+def _ensure_turn_open(self, ts_ms: int) -> None:"""If the pipeline doesn't send a VoiceTurnStarted — invent one ourselves.@@ -583,15 +615,16 @@ class SessionRecorder:return # turn still runningself._auto_turn_counter += 1auto_id = f"{self._state.session_id}-auto-{self._auto_turn_counter}"+ idx = self._allocate_idx()self._state.current_turn = _TurnState(turn_id=auto_id,- idx=self._state.turn_count,+ idx=idx,started_ms=ts_ms,)self._store.upsert_turn(turn_id=auto_id,session_id=self._state.session_id,- idx=self._state.turn_count,+ idx=idx,started_ms=ts_ms,)@@ -694,14 +727,55 @@ class SessionRecorder:self._state.current_turn.transcript_final_ms = ts_msdef _on_transcription_update(self, event: TranscriptionUpdate) -> None:- """Use Realtime's final transcript as its thinking-phase anchor."""+ """Use Realtime's final transcript as its thinking-phase anchor.++ A realtime provider publishes the whole-utterance SNAPSHOT on every+ final, so overwriting an open explicit turn is correct — the later+ snapshot contains the earlier one.++ A final that arrives with NO open turn is a different thing entirely: a+ real utterance whose ``VoiceTurnStarted`` never reached us. That happens+ whenever the realtime layer opened the turn silently for an out-of-band+ readback (it withholds the announcement while ``_external_update`` is+ set) and, less often, when the bus abandons this wildcard subscriber on+ its 5 s timeout. Returning here dropped the utterance from the+ transcript altogether AND under-counted the session's turns — the+ session showed "2 turns" for a conversation that had three+ (forensic 2026-07-27; e.g. 07-17 19:21:03 "Wie viel Kilometer sind es+ im Schnitt?" never appeared anywhere). <!-- i18n-allow: quoted user utterance -->+ The classic path already invents a turn in exactly this situation+ (``_on_transcript_final`` -> ``_ensure_turn_open``); realtime now does+ the same.+ """if not event.is_final or self._state is None:returnt = self._state.current_turn- if t is None or t.finalized or not t.uses_explicit_lifecycle:+ if t is not None and not t.finalized:+ if not t.uses_explicit_lifecycle:+ # Classic pipeline: TranscriptFinal owns user_text, and a+ # partial snapshot must not overwrite it.+ return+ t.user_text = event.text+ t.transcript_final_ms = event.timestamp_ns // 1_000_000+ return+ text = str(event.text or "").strip()+ if not text or not self._state.explicit_turn_lifecycle:+ return+ ts_ms = event.timestamp_ns // 1_000_000+ self._ensure_turn_open(ts_ms)+ recovered = self._state.current_turn+ if recovered is None:return- t.user_text = event.text- t.transcript_final_ms = event.timestamp_ns // 1_000_000+ recovered.user_text = event.text+ recovered.user_lang = self._state.language+ recovered.transcript_final_ms = ts_ms+ log.info(+ "SessionRecorder: recovered an unannounced realtime turn "+ "(session=%s turn=%s) — a final transcript arrived with no open "+ "turn",+ self._state.session_id,+ recovered.turn_id,+ )def _on_system_state(self, event: SystemStateChanged) -> None:"""Track THINKING/SPEAKING boundaries for think_ms + speak_ms.diff --git a/jarvis/sessions/schema.sql b/jarvis/sessions/schema.sqlindex 79d8523e95..ccc950b1ef 100644--- a/jarvis/sessions/schema.sql+++ b/jarvis/sessions/schema.sql@@ -90,3 +90,7 @@ CREATE TABLE IF NOT EXISTS voice_events (CREATE INDEX IF NOT EXISTS idx_events_session ON voice_events(session_id, seq);CREATE INDEX IF NOT EXISTS idx_events_turn ON voice_events(turn_id, seq);+-- The list view asks "did this session voice anything?" per candidate row+-- (see SessionStore.list_sessions). Without a kind-aware index that probe+-- walks every event of every session on the way to the newest 100.+CREATE INDEX IF NOT EXISTS idx_events_session_kind ON voice_events(session_id, kind);diff --git a/jarvis/sessions/store.py b/jarvis/sessions/store.pyindex cf6490b582..09d0b856a0 100644--- a/jarvis/sessions/store.py+++ b/jarvis/sessions/store.py@@ -43,6 +43,11 @@ class SessionStore:self._db_path = db_pathself._conn: sqlite3.Connection | None = Noneself._lock = threading.Lock()+ # SQLite's JSON1 functions are compiled in since 3.38 but were optional+ # before that, and this store must open on whatever libsqlite a distro+ # ships. Probed once at open(); the spoken-track lookups degrade to+ # "turn text only" where it is missing instead of raising.+ self._has_json1 = False# --- Lifecycle ----------------------------------------------------@@ -67,6 +72,15 @@ class SessionStore:conn.executescript(schema_sql)conn.row_factory = sqlite3.Rowself._conn = conn+ try:+ conn.execute("SELECT json_extract('{\"a\":1}', '$.a')").fetchone()+ self._has_json1 = True+ except sqlite3.Error:+ self._has_json1 = False+ log.info(+ "SessionStore: this SQLite build has no JSON1 — sessions "+ "whose only content is spoken output stay out of the list"+ )self._apply_migrations()log.debug("SessionStore opened: %s", self._db_path)@@ -398,22 +412,43 @@ class SessionStore:"""Sessions by started_ms desc — newest first.``preview`` is the first user utterance (the first turn row with- a non-empty ``user_text``). Set ``include_empty=False`` for- conversation-history surfaces: finished attempts without any persisted- user or assistant transcript stay available to diagnostics, but do not- crowd out real conversations. Open sessions remain visible while they- wait for their first turn.+ a non-empty ``user_text``), falling back to the first phrase the+ session voiced. Set ``include_empty=False`` for conversation-history+ surfaces: finished attempts without any persisted user or assistant+ transcript stay available to diagnostics, but do not crowd out real+ conversations. Open sessions remain visible while they wait for their+ first turn.++ "Has content" deliberately includes the SPOKEN track, not just the turn+ aggregates: a session whose only content is a voiced mission readback+ ("Done. The file is in your Outputs folder.") has a transcript the+ detail view and all three export formats render in full — hiding its+ row made a conversation the user had definitely heard unreachable+ (forensic 2026-07-27: 12 such sessions)."""- with self._lock:- cur = self._c.execute(- """+ spoken_text = (+ "TRIM(COALESCE(json_extract(spoken.payload_json, '$.text'), ''))"+ if self._has_json1+ else "''"+ )+ sql = f"""SELECT s.*,- (SELECT t.user_text- FROM voice_turns t- WHERE t.session_id = s.id- AND t.user_text != ''- ORDER BY t.idx ASC- LIMIT 1) AS preview+ COALESCE(+ (SELECT t.user_text+ FROM voice_turns t+ WHERE t.session_id = s.id+ AND t.user_text != ''+ ORDER BY t.idx ASC+ LIMIT 1),+ (SELECT {spoken_text}+ FROM voice_events spoken+ WHERE spoken.session_id = s.id+ AND spoken.kind = 'SpeechSpoken'+ AND {spoken_text} != ''+ ORDER BY spoken.seq ASC+ LIMIT 1),+ ''+ ) AS previewFROM voice_sessions sWHERE ? = 1OR s.ended_ms IS NULL@@ -426,9 +461,19 @@ class SessionStore:OR TRIM(COALESCE(meaningful.jarvis_text, '')) != ''))+ OR EXISTS (+ SELECT 1+ FROM voice_events spoken+ WHERE spoken.session_id = s.id+ AND spoken.kind = 'SpeechSpoken'+ AND {spoken_text} != ''+ )ORDER BY s.started_ms DESCLIMIT ? OFFSET ?- """,+ """ # noqa: S608 — spoken_text is a fixed literal, never input+ with self._lock:+ cur = self._c.execute(+ sql,(1 if include_empty else 0, limit, max(0, int(offset))),)rows = cur.fetchall()diff --git a/tests/unit/sessions/test_empty_session_visibility.py b/tests/unit/sessions/test_empty_session_visibility.pyindex 52b0885eb8..a2581d9048 100644--- a/tests/unit/sessions/test_empty_session_visibility.py+++ b/tests/unit/sessions/test_empty_session_visibility.py@@ -102,6 +102,58 @@ def test_transcript_filter_keeps_content_and_open_sessions(tmp_path) -> None:store.close()+def test_a_session_whose_only_content_was_spoken_stays_listed(tmp_path) -> None:+ """A voiced mission readback is a transcript, not an empty attempt.++ The session carries no turn text (the readback arrives after hangup and is+ persisted on the spoken track), yet the detail view and all three exports+ render it in full. Hiding the row made a conversation the user had heard+ unreachable.+ """+ store = SessionStore(tmp_path / "sessions.db")+ store.open()+ try:+ _finalize_session(store, session_id="spoken-only", started_ms=1_000)+ store.append_event(+ session_id="spoken-only",+ turn_id=None,+ ts_ms=1_500,+ kind="SpeechSpoken",+ payload={+ "text": "Done. The file is in your Outputs folder.",+ "language": "en",+ "spoken_kind": "completion",+ },+ )+ _finalize_session(store, session_id="really-empty", started_ms=2_000)++ visible = store.list_sessions(limit=10, include_empty=False)++ assert [session.id for session in visible] == ["spoken-only"]+ assert visible[0].preview == "Done. The file is in your Outputs folder."+ finally:+ store.close()+++def test_a_silent_spoken_event_does_not_resurrect_an_empty_attempt(tmp_path) -> None:+ """An event whose text is blank carries nothing to show."""+ store = SessionStore(tmp_path / "sessions.db")+ store.open()+ try:+ _finalize_session(store, session_id="blank-spoken", started_ms=1_000)+ store.append_event(+ session_id="blank-spoken",+ turn_id=None,+ ts_ms=1_500,+ kind="SpeechSpoken",+ payload={"text": " ", "language": "en", "spoken_kind": "reply"},+ )++ assert store.list_sessions(limit=10, include_empty=False) == []+ finally:+ store.close()++def test_empty_attempts_do_not_consume_the_visible_limit(tmp_path) -> None:store = SessionStore(tmp_path / "sessions.db")store.open()diff --git a/tests/unit/sessions/test_recorder_realtime.py b/tests/unit/sessions/test_recorder_realtime.pyindex 23f3183249..22928f276b 100644--- a/tests/unit/sessions/test_recorder_realtime.py+++ b/tests/unit/sessions/test_recorder_realtime.py@@ -279,6 +279,233 @@ async def test_realtime_bridge_accumulates_thinking_and_speaking_segments(store.close()+async def test_final_transcript_without_turn_started_becomes_its_own_turn(+ tmp_path,+) -> None:+ """An utterance whose VoiceTurnStarted never arrived still gets a turn.++ The realtime layer opens a turn silently while an out-of-band readback is+ speaking and withholds VoiceTurnStarted; the same gap appears when the bus+ abandons this wildcard subscriber on its timeout. The transcript used to+ drop such an utterance completely and report one turn too few.+ """+ store = SessionStore(tmp_path / "sessions.db")+ store.open()+ try:+ bus = EventBus()+ SessionRecorder(store).attach(bus)+ await bus.publish(+ VoiceSessionStarted(+ timestamp_ns=1_000_000_000,+ source_layer="speech.pipeline",+ session_id="unannounced-turn",+ wake_keyword="hotkey",+ language="de",+ )+ )+ await bus.publish(+ VoiceTurnStarted(+ timestamp_ns=1_100_000_000,+ source_layer="realtime.fake-live",+ session_id="unannounced-turn",+ turn_id="announced-turn",+ turn_index=0,+ )+ )+ await bus.publish(+ TranscriptionUpdate(+ timestamp_ns=1_200_000_000,+ source_layer="realtime.fake-live",+ text="What was the record?",+ is_final=True,+ )+ )+ await bus.publish(+ VoiceTurnCompleted(+ timestamp_ns=2_000_000_000,+ source_layer="realtime.fake-live",+ session_id="unannounced-turn",+ turn_id="announced-turn",+ user_text="What was the record?",+ user_lang="en",+ jarvis_text="Just under 24 hours.",+ jarvis_lang="en",+ tier="realtime",+ provider="fake-live",+ model="live-model",+ )+ )+ # No VoiceTurnStarted for this one — the layer opened it silently.+ await bus.publish(+ TranscriptionUpdate(+ timestamp_ns=3_000_000_000,+ source_layer="realtime.fake-live",+ text="And how many kilometres on average?",+ is_final=True,+ )+ )+ await bus.publish(+ ResponseGenerated(+ timestamp_ns=4_000_000_000,+ source_layer="realtime.fake-live",+ text="About six hundred.",+ language="en",+ )+ )+ await bus.publish(+ VoiceSessionEnded(+ timestamp_ns=5_000_000_000,+ source_layer="speech.pipeline",+ session_id="unannounced-turn",+ hangup_reason="hotkey",+ turn_count=2,+ )+ )++ turns = store.get_turns("unannounced-turn")+ assert [turn.user_text for turn in turns] == [+ "What was the record?",+ "And how many kilometres on average?",+ ]+ assert turns[1].jarvis_text == "About six hundred."+ assert len({turn.idx for turn in turns}) == 2+ session = store.get_session("unannounced-turn")+ assert session is not None+ assert session.turn_count == 2+ finally:+ store.close()+++async def test_recovered_and_announced_turns_never_share_an_index(tmp_path) -> None:+ """Provider numbering and recorder-invented turns share one allocator."""+ store = SessionStore(tmp_path / "sessions.db")+ store.open()+ try:+ bus = EventBus()+ SessionRecorder(store).attach(bus)+ await bus.publish(+ VoiceSessionStarted(+ timestamp_ns=1_000_000_000,+ source_layer="speech.pipeline",+ session_id="index-collision",+ wake_keyword="hotkey",+ language="de",+ )+ )+ # The realtime layer counts silent readback turns too, so its indices+ # arrive with gaps; the recorder-invented turn in between must not+ # reuse an index the provider already handed out.+ for offset, (turn_id, turn_index) in enumerate(+ (("turn-a", 3), ("turn-b", 7)), start=1+ ):+ await bus.publish(+ VoiceTurnStarted(+ timestamp_ns=1_000_000_000 + offset * 1_000_000_000,+ source_layer="realtime.fake-live",+ session_id="index-collision",+ turn_id=turn_id,+ turn_index=turn_index,+ )+ )+ await bus.publish(+ TranscriptionUpdate(+ timestamp_ns=1_100_000_000 + offset * 1_000_000_000,+ source_layer="realtime.fake-live",+ text=f"utterance {turn_id}",+ is_final=True,+ )+ )+ await bus.publish(+ VoiceTurnCompleted(+ timestamp_ns=1_500_000_000 + offset * 1_000_000_000,+ source_layer="realtime.fake-live",+ session_id="index-collision",+ turn_id=turn_id,+ user_text=f"utterance {turn_id}",+ user_lang="en",+ jarvis_text="ok",+ jarvis_lang="en",+ tier="realtime",+ provider="fake-live",+ model="live-model",+ )+ )+ # An unannounced utterance right after each completed turn.+ await bus.publish(+ TranscriptionUpdate(+ timestamp_ns=1_800_000_000 + offset * 1_000_000_000,+ source_layer="realtime.fake-live",+ text=f"recovered after {turn_id}",+ is_final=True,+ )+ )+ await bus.publish(+ VoiceSessionEnded(+ timestamp_ns=9_000_000_000,+ source_layer="speech.pipeline",+ session_id="index-collision",+ hangup_reason="hotkey",+ turn_count=4,+ )+ )++ turns = store.get_turns("index-collision")+ indices = [turn.idx for turn in turns]+ assert len(indices) == 4+ assert len(set(indices)) == 4, indices+ assert indices == sorted(indices)+ assert [turn.user_text for turn in turns] == [+ "utterance turn-a",+ "recovered after turn-a",+ "utterance turn-b",+ "recovered after turn-b",+ ]+ finally:+ store.close()+++async def test_classic_pipeline_partials_never_invent_a_turn(tmp_path) -> None:+ """Without an explicit turn lifecycle, TranscriptFinal stays the owner."""+ store = SessionStore(tmp_path / "sessions.db")+ store.open()+ try:+ bus = EventBus()+ SessionRecorder(store).attach(bus)+ await bus.publish(+ VoiceSessionStarted(+ timestamp_ns=1_000_000_000,+ source_layer="speech.pipeline",+ session_id="classic-pipeline",+ wake_keyword="hotkey",+ language="de",+ )+ )+ await bus.publish(+ TranscriptionUpdate(+ timestamp_ns=1_200_000_000,+ source_layer="stt.whisper",+ text="a stray final from the classic path",+ is_final=True,+ )+ )+ await bus.publish(+ VoiceSessionEnded(+ timestamp_ns=2_000_000_000,+ source_layer="speech.pipeline",+ session_id="classic-pipeline",+ hangup_reason="hotkey",+ turn_count=0,+ )+ )++ assert store.get_turns("classic-pipeline") == []+ finally:+ store.close()++@pytest.mark.asyncioasync def test_realtime_progress_bridge_survives_into_plain_export(tmp_path) -> None:"""Every audible bridge line must precede the final reply in the export."""