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.

feat(sessions): include the effective voice mode in session exports

Ruben Lütkef26aef50da3b
diff --git a/jarvis/sessions/formatter.py b/jarvis/sessions/formatter.py
index 5dcb9c3010..6d0487afe3 100644
--- a/jarvis/sessions/formatter.py
+++ b/jarvis/sessions/formatter.py
@@ -158,6 +158,7 @@ def format_session_markdown(
lines.append(f"# Voice-Session — {started}")
lines.append("")
lines.append(f"- **Dauer:** {duration}")
+ lines.append(f"- **Modus:** {_pretty_voice_mode(session.voice_mode)}")
lines.append(f"- **Turns:** {session.turn_count}")
lines.append(f"- **Sprache:** {session.language}")
if session.wake_keyword:
@@ -282,7 +283,10 @@ def format_session_plain(
lines: list[str] = []
# --- Schlanke Kopfzeile: "Voice-Session · 07.06.2026, 19:24 · 1 min 42 s"
- header_bits = [_fmt_dt_human(session.started_ms)]
+ header_bits = [
+ _fmt_dt_human(session.started_ms),
+ f"Modus: {_pretty_voice_mode(session.voice_mode)}",
+ ]
duration = _fmt_duration(session.started_ms, session.ended_ms)
if duration:
header_bits.append(duration)
@@ -365,4 +369,8 @@ def _pretty_hangup(reason: str) -> str:
return _HANGUP_LABELS.get(reason, reason or "unbekannt")
+def _pretty_voice_mode(mode: str) -> str:
+ return (mode or "unknown").replace("_", " ").title()
+
+
__all__ = ["format_session_markdown", "format_session_plain"]
diff --git a/tests/unit/sessions/test_formatter.py b/tests/unit/sessions/test_formatter.py
index b1f8a0d5d3..97561c24fd 100644
--- a/tests/unit/sessions/test_formatter.py
+++ b/tests/unit/sessions/test_formatter.py
@@ -66,6 +66,7 @@ def _session(**over: object) -> VoiceSessionRow:
providers_used=["gemini"],
language="de",
wake_keyword="hey_jarvis",
+ voice_mode="realtime",
)
base.update(over)
return VoiceSessionRow(**base) # type: ignore[arg-type]
@@ -142,6 +143,16 @@ def test_plain_has_no_developer_tags() -> None:
assert tag not in out
+def test_markdown_and_plain_include_the_effective_voice_mode() -> None:
+ session = _session(voice_mode="pipeline")
+
+ markdown = format_session_markdown(session, _example_turns())
+ plain = format_session_plain(session, _example_turns())
+
+ assert "- **Modus:** Pipeline" in markdown
+ assert "Modus: Pipeline" in plain.splitlines()[0]
+
+
def test_markdown_labels_awaiting_confirmation_reply() -> None:
# A turn that ended on a two-turn confirmation tags its reply as a pending
# yes/no question — consistent with the english spoken_kind tags (preamble,
diff --git a/tests/unit/ui/web/test_sessions_routes.py b/tests/unit/ui/web/test_sessions_routes.py
index d3573b1f43..376fa1e603 100644
--- a/tests/unit/ui/web/test_sessions_routes.py
+++ b/tests/unit/ui/web/test_sessions_routes.py
@@ -13,6 +13,7 @@ def _seed_session(store: SessionStore) -> None:
started_ms=1_000,
wake_keyword="hey_jarvis",
language="de",
+ voice_mode="pipeline",
)
store.upsert_turn(turn_id="t1", session_id="s1", idx=0, started_ms=1_000)
store.finalize_turn(
@@ -73,6 +74,7 @@ def test_save_session_to_downloads_uses_events_for_plain_export(tmp_path, monkey
assert res.status_code == 200
saved = tmp_path / "Downloads" / res.json()["filename"]
content = saved.read_text(encoding="utf-8")
+ assert "Modus: Pipeline" in content.splitlines()[0]
assert "Jarvis: Preamble first." in content
assert content.index("Jarvis: Preamble first.") < content.index(
"Jarvis: Final answer."
@@ -81,6 +83,30 @@ def test_save_session_to_downloads_uses_events_for_plain_export(tmp_path, monkey
store.close()
+def test_copy_exports_include_the_effective_voice_mode(tmp_path) -> None:
+ store = SessionStore(tmp_path / "sessions.db")
+ store.open()
+ try:
+ _seed_session(store)
+ app = FastAPI()
+ app.include_router(sessions_routes.router)
+ app.state.session_store = store
+
+ with TestClient(app) as client:
+ markdown = client.get("/api/sessions/s1/export?format=markdown")
+ plain = client.get("/api/sessions/s1/export?format=plain")
+ json_export = client.get("/api/sessions/s1/export?format=json")
+
+ assert markdown.status_code == 200
+ assert "- **Modus:** Pipeline" in markdown.text
+ assert plain.status_code == 200
+ assert "Modus: Pipeline" in plain.text.splitlines()[0]
+ assert json_export.status_code == 200
+ assert json_export.json()["session"]["voice_mode"] == "pipeline"
+ finally:
+ store.close()
+
+
def test_latest_turn_returns_newest_persisted_user_transcript(tmp_path) -> None:
store = SessionStore(tmp_path / "sessions.db")
store.open()