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(realtime): clarify and confirm answers bypass the continuation guard

rubenluetke10-beepbb4ada4494bc
diff --git a/docs/BUGS.md b/docs/BUGS.md
index 47289c4c92..cda1161da8 100644
--- a/docs/BUGS.md
+++ b/docs/BUGS.md
@@ -9047,7 +9047,12 @@ does carry is already covered by the running order's own reasons; and it is
fragment-short. A refused turn gets the deterministic progress line and the
trusted result via the late flush. Enforced at BOTH doors a second executor
can open through: the deterministic dispatch site and the provider's
-`jarvis_action` call path.
+`jarvis_action` call path. Review caught a vacuous-truth hole in the subset
+probe before it shipped: a bare "yes" answering a clarify question or an
+ask-tier confirmation plans with EMPTY reasons, and an empty set is a subset
+of every running order's — so a turn the clarify/confirm mechanism already
+owns bypasses the guard entirely, and refusal additionally requires the
+fragment to carry at least one reason of its own.
**Guards:** `tests/unit/realtime/test_split_utterance_single_order.py` — the
live transcripts verbatim against the real planner, plus the counter-cases
diff --git a/jarvis/realtime/session.py b/jarvis/realtime/session.py
index cc15283f79..e3153e0d49 100644
--- a/jarvis/realtime/session.py
+++ b/jarvis/realtime/session.py
@@ -7036,7 +7036,20 @@ class RealtimeVoiceSession:
A wrongly refused turn degrades honestly (the deterministic progress
line now, the trusted result via the late flush); a wrongly allowed
turn executes a user order TWICE. The asymmetry decides the ties.
+
+ A turn the clarify/confirm mechanism already owns bypasses the guard
+ entirely: a bare "yes" answering an ask-tier confirmation plans with
+ EMPTY reasons, and an empty set is a subset of every running order's
+ reasons — probe 3 would hold vacuously and the confirmation would be
+ swallowed (not delayed: dropped, no delegate ever starts for it)
+ whenever any UNRELATED order happens to be in flight. The same
+ vacuous-truth hole is closed generally below: refusal requires the
+ fragment to carry at least ONE reason of its own.
"""
+ if self._answers_open_delegate_question() or (
+ self._brain_awaits_voice_confirm()
+ ):
+ return False
text = str(self._last_user_text or "").strip()
if not text or len(text.split()) > _CONTINUATION_FRAGMENT_MAX_TOKENS:
return False
@@ -7044,7 +7057,10 @@ class RealtimeVoiceSession:
return False
if self._workspace_owns_turn(text):
return False
- return any(
+ # The running order re-plans against the CURRENT delegate history;
+ # while it is still executing nothing has been appended for it, so
+ # both plans see the same context.
+ return bool(turn_plan.reasons) and any(
turn_plan.reasons <= self._plan_turn(order_text).reasons
for order_text in self._executing_order_texts()
)
diff --git a/tests/unit/realtime/test_split_utterance_single_order.py b/tests/unit/realtime/test_split_utterance_single_order.py
index 525f2c9993..d3558504ca 100644
--- a/tests/unit/realtime/test_split_utterance_single_order.py
+++ b/tests/unit/realtime/test_split_utterance_single_order.py
@@ -216,6 +216,53 @@ async def test_no_running_order_means_no_refusal() -> None:
assert not _guard(session, LIVE_FRAGMENT)
+async def test_a_clarify_answer_dispatches_while_an_unrelated_order_runs() -> None:
+ # A bare "Yes." plans with EMPTY reasons, and an empty set is a subset
+ # of every running order's reasons — without the clarify/confirm bypass
+ # the vacuous subset would swallow the answer (not delay it: drop it)
+ # whenever any unrelated order is still in flight.
+ session = _session()
+ task = _pending_order(session, "Please check my email for anything urgent")
+ session._delegate_reply_awaits_answer = True
+ try:
+ assert not _guard(session, "Yes."), (
+ "a short answer to an open clarify question belongs to the "
+ "clarify flow — an unrelated executing order must never refuse it"
+ )
+ finally:
+ task.cancel()
+
+
+async def test_a_voice_confirmation_dispatches_while_an_unrelated_order_runs() -> None:
+ session = _session()
+ session._brain = SimpleNamespace(
+ conversation_language="en",
+ has_pending_voice_confirm=lambda: True,
+ )
+ task = _pending_order(session, "Please check my email for anything urgent")
+ try:
+ assert not _guard(session, "Yes, do it."), (
+ "a pending ask-tier confirmation owns the yes — refusing it "
+ "would silently drop a confirmed action"
+ )
+ finally:
+ task.cancel()
+
+
+async def test_an_empty_reason_fragment_is_never_refused_on_vacuous_evidence() -> None:
+ # Defense in depth past the clarify/confirm bypass: refusal must require
+ # the fragment to carry at least one planner reason of its own.
+ session = _session()
+ task = _pending_order(session, LIVE_ORDER)
+ try:
+ assert not _guard(session, "Nossa."), (
+ "an evidence-free fragment must not be refused on the vacuous "
+ "empty-subset — it never planned as an order in the first place"
+ )
+ finally:
+ task.cancel()
+
+
async def test_the_provider_tool_call_path_refuses_the_fragment_too() -> None:
"""The same fragment arriving as a provider ``jarvis_action`` call.