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(realtime): keep the whole utterance visible and never drop speakable reply audio (BUG-066)
Ruben Lütke8b3834116649
diff --git a/jarvis/plugins/realtime/gemini_live.py b/jarvis/plugins/realtime/gemini_live.pyindex 748f5f21ab..95ac70e375 100644--- a/jarvis/plugins/realtime/gemini_live.py+++ b/jarvis/plugins/realtime/gemini_live.py@@ -36,6 +36,7 @@ class _ProviderEvent:is_final: bool = Falsems_played: int | None = Noneerror: str | None = None+ recoverable: bool = Falseitem_id: str | None = Nonecall_id: str | None = Nonetool_name: str | None = None@@ -152,6 +153,26 @@ class _GeminiLiveSession:if bool(getattr(content, "turn_complete", False)):turn_boundary_seen = True+ # Every named TurnCompleteReason except UNSPECIFIED is+ # an ABNORMAL stop (safety filter, response rejection,+ # regeneration limit, ...). A natural end leaves the+ # field unset. Discarding it made a server-truncated+ # spoken reply indistinguishable from a complete one+ # (live incident 2026-07-15 17:40: ~10% of the answer+ # was never spoken, turn_complete looked clean).+ reason = getattr(content, "turn_complete_reason", None)+ reason_name = str(+ getattr(reason, "name", None) or reason or ""+ )+ if reason_name and reason_name != (+ "TURN_COMPLETE_REASON_UNSPECIFIED"+ ):+ log.warning(+ "Gemini Live ended the turn abnormally: "+ "turn_complete_reason=%s — the spoken reply "+ "may have been cut short by the server",+ reason_name,+ )if not function_calls:yield _ProviderEvent(type="turn_complete")@@ -161,8 +182,17 @@ class _GeminiLiveSession:suffix = (f" (time_left={retry_ms})" if retry_ms is not None else "")+ # GoAway is Gemini's courteous pre-disconnect notice tied+ # to Live-API session limits, not a wire failure. Treating+ # it as terminal used to end the session with reason=error+ # while the current reply was still being spoken, dropping+ # the buffered tail. Surface it as recoverable; if the+ # transport really closes, the pump observes that end+ # separately.yield _ProviderEvent(- type="error", error=f"Gemini Live requested reconnect{suffix}"+ type="error",+ error=f"Gemini Live requested reconnect{suffix}",+ recoverable=True,)# An iterator that vanishes without a model-turn boundary signals adiff --git a/jarvis/realtime/session.py b/jarvis/realtime/session.pyindex cc26b2e221..d154e9251a 100644--- a/jarvis/realtime/session.py+++ b/jarvis/realtime/session.py@@ -1150,14 +1150,28 @@ class RealtimeVoiceSession:self._last_user_text)if transcript:+ # Publish the accumulated per-turn snapshot, never the+ # raw chunk: providers flag transcript fragments final+ # per CHUNK (Gemini per server-content message, OpenAI/+ # xAI per committed audio item), while every downstream+ # consumer (orb bubble, desktop TranscriptionView,+ # SessionRecorder) mirrors TranscriptionUpdate 1:1 as a+ # whole-utterance snapshot — a raw chunk freezes those+ # surfaces on a single fragment of the sentence.+ if event.is_final:+ snapshot = self._last_user_text or transcript+ else:+ snapshot = " ".join(+ (*self._user_transcript_parts, transcript)+ ).strip()await self._publish_transcription(- transcript, bool(event.is_final)+ snapshot, bool(event.is_final))await self._send_json({"type": "transcript","role": "user",- "text": transcript,+ "text": snapshot,"is_final": bool(event.is_final),})@@ -1567,12 +1581,57 @@ class RealtimeVoiceSession:{"type": "provider_warning", "error": message})continue+ # A terminal provider failure can strike while the tail of+ # the current reply is still held by the scrub gate.+ # Release the transcript-cleared remainder (same sequence+ # as the turn_complete branch) so the spoken answer is not+ # chopped harder than the transport failure requires;+ # audio without a cleared transcript stays withheld+ # (fail-closed).+ final_chunks = self._gate.finalize()+ if self._gate.hard_leak_pending():+ await self._cancel_unsafe_output(+ reason="output transcript missing at provider error",+ interrupt_provider=False,+ )+ for chunk in final_chunks:+ await self._emit_audio(chunk)+ self._gate.drain()self._failure_detail = messageself._failed.set()await self._send_json({"type": "provider_error", "error": message})break+ else:+ # The provider iterator ended without an exception and without+ # a terminal break (hangup/error). At an idle turn boundary+ # that is a benign transport end. MID-TURN it is a silent+ # transport death (the Gemini SDK's receive() can simply+ # vanish): without this branch the session never reaches the+ # error path — no failed flag, no provider_error for the+ # browser surface, and the transcript-cleared audio tail held+ # by the scrub gate is dropped.+ if self._output_active or self._response_requested_for_turn:+ final_chunks = self._gate.finalize()+ if self._gate.hard_leak_pending():+ await self._cancel_unsafe_output(+ reason="output transcript missing at provider stream end",+ interrupt_provider=False,+ )+ for chunk in final_chunks:+ await self._emit_audio(chunk)+ self._gate.drain()+ message = "provider stream ended mid-turn without a boundary"+ self._failure_detail = message+ self._failed.set()+ log.warning("realtime[%s] %s", self.session_id, message)+ await self._publish_error(+ "RealtimeProviderStreamEnd", message, recoverable=True+ )+ await self._send_json(+ {"type": "provider_error", "error": message}+ )except asyncio.CancelledError:raiseexcept Exception as exc: # noqa: BLE001 — AP-20: pump error is terminal@@ -2896,34 +2955,24 @@ class RealtimeVoiceSession:if not self._delegate_turn_is_active(turn_id, turn_state):returnuser_text = turn_state.user_text- if boundary_ready:- reply = (- await asyncio.wait_for(- self._dispatch_brain_turn(user_text),- timeout=_DELEGATE_TIMEOUT_S,- )- or ""- ).strip()- if reply:- turn_state.last_reply = reply- result: dict[str, Any] = {- "success": True,- "spoken_reply": reply,- }- succeeded = True- else:- result = {- "success": False,- "error": "The delegated action returned no grounded result.",- }- succeeded = False+ reply = (+ await asyncio.wait_for(+ self._dispatch_brain_turn(user_text),+ timeout=_DELEGATE_TIMEOUT_S,+ )+ or ""+ ).strip()+ if reply:+ turn_state.last_reply = reply+ result: dict[str, Any] = {+ "success": True,+ "spoken_reply": reply,+ }+ succeeded = Trueelse:result = {"success": False,- "error": (- "The complete spoken request could not be determined "- "safely, so no action was executed."- ),+ "error": "The delegated action returned no grounded result.",}succeeded = Falseexcept TimeoutError:diff --git a/jarvis/speech/pipeline.py b/jarvis/speech/pipeline.pyindex 8e07f5174c..e7dd2fb4e0 100644--- a/jarvis/speech/pipeline.py+++ b/jarvis/speech/pipeline.py@@ -6469,6 +6469,17 @@ class SpeechPipeline:passif session is not None:await session.end(reason=reason)+ if reason != "shutdown":+ # A provider failure tears the session down while already+ # scrub-cleared PCM can still sit in the local playback queue.+ # Drain it (bounded) instead of hard-stopping so the spoken+ # reply keeps every word that was already safe to say.+ # User-initiated stops (hangup/barge-in) have cancel()ed the+ # queue earlier, which makes this a fast no-op for them.+ try:+ await asyncio.wait_for(playback.finish_turn(), timeout=15.0)+ except (asyncio.CancelledError, Exception): # noqa: BLE001, S110 - teardown+ passawait playback.close()async def _ptt_session(@@ -9341,13 +9352,13 @@ class SpeechPipeline:# heartbeat (_mark_brain_progress, pinged on every tool-use-# loop round AND every streamed token; the SAME signal the# brain stall guard trusts). Live bug 2026-06-14 14:21 + 14:24- # ("weather in Melbourne"): a NON-desktop tool loop (geocode ++ # (a weather question): a NON-desktop tool loop (geocode +# DuckDuckGo + open-meteo, ~20 s of real work) emits no CU# step, so before this the 20 s ceiling beheaded the working# turn and the user heard "that took too long" + a hang-up.# • ``_brain_thinking_heartbeat`` — the PRE-first-token think# pulse from _run_brain_with_stall_guard. Live bug 2026-06-14- # 16:17 ("Reise … Melbourne"): the deep brain built an+ # 16:17 (a trip-research turn): the deep brain built an# 18k-token cache then thought silently with no on_progress# and no token, so the two heartbeats above never moved and# the 20 s ceiling beheaded a working brain.diff --git a/jarvis/ui/web/frontend/src/hooks/useWebSocket.test.tsx b/jarvis/ui/web/frontend/src/hooks/useWebSocket.test.tsxindex 9911385e78..4c095671d3 100644--- a/jarvis/ui/web/frontend/src/hooks/useWebSocket.test.tsx+++ b/jarvis/ui/web/frontend/src/hooks/useWebSocket.test.tsx@@ -119,6 +119,45 @@ describe("useWebSocket VoiceBootStatus handling", () => {expect(useEventStore.getState().voiceReady).toBe(false);});+ it("clears the live transcript at voice-session boundaries", async () => {+ // Live incidents 2026-07-15/16: the sidebar transcript box has no other+ // reset path, so the last utterance survived into READY/IDLE and the next+ // session, masquerading as a frozen live transcript ("Was").+ render(<Harness />);+ await Promise.resolve();++ MockWebSocket.last!.deliver(+ envelope("TranscriptionUpdate", { text: "Was", is_final: true }),+ );+ expect(useEventStore.getState().transcription).toBe("Was");++ // Session ends → the stale utterance must not survive into IDLE.+ MockWebSocket.last!.deliver(+ envelope("SystemStateChanged", { new_state: "IDLE", previous: "LISTENING" }),+ );+ expect(useEventStore.getState().transcription).toBe("");++ // Mid-session transitions must NOT clear the live transcript.+ MockWebSocket.last!.deliver(+ envelope("SystemStateChanged", { new_state: "LISTENING", previous: "IDLE" }),+ );+ MockWebSocket.last!.deliver(+ envelope("TranscriptionUpdate", {+ text: "Was ist morgen für ein Tag?", // i18n-allow: live-incident transcript under test+ is_final: true,+ }),+ );+ MockWebSocket.last!.deliver(+ envelope("SystemStateChanged", {+ new_state: "THINKING",+ previous: "LISTENING",+ }),+ );+ expect(useEventStore.getState().transcription).toBe(+ "Was ist morgen für ein Tag?", // i18n-allow: live-incident transcript under test+ );+ });+it("surfaces a mission tool approval request globally without arguments", async () => {render(<Harness />);await Promise.resolve();diff --git a/jarvis/ui/web/frontend/src/hooks/useWebSocket.ts b/jarvis/ui/web/frontend/src/hooks/useWebSocket.tsindex f5c9aafab2..c1b5a13a85 100644--- a/jarvis/ui/web/frontend/src/hooks/useWebSocket.ts+++ b/jarvis/ui/web/frontend/src/hooks/useWebSocket.ts@@ -122,10 +122,22 @@ export function useWebSocket(): void {}if (env.event_name === "SystemStateChanged") {- const state = (env.payload as { new_state?: unknown }).new_state;+ const p = env.payload as { new_state?: unknown; previous?: unknown };+ const state = p.new_state;if (typeof state === "string") {const lower = state.toLowerCase();if (isVoiceState(lower)) setVoice(lower);+ // The live-transcript box has no other reset path: without this,+ // the last utterance of a session survives into READY/IDLE and the+ // next session, masquerading as a frozen live transcript (live+ // incidents 2026-07-15/16: a stale "Was" sat in the sidebar long+ // after its session ended). Clear at every session boundary —+ // entering IDLE (session over) and leaving IDLE (fresh session).+ const previous =+ typeof p.previous === "string" ? p.previous.toLowerCase() : "";+ if (lower === "idle" || previous === "idle") {+ setTranscription("", true);+ }}}diff --git a/tests/unit/realtime/test_gemini_live.py b/tests/unit/realtime/test_gemini_live.pyindex 5e8b2055d2..490d1ccebc 100644--- a/tests/unit/realtime/test_gemini_live.py+++ b/tests/unit/realtime/test_gemini_live.py@@ -73,6 +73,100 @@ async def test_receive_maps_audio_transcripts_interrupt_and_completion():assert receive_calls == 2+async def test_go_away_is_recoverable_and_keeps_the_stream_flowing() -> None:+ """GoAway is Gemini's courteous pre-disconnect notice, not a wire error.+ Surfacing it as terminal used to end the session with reason=error while+ the current reply was still being spoken (live incident 2026-07-15 17:40),+ dropping the buffered audio tail."""+ messages = [+ _fake_message(go_away=SimpleNamespace(time_left=3_000)),+ _fake_message(+ server_content=SimpleNamespace(+ output_transcription=SimpleNamespace(text="still speaking"),+ input_transcription=None,+ interrupted=False,+ turn_complete=True,+ )+ ),+ ]++ receive_calls = 0++ async def fake_receive():+ nonlocal receive_calls+ receive_calls += 1+ if receive_calls == 1:+ for message in messages:+ yield message++ fake_session = SimpleNamespace(receive=fake_receive)+ session = _GeminiLiveSession(+ session=fake_session,+ connection_cm=SimpleNamespace(),+ client=SimpleNamespace(),+ session_id="s-go-away",+ )++ events = [event async for event in session.receive()]++ errors = [event for event in events if event.type == "error"]+ assert len(errors) == 1+ assert errors[0].recoverable is True+ assert "reconnect" in (errors[0].error or "")+ # The notice must not terminate the stream: the reply that follows it is+ # still delivered.+ assert [event.type for event in events][-2:] == [+ "output_transcript_delta",+ "turn_complete",+ ]+++async def test_abnormal_turn_complete_reason_is_logged(caplog) -> None:+ """Every named TurnCompleteReason except UNSPECIFIED is an abnormal stop+ (safety filter, rejection, regeneration limit). Discarding it made a+ server-truncated spoken reply indistinguishable from a complete one."""+ messages = [+ _fake_message(+ server_content=SimpleNamespace(+ output_transcription=SimpleNamespace(text="partial answer"),+ input_transcription=None,+ interrupted=False,+ turn_complete=True,+ turn_complete_reason=SimpleNamespace(+ name="MAX_REGENERATION_REACHED"+ ),+ )+ ),+ ]++ receive_calls = 0++ async def fake_receive():+ nonlocal receive_calls+ receive_calls += 1+ if receive_calls == 1:+ for message in messages:+ yield message++ fake_session = SimpleNamespace(receive=fake_receive)+ session = _GeminiLiveSession(+ session=fake_session,+ connection_cm=SimpleNamespace(),+ client=SimpleNamespace(),+ session_id="s-reason",+ )++ with caplog.at_level("WARNING"):+ events = [event async for event in session.receive()]++ assert [event.type for event in events][-1] == "turn_complete"+ assert any(+ "MAX_REGENERATION_REACHED" in record.message for record in caplog.records+ )++@pytest.mark.asyncioasync def test_receive_reenters_sdk_iterator_for_a_second_user_turn() -> None:sdk_turns = [diff --git a/tests/unit/realtime/test_transcript_persistence.py b/tests/unit/realtime/test_transcript_persistence.pyindex d9134e1ad1..cc2104f057 100644--- a/tests/unit/realtime/test_transcript_persistence.py+++ b/tests/unit/realtime/test_transcript_persistence.py@@ -53,7 +53,12 @@ def _provider_events(provider_name: str) -> tuple[list[RealtimeEvent], str, listtype="input_transcript", text="the settings view", is_final=True),]- raw_parts = ["Please open", "the settings view"]+ # Providers flag transcript fragments final per CHUNK. Every published+ # TranscriptionUpdate must carry the accumulated whole-utterance+ # snapshot, never the raw chunk — downstream surfaces (orb bubble,+ # TranscriptionView, SessionRecorder) mirror the event 1:1 and would+ # otherwise freeze on a single fragment of the sentence.+ expected_snapshots = ["Please open", "Please open the settings view"]else:user_events = [RealtimeEvent(@@ -62,7 +67,7 @@ def _provider_events(provider_name: str) -> tuple[list[RealtimeEvent], str, listis_final=True,)]- raw_parts = ["Please open the settings view"]+ expected_snapshots = ["Please open the settings view"]return ([*user_events,@@ -81,7 +86,7 @@ def _provider_events(provider_name: str) -> tuple[list[RealtimeEvent], str, listRealtimeEvent(type="turn_complete"),],"Please open the settings view",- raw_parts,+ expected_snapshots,)@@ -188,7 +193,7 @@ async def test_every_realtime_surface_provider_and_tool_mode_persists_complete_tprovider_name: str,tool_mode: str,) -> None:- events, expected_user, raw_parts = _provider_events(provider_name)+ events, expected_user, expected_snapshots = _provider_events(provider_name)if tool_mode == "delegate":output_index = next(index@@ -235,7 +240,7 @@ async def test_every_realtime_surface_provider_and_tool_mode_persists_complete_tfor event in store.get_events("matrix-session")if event.kind == "TranscriptionUpdate"]- assert transcription_events == raw_parts+ assert transcription_events == expected_snapshotstool_names = [tool["name"] for tool in provider.opened_with.tools]if tool_mode == "delegate":@@ -523,6 +528,147 @@ async def test_barge_in_finalizes_previous_turn_before_next_user_transcript(store.close()+async def test_terminal_provider_error_still_plays_gate_held_audio_tail(+ tmp_path,+) -> None:+ """A terminal provider failure mid-reply must not swallow the tail audio+ that the scrub gate already holds under a cleared transcript. Live+ incident 2026-07-15 17:40 (gemini-live): the reply text was fully stored+ while the spoken audio stopped mid-answer when the transport died."""+ tail_pcm = b"\xaa\x00" * 8+ provider = FakeRealtimeProvider(+ "gemini-live",+ [+ RealtimeEvent(+ type="input_transcript", text="What day is tomorrow?", is_final=True+ ),+ RealtimeEvent(+ type="output_transcript_delta", text="Tomorrow is Thursday."+ ),+ # First delta consumes the transcript clearance credit...+ RealtimeEvent(+ type="audio_delta",+ audio=AudioChunk(+ pcm=b"\x01\x00" * 8, sample_rate=24_000, timestamp_ns=0+ ),+ ),+ # ...so this tail chunk stays buffered inside the scrub gate.+ RealtimeEvent(+ type="audio_delta",+ audio=AudioChunk(pcm=tail_pcm, sample_rate=24_000, timestamp_ns=0),+ ),+ RealtimeEvent(type="error", error="simulated transport death"),+ ],+ )+ store = SessionStore(tmp_path / "sessions.db")+ store.open()+ played: list[bytes] = []++ async def send_binary(data: bytes) -> None:+ played.append(bytes(data))++ async def send_json(_message: dict[str, Any]) -> None:+ return None++ try:+ bus = EventBus()+ SessionRecorder(store).attach(bus)+ session = RealtimeVoiceSession(+ session_id="tail-audio-session",+ send_binary=send_binary,+ send_json=send_json,+ providers=[provider],+ config=_config("gemini-live", "direct"),+ bus=bus,+ surface="browser",+ tool_bridge=FakeRealtimeToolBridge(),+ )+ await session.handle_control({"type": "audio_start", "sample_rate": 48_000})+ await session.wait_finished()+ assert session.failed is True+ await session.end(reason="error")++ assert any(tail_pcm in chunk for chunk in played), (+ "the transcript-cleared tail audio was dropped on the error path"+ )+ turns = store.get_turns("tail-audio-session")+ assert len(turns) == 1+ assert turns[0].jarvis_text == "Tomorrow is Thursday."+ finally:+ store.close()+++async def test_silent_stream_end_mid_turn_fails_the_session_and_plays_the_tail(+ tmp_path,+) -> None:+ """The Gemini SDK's receive() can end without an exception and without a+ turn boundary. Mid-turn that is a silent transport death: the session must+ reach the same fail-closed path as an explicit provider error — failed+ flag set, provider_error surfaced, transcript-cleared tail audio played —+ instead of hanging as active with the tail dropped."""+ tail_pcm = b"\xbb\x00" * 8+ provider = FakeRealtimeProvider(+ "gemini-live",+ [+ RealtimeEvent(+ type="input_transcript", text="What day is tomorrow?", is_final=True+ ),+ RealtimeEvent(+ type="output_transcript_delta", text="Tomorrow is Thursday."+ ),+ RealtimeEvent(+ type="audio_delta",+ audio=AudioChunk(+ pcm=b"\x01\x00" * 8, sample_rate=24_000, timestamp_ns=0+ ),+ ),+ RealtimeEvent(+ type="audio_delta",+ audio=AudioChunk(pcm=tail_pcm, sample_rate=24_000, timestamp_ns=0),+ ),+ # No error event, no turn_complete: the iterator just ends.+ ],+ )+ store = SessionStore(tmp_path / "sessions.db")+ store.open()+ played: list[bytes] = []+ statuses: list[dict[str, Any]] = []++ async def send_binary(data: bytes) -> None:+ played.append(bytes(data))++ async def send_json(message: dict[str, Any]) -> None:+ statuses.append(dict(message))++ try:+ bus = EventBus()+ SessionRecorder(store).attach(bus)+ session = RealtimeVoiceSession(+ session_id="silent-stream-end",+ send_binary=send_binary,+ send_json=send_json,+ providers=[provider],+ config=_config("gemini-live", "direct"),+ bus=bus,+ surface="browser",+ tool_bridge=FakeRealtimeToolBridge(),+ )+ await session.handle_control({"type": "audio_start", "sample_rate": 48_000})+ await session.wait_finished()++ assert session.failed is True+ assert any(m.get("type") == "provider_error" for m in statuses)+ assert any(tail_pcm in chunk for chunk in played), (+ "the transcript-cleared tail audio was dropped on the silent "+ "stream-end path"+ )+ await session.end(reason="error")+ finally:+ store.close()++@pytest.mark.asyncioasync def test_handshake_fallback_turn_records_effective_provider(tmp_path) -> None:failed = FakeRealtimeProvider(diff --git a/tests/unit/ui/test_orb_listening_transcript.py b/tests/unit/ui/test_orb_listening_transcript.pyindex d0654792ba..f5a18a650a 100644--- a/tests/unit/ui/test_orb_listening_transcript.py+++ b/tests/unit/ui/test_orb_listening_transcript.py@@ -82,6 +82,53 @@ async def test_transcription_update_refreshes_large_bubble_only_while_listening(assert ("show_listening_transcript", "Soll nicht sichtbar sein") not in orb.calls # i18n-allow+async def test_final_transcript_during_thinking_still_repaints_the_user_bubble() -> None:+ """Realtime providers deliver (chunks of) the FINAL user transcript+ concurrently with the flip to THINKING. Dropping those froze the bubble on+ the first fragment ("Was" instead of the whole question — live incidents+ 2026-07-15/16). While no reply text exists yet, the authoritative final+ user text is never stale and must repaint."""+ orb = _FakeOrb()+ bridge = OrbBusBridge(bus=_FakeBus(), orb=orb, idle_animations_enabled=False) # type: ignore[arg-type]++ await bridge._on_state( # noqa: SLF001+ SystemStateChanged(new_state="LISTENING", previous="IDLE")+ )+ await bridge._on_transcription_update( # noqa: SLF001+ TranscriptionUpdate(text="Was", is_final=True)+ )+ await bridge._on_state( # noqa: SLF001+ SystemStateChanged(new_state="THINKING", previous="LISTENING")+ )+ orb.calls.clear()++ await bridge._on_transcription_update( # noqa: SLF001+ TranscriptionUpdate(+ text="Was ist morgen für ein Tag?", # i18n-allow: live-incident transcript under test+ is_final=True,+ )+ )++ assert (+ "show_listening_transcript",+ "Was ist morgen für ein Tag?", # i18n-allow: live-incident transcript under test+ ) in orb.calls++ # A PARTIAL during THINKING keeps being ignored (stale user-side noise) …+ orb.calls.clear()+ await bridge._on_transcription_update( # noqa: SLF001+ TranscriptionUpdate(text="stale partial", is_final=False)+ )+ assert orb.calls == []++ # … and once the reply text exists, even a FINAL must not repaint.+ bridge._last_response_text = "Tomorrow is Thursday." # noqa: SLF001+ await bridge._on_transcription_update( # noqa: SLF001+ TranscriptionUpdate(text="late final", is_final=True)+ )+ assert orb.calls == []++def test_transcript_bubble_height_grows_by_visible_line_count() -> None:line_height = 20diff --git a/ui/orb/bus_bridge.py b/ui/orb/bus_bridge.pyindex 7705d6965a..bc4a54b3fc 100644--- a/ui/orb/bus_bridge.py+++ b/ui/orb/bus_bridge.py@@ -796,9 +796,20 @@ class OrbBusBridge:# (LISTENING, USER_SPEAKING, WAITING_FOR_FINAL_TRANSCRIPT,# WAITING_FOR_COMPLETION). Outside this window (THINKING/SPEAKING/# IDLE) the bubble must NOT be repainted with stale user text —- # the brain has already taken over.+ # the brain has already taken over. ONE exception: the FINAL+ # transcript of the turn being answered right now. Realtime providers+ # deliver (chunks of) the final user transcript concurrently with the+ # flip to THINKING; dropping those froze the bubble on the first+ # fragment ("Was" instead of the whole question). While no reply text+ # exists yet, the authoritative user text is never stale.if self._last_state not in _USER_SIDE_BUBBLE_STATES:- return+ late_final_ok = (+ bool(getattr(event, "is_final", False))+ and self._last_state == "THINKING"+ and not self._last_response_text+ )+ if not late_final_ok:+ returnif _is_transcript_boilerplate(event.text):log.info("OrbBridge suppressed STT boilerplate transcript: %r",