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.

fix(agentic-ide): stop claiming a pane was briefed before it was

Ruben Lütkee3efd02d7b1b
diff --git a/jarvis/brain/manager.py b/jarvis/brain/manager.py
index 2d9206e2ed..4c0febf532 100644
--- a/jarvis/brain/manager.py
+++ b/jarvis/brain/manager.py
@@ -5818,17 +5818,20 @@ class BrainManager:
names = [item.terminal for item in addressed]
- # Say something NOW. Everything below this line — planning a split,
- # writing each prompt — is deliberately slow (a quality-tier call per
- # pane, 10-21 s measured), and it used to run in complete silence: the
- # maintainer's 2026-07-27 report is that "prompt Finn" felt like a hung
- # assistant, because the first sound of any kind was the delivery
- # readback a quarter of a minute later. The confirmation is composed for
- # THIS request rather than drawn from a pool, so it names the topic back
- # and doubles as a readback of what was understood.
- await self._announce_ide_handoff(
- names, user_text=user_text, language=out_lang
- )
+ # NOTHING is spoken between here and the delivery verdict below, and that
+ # silence is the feature. A bridge line lived here for a few hours on
+ # 2026-07-27 to fill the prompt writer's 10-21 s, and it produced the
+ # worst possible failure the same day: announcements are not read out
+ # verbatim on a live call — ``deliver_announcement`` hands the text to
+ # the realtime model to RE-RENDER in its own words — and the model
+ # rendered the in-progress line as a finished action ("I have forwarded
+ # the bug to Alex") while nothing had reached the pane yet. On a turn
+ # whose delivery then failed, that sentence was the only thing the
+ # maintainer ever heard. Careful wording cannot fix this: any statement
+ # made before the work is done is a claim a downstream model is free to
+ # re-tense. So the only sentence this path emits is the per-pane verdict
+ # at the end, derived from what was actually typed into which terminal.
+ # Slow and true beats fast and wrong.
# Two agents told to "split the work between you" must get DIFFERENT
# briefs — the same sentence twice is two agents racing on one file.
@@ -5880,87 +5883,6 @@ class BrainManager:
return None
return _fanout_reply_line(result, out_lang)
- #: Hard ceiling for composing the hand-off line. It is spoken BEFORE the
- #: work starts, so every millisecond here is added to the user's wait —
- #: while the wait it bridges is 10-21 s. Same budget as the Computer-Use
- #: dispatch ack, which sits in exactly the same place in its own path.
- _IDE_HANDOFF_BUDGET_MS = 900
-
- async def _announce_ide_handoff(
- self,
- names: list[str],
- *,
- user_text: str,
- language: str,
- ) -> None:
- """Speak one short, topic-fitting line before the panes are briefed.
-
- Published on the announcement bus rather than returned, because this
- turn's REPLY is the delivery readback that comes ten to twenty seconds
- later ("Sent to Finn"): the two are different statements at different
- times, and a turn can only return one string. ``kind="preamble"`` is what
- makes the pipeline treat it as the bridge line it is — stale the moment
- Jarvis starts speaking the actual answer, and dropped rather than queued
- behind it.
-
- Why composed and not canned: a fixed sentence is the thing the
- maintainer explicitly did not want (2026-07-27) — hearing the same
- "one moment" on every request tells you nothing about whether the right
- thing was understood, whereas a line that names the topic back is a
- readback and a reassurance in one. ``facts`` carries the user's own
- words and the call-signs, and nothing else: the prompt has not been
- written yet at this point, so there is no other truth to state, and
- ``in_progress=True`` rejects any candidate that claims it is done.
-
- Never raises and never delays the hand-off by more than
- ``_IDE_HANDOFF_BUDGET_MS``: with no bus, no composer, or no reachable
- provider the deterministic phrase goes out instead (§3 — a downloader
- with no key hears the fallback, not silence).
- """
- if self._bus is None or not names:
- return
- listed = _join_names(names, language)
- if len(names) == 1:
- canned = action_phrase("ide_prompt_handoff", language, terminal=listed)
- else:
- canned = action_phrase("ide_prompt_handoff_many", language, names=listed)
- try:
- text = await render_readback(
- getattr(self, "_readback_composer", None),
- instruction=(
- "You have just understood the user's request and are handing "
- "it to the coding agents named below, which takes a moment. "
- "In one short sentence, tell the user you are passing THIS "
- "request on right now — refer to what it is actually about, "
- "in their own words. It has not been done yet."
- ),
- language=language,
- canned=lambda: canned,
- facts={
- "user_request": user_text[:200],
- "coding_agents": listed,
- },
- in_progress=True,
- latency_budget_ms=self._IDE_HANDOFF_BUDGET_MS,
- )
- if not text.strip():
- return
- await self._bus.publish(
- AnnouncementRequested(
- text=text,
- priority="normal",
- language=language,
- kind="preamble",
- source_layer="brain.agentic_ide.handoff",
- )
- )
- except Exception: # noqa: BLE001 - a bridge line never costs a delivery
- log.debug("Agentic IDE hand-off announcement failed", exc_info=True)
- return
- # Counted as this turn's spoken ack so the router's grounded ack does not
- # stack a second interim line on top of it moments later.
- self._last_grounded_ack_monotonic = time.monotonic()
-
async def _run_agentic_ide_spawn_fast_path(
self,
user_text: str,
diff --git a/jarvis/voice/action_phrases.py b/jarvis/voice/action_phrases.py
index 6ef4961c49..d55f92d60d 100644
--- a/jarvis/voice/action_phrases.py
+++ b/jarvis/voice/action_phrases.py
@@ -302,23 +302,11 @@ _PHRASES: dict[str, dict[str, str]] = {
"en": "I am not sure what to write to the wiki. Please say it again with the content.",
"es": "No tengo claro qué escribir en la wiki; dímelo otra vez con el contenido.",
},
- # Handing an order to a pane takes 10-21 s (the prompt is WRITTEN by a
- # quality-tier model before it is typed), and until 2026-07-27 that whole
- # window was silent — the maintainer read the pause as a hung assistant.
- # These are the INSTANT fallbacks for that bridge line; the spoken sentence
- # is normally composed for the actual topic (see
- # ``BrainManager._announce_ide_handoff``). Deliberately in-progress wording:
- # nothing has reached the agent yet when this is said.
- "ide_prompt_handoff": {
- "de": "Ich schreibe {terminal} gerade die Aufgabe.", # i18n-allow
- "en": "I'm writing up the task for {terminal} now.",
- "es": "Estoy redactando la tarea para {terminal}.",
- },
- "ide_prompt_handoff_many": {
- "de": "Ich schreibe {names} gerade die Aufgaben.", # i18n-allow
- "en": "I'm writing up the tasks for {names} now.",
- "es": "Estoy redactando las tareas para {names}.",
- },
+ # No "I am writing the task now" phrase belongs here. One existed for a few
+ # hours on 2026-07-27 to fill the prompt writer's 10-21 s, and the realtime
+ # provider re-voiced it as a finished action; the only sentence the pane
+ # hand-off may speak is the delivery verdict below, which reports what was
+ # actually typed where.
# Agentic-IDE terminal delivery (deterministic fast path). Naming the pane
# back is the whole confirmation the user gets that the right agent was
# addressed — a spoken "sent" without the call-sign would be useless in a
diff --git a/tests/unit/brain/test_agentic_ide_handoff_ack.py b/tests/unit/brain/test_agentic_ide_handoff_silence.py
similarity index 60%
rename from tests/unit/brain/test_agentic_ide_handoff_ack.py
rename to tests/unit/brain/test_agentic_ide_handoff_silence.py
index 986b041fc4..078c55151c 100644
--- a/tests/unit/brain/test_agentic_ide_handoff_ack.py
+++ b/tests/unit/brain/test_agentic_ide_handoff_silence.py
@@ -1,24 +1,25 @@
-"""The spoken bridge line between "prompt Finn" and Finn actually being briefed.
+"""Handing an order to a coding pane says nothing until it has actually landed.
Writing a pane's prompt is a deliberate quality-tier call — 10-21 s measured,
chosen over a fast rewrite because the coding agent then works from that prompt
-for minutes. Until 2026-07-27 that window was silent: the maintainer said
-"prompt Finn", heard nothing at all, and read the pause as a hung assistant.
-The delivery readback ("Sent to Finn") is correct but arrives a quarter of a
-minute too late to be feedback.
-
-So the hand-off now speaks first. What is pinned here is the part that makes it
-worth anything:
-
-* it is said BEFORE the slow work starts, not alongside it — a confirmation
- that races the thing it confirms is not a confirmation;
-* it is COMPOSED for the request, so it names the topic back instead of reading
- a stock line out of a table (the maintainer's explicit ask: a fixed phrase
- tells you nothing about whether the right thing was understood);
-* it degrades to the localized canned phrase with no provider, so a downloader
- with no key hears a sentence rather than the silence this fixes (§3);
-* control still comes back to the voice session afterwards with the real
- per-pane verdict — the bridge line never becomes the answer.
+for minutes. On 2026-07-27 a spoken bridge line was added to fill that window,
+and it failed the same day in the worst available way: the realtime provider
+re-voiced the interim sentence as a completed action ("I have forwarded the bug
+to Alex") while nothing had reached the pane yet, and on a turn whose delivery
+then did not happen at all, that false sentence was the only thing the
+maintainer ever heard.
+
+The lesson is not "word the interim line more carefully" — a downstream model is
+free to re-tense whatever it is handed, so any statement made before the work is
+done is a claim that can become a lie. What this file pins is therefore the
+absence of that statement:
+
+* the hand-off emits NO announcement of any kind before the prompt is written,
+ while it is written, or while it is being typed;
+* the one and only sentence it produces is the returned per-pane verdict,
+ derived from what actually reached which terminal;
+* a delivery that did not happen says so, instead of a success being implied by
+ an earlier line nobody corrected.
"""
from __future__ import annotations
@@ -130,29 +131,31 @@ def _names(registry: Registry) -> list[str]:
return [t.name for t in registry.session.terminals]
-class _FakeFlashProvider:
- """Stands in for the flash ack provider the readback composer calls.
+class _LoudProvider:
+ """A composer provider that would speak if anything ever asked it to.
- Echoes a topic-fitting sentence built from the facts it was handed, which is
- what a real provider does here — and lets the test prove the request
- actually reached the composer instead of only that *something* was spoken.
+ Its presence is the point: with a reachable provider wired, an interim line
+ would be composed and published. Silence with this in place proves nothing
+ is asking for one, rather than that a fallback path happened to be empty.
"""
def __init__(self) -> None:
- self.personas: list[str] = []
+ self.calls: list[str] = []
async def run(
self, content: str, language: str, *, persona_prompt: str = ""
) -> str:
- self.personas.append(persona_prompt)
- return "Passing the wake word timeout over now."
+ self.calls.append(persona_prompt)
+ return "I have passed that on already."
-async def test_the_handoff_line_is_spoken_before_the_prompt_is_written(
+async def test_nothing_is_spoken_while_the_prompt_is_still_being_written(
manager: BrainManager, registry: Registry, spy: _Spy, tmp_path: Path,
monkeypatch: pytest.MonkeyPatch,
) -> None:
- """The whole point: feedback lands ahead of the slow part, not with it."""
+ """The regression itself: no claim exists while the claim is not yet true."""
+ provider = _LoudProvider()
+ manager._readback_composer = ReadbackComposer(provider=provider)
await _open(registry, tmp_path, 1)
(only,) = _names(registry)
announced_when_composing: list[bool] = []
@@ -167,86 +170,56 @@ async def test_the_handoff_line_is_spoken_before_the_prompt_is_written(
f"Tell {only} to fix the wake word timeout"
)
- assert announced_when_composing == [True]
+ assert announced_when_composing == [False]
+ assert provider.calls == []
assert reply is not None
-async def test_the_line_is_composed_for_this_request_not_a_stock_phrase(
+async def test_the_only_statement_is_the_verdict_returned_after_delivery(
manager: BrainManager, registry: Registry, spy: _Spy, tmp_path: Path
) -> None:
- provider = _FakeFlashProvider()
- manager._readback_composer = ReadbackComposer(provider=provider)
+ """One turn, one sentence — and it is the one derived from what happened."""
+ manager._readback_composer = ReadbackComposer(provider=_LoudProvider())
await _open(registry, tmp_path, 1)
(only,) = _names(registry)
- await manager._run_agentic_ide_fast_path(
+ reply = await manager._run_agentic_ide_fast_path(
f"Tell {only} to fix the wake word timeout"
)
- assert spy.texts[0] == "Passing the wake word timeout over now."
- # The composer was handed the user's actual words and the call-sign — that
- # is what makes the sentence about THIS request rather than about nothing.
- persona = provider.personas[0]
- assert "wake word timeout" in persona
- assert only in persona
-
-
-async def test_the_handoff_line_is_a_preamble_on_its_own_source_layer(
- manager: BrainManager, registry: Registry, spy: _Spy, tmp_path: Path
-) -> None:
- """``brain.router.ack`` is dropped wholesale while the Flash-Brain is wired.
-
- Publishing under that layer would make the bridge line disappear on exactly
- the installs that have the most voice machinery turned on, which is the
- silence this feature exists to remove.
- """
- await _open(registry, tmp_path, 1)
- (only,) = _names(registry)
-
- await manager._run_agentic_ide_fast_path(f"Tell {only} to run the test suite")
-
- assert spy.events[0].kind == "preamble"
- assert spy.events[0].source_layer == "brain.agentic_ide.handoff"
- assert spy.events[0].language == "en"
-
-
-async def test_without_a_provider_the_canned_line_is_spoken_instead_of_silence(
- manager: BrainManager, registry: Registry, spy: _Spy, tmp_path: Path
-) -> None:
- """The keyless install (§3) still hears something, and it names the pane."""
- assert getattr(manager, "_readback_composer", None) is None
- await _open(registry, tmp_path, 1)
- (only,) = _names(registry)
-
- await manager._run_agentic_ide_fast_path(f"Tell {only} to run the test suite")
-
- assert only in spy.texts[0]
+ assert spy.events == []
+ assert reply is not None
+ assert only in reply
-async def test_a_fleet_hand_off_names_every_addressed_pane(
+async def test_a_fleet_hand_off_stays_silent_too(
manager: BrainManager, registry: Registry, spy: _Spy, tmp_path: Path
) -> None:
+ """Several panes take longer still — and are still not worth a false claim."""
+ manager._readback_composer = ReadbackComposer(provider=_LoudProvider())
await _open(registry, tmp_path, 2)
first, second = _names(registry)
- await manager._run_agentic_ide_fast_path(
+ reply = await manager._run_agentic_ide_fast_path(
f"Tell {first} and {second} to analyse the whole codebase"
)
- assert first in spy.texts[0]
- assert second in spy.texts[0]
+ assert spy.events == []
+ assert reply is not None
+ assert first in reply
+ assert second in reply
-async def test_control_returns_with_the_real_verdict_after_the_run(
+async def test_a_delivery_that_did_not_happen_is_reported_as_not_happened(
manager: BrainManager, registry: Registry, spy: _Spy, tmp_path: Path
) -> None:
- """The bridge line must never become the answer.
+ """The failure mode this file exists for, seen from the other end.
- Two separate statements at two separate times: the announcement says the
- request is on its way, the returned reply says what actually happened to
- each pane. A turn that returned the ack instead would report a delivery it
- never saw.
+ With an interim line in place, an undelivered pane left the user holding a
+ spoken "passing it on" and nothing after it. The verdict is now the first
+ and only thing said, so a pane that was never reached is named as such.
"""
+ manager._readback_composer = ReadbackComposer(provider=_LoudProvider())
await _open(registry, tmp_path, 2)
first, second = _names(registry)
assert registry.session is not None
@@ -259,8 +232,8 @@ async def test_control_returns_with_the_real_verdict_after_the_run(
f"Tell {first} and {second} to analyse the whole codebase"
)
+ assert spy.events == []
assert reply is not None
- assert reply not in spy.texts
lowered = reply.lower()
assert second in reply
assert any(word in lowered for word in ("not", "could not", "n't"))