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
feat(voice): every instant ack speaks to the request, and short work gets a 3 s grace
Harald7234e4f22e4e
diff --git a/docs/adr/0033-instant-acknowledgment.md b/docs/adr/0033-instant-acknowledgment.mdindex 54b6150c2f..bf1d7f8e44 100644--- a/docs/adr/0033-instant-acknowledgment.md+++ b/docs/adr/0033-instant-acknowledgment.md@@ -32,8 +32,8 @@ One shared core, `jarvis/voice/instant_ack.py`, used by both voice engines.1. **Trigger = the committed plan, at dispatch.** `plan_instant_ack(plan_turn(text))`maps the deterministic planner reasons to a work class with an expectedduration: RESEARCH / SCREEN / MISSION and connected personal lookups speak- **immediately**; ACTION and local personal lookups wait a **1.2 s grace**- and speak only if the turn is still processing. Plain conversation, voice+ **immediately**; ACTION and local personal lookups wait a **3 s grace**+ (1.2 s until 2026-08-18) and speak only if the turn is still processing. Plain conversation, voicecontrol and vague orchestrator turns get nothing.2. **State only what Jarvis is doing.** Closed de/en/es pools per class(no-repeat memory, `{agent}` = wake-word brand). The ACTION pool is empty@@ -72,19 +72,31 @@ One shared core, `jarvis/voice/instant_ack.py`, used by both voice engines.(`MessageSent(role="preamble")`, the bubble the chat view alreadyrenders), armed before the brain call and cancelled the moment the replyis in. Never spoken.-8. **Opt-in topic lines for pooled classes.** `[ack_brain].instant_ack_compose_all- = true` lets the composer / live model produce a request-specific line for+8. **Topic lines for pooled classes.** `[ack_brain].instant_ack_compose_all`+ lets the composer / live model produce a request-specific line forresearch / personal / screen / mission too, under the same validator, with- the pool line as fallback. Off by default.+ the pool line as fallback. **On by default since 2026-08-18** (maintainer:+ an ack must always speak to the request, never a stock class line);+ `false` restores pool-only lines. Verbatim-speech realtime transports keep+ the pool line for these classes (they cannot compose).## Consequences- Realtime: first audio for a research question moves from ~7 s (generic) to~1.5–2 s (class line, same voice); actions get "I'm opening Spotify."- after 1.2 s if still running. `_DELEGATE_BRIDGE_DELAY_S` (6 s) is now only+ after 3 s if still running. `_DELEGATE_BRIDGE_DELAY_S` (6 s) is now onlythe cap / the delay for unclassified turns.-- Pipeline: heavy turns speak at 0 / 1.2 s instead of after round one; the+- Pipeline: heavy turns speak at 0 / 3 s instead of after round one; thegrounded router ack becomes the 8 s+ progress line.+- 2026-08-18 amendment (first maintainer feedback, before a live session):+ short-work grace 1.2 → 3 s — a line 1.2 s in front of an answer that lands+ at second 3 is the double-tap the ADR forbids, while 3 s is still far+ inside the "waiting feels rude" window; `instant_ack_compose_all` on by+ default — pooled class lines survive only as the instant fallback. Same+ day, pipeline: the progress line is timed from the turn's OWN ack (grace ++ composer put it well after arm) and the "another interim line just spoke"+ gate no longer counts that ack — before, the gate saw it and no progress+ line ever followed.- Two chargeable flash calls per action turn at most (ack + spawn/interim),both bounded (700 ms ack budget) and breaker-guarded.- Amends ADR-0014 gate 1 (suppress-if-fast) — superseded by the class gracediff --git a/jarvis/brain/ack_brain/config.py b/jarvis/brain/ack_brain/config.pyindex 8ccfe5a446..f52e4da8c0 100644--- a/jarvis/brain/ack_brain/config.py+++ b/jarvis/brain/ack_brain/config.py@@ -140,17 +140,19 @@ class AckBrainConfig(BaseModel):# Instant acknowledgment (2026-08-17, jarvis/voice/instant_ack.py): the# turn's FIRST sign of life for heavy work, decided from the deterministic# turn plan at dispatch (research / screen / mission speak at once; an- # action or personal lookup after a 1.2 s grace, only if still running).+ # action or personal lookup after a 3 s grace, only if still running).# Independent of `enabled` (the closed pools need no LLM); the ACTION# class alone uses the flash composer and stays silent without one.# False = back to the pre-2026-08-17 silence until the router acks.instant_ack: bool = Field(default=True)- # Opt-in: request-specific lines for the POOLED instant-ack classes too- # ("I'm pulling the flight data for Friday." instead of "I'm looking that- # up online."). Same flash composer / live model, same structural- # validator, the pool line stays the instant fallback. Off by default:- # the pool lines already fit their class at 0 ms and zero cost.- instant_ack_compose_all: bool = Field(default=False)+ # Request-specific lines for the POOLED instant-ack classes too ("I'm+ # pulling the flight data for Friday." instead of "I'm looking that up+ # online."). Same flash composer / live model, same structural validator,+ # the pool line stays the instant fallback (no composer, over budget, or+ # rejected output). On by default since 2026-08-18: the maintainer's rule+ # is that every ack references the request, never a stock class line+ # (ADR-0033 §8). False = pool lines only, 0 ms and zero cost.+ instant_ack_compose_all: bool = Field(default=True)# 2026-07-06 interim-ack redesign (spec: docs/superpowers/specs/# 2026-07-06-interim-ack-redesign-design.md). Forensic finding: one voice# session spoke the identical grounded ack once per utterance, threediff --git a/jarvis/realtime/session.py b/jarvis/realtime/session.pyindex c4613bfdf9..0a26271657 100644--- a/jarvis/realtime/session.py+++ b/jarvis/realtime/session.py@@ -79,6 +79,7 @@ from jarvis.speech.interrupt_intent import ()from jarvis.voice.instant_ack import (PROGRESS_AFTER_S,+ SHORT_GRACE_S,InstantAckPlan,ToolActivity,WorkClass,@@ -519,7 +520,10 @@ class _LoopLagProbe:# so its cap is tighter still. Ready results pre-empt the bridge lifecycle._DELEGATE_BRIDGE_DELAY_S = 6.0_CAPABILITY_LIMITED_DELEGATE_BRIDGE_DELAY_S = 1.0-_INSTANT_ACK_GRACE_S = 1.2+# One source of truth for the short-work grace: the shared core's constant+# (3 s since 2026-08-18, ADR-0033). Kept as a module attribute so tests can+# pin it low.+_INSTANT_ACK_GRACE_S = SHORT_GRACE_S# 20 messages, not 8: a failed screen action typically costs the user several# correction turns, and each background completion adds a context note. With 8,# the original task was trimmed out exactly when the recovery turn needed itdiff --git a/jarvis/speech/pipeline.py b/jarvis/speech/pipeline.pyindex 48588ff57f..f516a1948c 100644--- a/jarvis/speech/pipeline.py+++ b/jarvis/speech/pipeline.py@@ -4724,7 +4724,7 @@ class SpeechPipeline:if is_instant_ack:# Not counted against the cap either: one instant line must# never eat the budget of a later owed progress line.- self._note_instant_ack_spoken(spoken_text)+ self._note_instant_ack_spoken(spoken_text, now_monotonic)else:spoken_times.append(now_monotonic)if await self._deliver_announcement_via_realtime(@@ -5063,10 +5063,30 @@ class SpeechPipeline:have covered it). At most one per turn."""try:+ armed_at = time.monotonic()await asyncio.sleep(PROGRESS_AFTER_S)+ # The line is owed PROGRESS_AFTER_S after the turn's OWN instant+ # ack — which speaks well after arm for short work (grace window+ # + composer budget) — not after arm, and asyncio may wake a hair+ # early: wait out the remainder instead of dropping the line+ # (before 2026-08-18 the "spoke recently" gate below saw the+ # turn's own ack and silenced every progress line).+ ack_task = getattr(self, "_instant_ack_task", None)+ if ack_task is not None and not ack_task.done():+ # Short work's ack is still inside its grace / composer+ # budget: the progress line follows it, never races it.+ await asyncio.wait({ack_task})+ while self._instant_ack_still_wanted(seq):+ own_at = getattr(self, "_instant_ack_spoken_at", None)+ if own_at is None or own_at < armed_at:+ break # no ack of THIS turn spoke (a stale stamp is an older turn's)+ remaining = PROGRESS_AFTER_S - (time.monotonic() - own_at)+ if remaining <= 0.0:+ break+ await asyncio.sleep(remaining)if not self._instant_ack_still_wanted(seq):return- if self._interim_line_spoke_recently(PROGRESS_AFTER_S):+ if self._other_interim_line_spoke_recently(PROGRESS_AFTER_S):returnactivity = classify_tool_activity(getattr(self, "_turn_tool_activity", ""))if activity is ToolActivity.HANDOVER:@@ -5098,6 +5118,16 @@ class SpeechPipeline:last = getattr(self, "_last_preamble_spoken", None)return bool(last is not None and (time.monotonic() - last[1]) < within_s)+ def _other_interim_line_spoke_recently(self, within_s: float) -> bool:+ """An interim line OTHER than this turn's own instant ack just spoke+ (grounded router ack, heartbeat) — the wait is covered."""+ last = getattr(self, "_last_preamble_spoken", None)+ if last is None:+ return False+ if last[1] == getattr(self, "_instant_ack_spoken_at", None):+ return False+ return (time.monotonic() - last[1]) < within_s+def _instant_ack_still_wanted(self, seq: int) -> bool:"""The line is only coherent while THIS turn is still thinking."""if int(getattr(self, "_instant_ack_turn_seq", 0)) != seq:@@ -5106,9 +5136,13 @@ class SpeechPipeline:return Falsereturn not bool(getattr(self, "_brain_first_frame_played", False))- def _note_instant_ack_spoken(self, text: str) -> None:- """Record the moment an instant ack actually went to the speaker."""- self._instant_ack_spoken_at = time.monotonic()+ def _note_instant_ack_spoken(self, text: str, at: float | None = None) -> None:+ """Record the moment an instant ack actually went to the speaker.++ ``at`` is the same monotonic stamp stored in ``_last_preamble_spoken``+ so the progress line can tell the turn's own ack from other emitters.+ """+ self._instant_ack_spoken_at = time.monotonic() if at is None else atself._instant_ack_spoken_text = textnote_spoken(text)diff --git a/jarvis/voice/instant_ack.py b/jarvis/voice/instant_ack.pyindex 2110844c2e..5f28fa612e 100644--- a/jarvis/voice/instant_ack.py+++ b/jarvis/voice/instant_ack.py@@ -56,10 +56,12 @@ _SUPPORTED_LANGUAGES = ("de", "en", "es")_DEFAULT_LANGUAGE = "en"#: Grace window for SHORT work: speak only if the turn is still running-#: afterwards. 1.2 s covers the local fast paths (local-action gate, wiki-#: ingest, navigation) and a single-round Tool Model answer on a warm-#: provider; anything slower deserves the line.-SHORT_GRACE_S = 1.2+#: afterwards. 3 s covers the local fast paths (local-action gate, wiki+#: ingest, navigation) AND a single-round Tool Model answer on a warm+#: provider — a turn that answers inside it stays chatter-free; anything+#: slower deserves the line, spoken well before the wait turns annoying+#: (maintainer 2026-08-18: 1.2 s acked turns whose answer was seconds away).+SHORT_GRACE_S = 3.0#: LONG work (web research, screen control, missions) never finishes inside#: the ack itself — speak immediately.IMMEDIATE_DELAY_S = 0.0@@ -1294,8 +1296,9 @@ def contextual_ack_prompt(*, language_name: str, utterance: str) -> str:f"has no result yet. Say ONE short sentence in {language_name}, at most ""ten words, that tells the user what you are doing for exactly this ""request — name its concrete subject with the user's own words (the "- "app, the person, the file, the setting, the terminal), for example the "- "shape 'I'm opening <thing>.' or 'I'm sending that to <thing>.'. "+ "app, the person, the file, the setting, the terminal, the topic), for "+ "example the shape 'I'm opening <thing>.', 'I'm sending that to "+ "<thing>.', 'I'm looking up <thing>.' or 'I'm checking your <thing>.'. ""Present tense only. No result, no success, no promise about the ""outcome, no question, no new facts, no numbers, no words the user did ""not use except 'I'm', 'now', 'for you'. Then stop. "diff --git a/tests/unit/speech/test_instant_ack_pipeline.py b/tests/unit/speech/test_instant_ack_pipeline.pyindex e063f9182a..23a53ae0f8 100644--- a/tests/unit/speech/test_instant_ack_pipeline.py+++ b/tests/unit/speech/test_instant_ack_pipeline.py@@ -444,3 +444,50 @@ async def test_progress_line_yields_to_a_router_ack_that_just_spoke(monkeypatch)pipeline._last_preamble_spoken = ("Checking the weather for you.", time.monotonic())await _settle(0.35)assert len(_instant_acks(seen)) == 1, "the progress line spoke over a fresh interim line"+++async def test_progress_line_is_owed_after_the_turns_own_delayed_ack(monkeypatch) -> None:+ """Short work speaks its ack only after the grace; the ONE progress line+ is owed PROGRESS_AFTER_S after THAT ack — the turn's own line must never+ count as "another interim line just spoke" and silence it (the 2026-08-18+ regression: no progress line ever followed a grace-delayed ack)."""+ from jarvis.speech import pipeline as pipeline_module++ monkeypatch.setattr(instant_ack_module, "SHORT_GRACE_S", 0.2)+ monkeypatch.setattr(pipeline_module, "PROGRESS_AFTER_S", 0.2)+ bus = EventBus()+ seen: list[AnnouncementRequested] = []+ bus.subscribe(AnnouncementRequested, lambda e: seen.append(e))+ tts = FakeTTS()+ player = FakePlayer()+ pipeline = _make_pipeline(tts, bus, player)++ async def _wait_for(count: int, timeout_s: float = 3.0) -> list[str]:+ deadline = time.monotonic() + timeout_s+ while time.monotonic() < deadline:+ texts = [a.text for a in _instant_acks(seen)]+ if len(texts) >= count:+ return texts+ await asyncio.sleep(0.02)+ return [a.text for a in _instant_acks(seen)]++ pipeline._arm_instant_ack("What's in my notes about Albel?", "en")+ texts = await _wait_for(1)+ assert len(texts) == 1, texts+ assert texts[0] in instant_ack_module.instant_ack_pool(+ instant_ack_module.WorkClass.PERSONAL, "en"+ )+ for _ in range(100): # the stamp lands before the line plays+ if getattr(pipeline, "_instant_ack_spoken_at", None) is not None:+ break+ await asyncio.sleep(0.01)+ ack_spoken_at = pipeline._instant_ack_spoken_at # type: ignore[attr-defined]+ assert ack_spoken_at is not None+ # The arm-relative deadline has long passed; the progress line still+ # comes — PROGRESS_AFTER_S after the ack — never silenced by it.+ texts = await _wait_for(2)+ assert len(texts) == 2, texts+ assert time.monotonic() - ack_spoken_at >= 0.19, "the progress line raced the ack"+ assert texts[1] in instant_ack_module.progress_pool(instant_ack_module.ToolActivity.OTHER, "en")+ assert player.plays == 2