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(cu): missions no longer start blind to the conversation — self-contained goals + prior-mission context (BUG-105)
Personal Jarvis Maintainerdd35a78f67f4
diff --git a/docs/BUGS.md b/docs/BUGS.mdindex 822a8018e6..70eb574339 100644--- a/docs/BUGS.md+++ b/docs/BUGS.md@@ -5917,7 +5917,7 @@ released by a message from the (now dead) transport will wedge; whoeverdeclares the old turn finished must broadcast that fact to all surfaces,not just to the recorder.-## BUG-086: Realtime voice audibly flips gender between turns while every transcript label reads the same pinned voice (HIGH, MITIGATED 2026-07-18, ESCALATION SHIPPED 2026-07-21, provider-side root cause OPEN)+## BUG-086: Realtime voice audibly flips gender between turns while every transcript label reads the same pinned voice (HIGH, MITIGATED 2026-07-18, ESCALATION SHIPPED 2026-07-21 AND REVERTED SAME DAY, provider-side root cause OPEN)**Symptom (live 2026-07-18 17:12, session `f4e8e93d`, gemini-live,4 turns).** The audible voice alternated male / female / male /@@ -5976,9 +5976,25 @@ still injected so the live model keeps conversational context — its own(re-)rendering stays withheld via the existing one-reply-one-voice flags.The browser surface keeps the native readback: it has no server-siderendering for `error_spoken`, and its Web-Speech fallback would be a THIRD-voice. Guards:-`tests/unit/realtime/test_session.py::test_generative_voice_provider_delegate_reply_is_spoken_by_the_surface`-and `::test_generative_voice_provider_keeps_native_readback_on_the_browser_surface`.+voice.++**Escalation REVERTED (2026-07-21, maintainer live validation failed).**+The live verdict on the escalation: the `gemini-flash-tts` rendering of+the pinned voice is audibly a DIFFERENT voice than the live model's native+rendering of that same voice name — so the escalation turned "occasional+drift on deep replies" into a GUARANTEED voice flip on every tool-model+turn (live session 2026-07-21 10:33: every delegated turn spoke+`Puck @ gemini-flash-tts`, audibly unlike the native `Puck @ gemini-live`+of plain turns). The maintainer's directive: the session's ONE voice is+the NATIVE realtime voice. The `renders_pinned_voice` capability and the+immediate surface claim were removed; delegate replies render natively+again with the surface TTS strictly as the provider-mute fallback (the+pre-escalation 2.5 s window), and the injected identity clauses remain+the drift mitigation. Do not re-add an immediate surface claim — a+deterministic wrong voice is worse than an occasional drift. Guards:+`tests/unit/realtime/test_session.py::test_generative_voice_provider_delegate_reply_renders_natively_on_desktop`,+`::test_generative_voice_provider_mute_still_falls_back_to_surface_tts`,+`::test_generative_voice_provider_keeps_native_readback_on_the_browser_surface`.**Still OPEN.**@@ -7231,3 +7247,56 @@ budget was gone. The seed path had never run on this install beforeGuards: `tests/unit/realtime/test_gemini_live.py` (seed declaration +terminator + SDK-capability skip + blank-history terminator),`tests/unit/realtime/test_session.py::test_second_rapid_rebuild_drops_the_poisoned_history_seed`.++## BUG-105: Computer-Use missions start blind to the conversation — a corrective follow-up launches an operator that only executes the correction's literal words (HIGH, FIXED 2026-07-21)++**Symptom (live 2026-07-21 10:33, realtime voice, gemini-live).** Turn 5:+"find the latest post of <person> via computer use" — the mission ran in+Safari and succeeded. Turn 8: "you must do it in my Chrome browser, I'm+logged in there — you're in Safari." The new mission opened Chrome, saw a+stale old tab, and declared success: it never knew the actual task was+opening that post, nor that the previous attempt had used the wrong+browser. Turn 9 ("you should ALSO open the latest post") went back to+Safari and died on a login wall.++**Root cause — context is dropped twice on the way into a mission.**++1. **The goal is written context-free by design.** The router prompt+ (`jarvis/brain/router.py`) mandated `computer_use(goal=<utterance+ VERBATIM>)` and the tool schema (`computer_use_tool.py`) said "Pass the+ user's request verbatim as 'goal'". Verbatim protects multi-step+ requests from paraphrase-loss, but for an ELLIPTICAL follow-up it+ guarantees ellipsis-loss: the tool-brain HAS the bounded conversation+ history (`history_override`, session.py `_dispatch_brain_turn`), and+ was instructed to throw it away.+2. **The mission itself has no memory of prior missions.** The CU engine's+ decide prompt contained only `GOAL:` + its own per-run step history;+ `cu_run_registry` records every mission's goal and outcome for the+ REST/CLI control surface, but nothing on the launch path ever read it.++**Fix (two layers, all launch routes).**++1. **Self-contained goals** — the router prompt gained an explicit+ elliptical-follow-up exception (keep the user's words AND fold in the+ referenced task, target app/browser, and what the previous attempt got+ wrong), and the `computer_use` tool description/schema now demand one+ complete self-contained instruction ("the operator sees only this+ text, never the chat").+2. **Deterministic prior-mission context** —+ `cu_run_registry.recent_runs_context()` renders the recently FINISHED+ runs (≤2, ≤15 min, char-clamped) and `jarvis/cu/engine.py` folds the+ block into the DECIDE prompt as "EARLIER DESKTOP MISSIONS … context+ only — do NOT redo them". Route-agnostic (voice fast path, tool-brain,+ REST/CLI all register runs) and prompt-compliance-free. The done-judge+ deliberately never sees it: a prior mission's outcome must not count+ as proof for the current goal.++Guards:+`tests/unit/harness/test_cu_run_registry.py::test_recent_runs_context_*`,+`tests/unit/cu/test_engine_loop.py::test_recent_missions_reach_the_decide_prompt_but_not_the_judge`.++**Class rule.** Any sub-system that executes a REQUEST derived from a+conversation must either receive the conversation's relevant context+structurally (not by prompt-compliance alone) or have its request+composed as self-contained — an instruction to pass user words+"verbatim" must always carry the elliptical-follow-up exception.diff --git a/jarvis/brain/router.py b/jarvis/brain/router.pyindex 4f51838f6f..c3c6a3b16c 100644--- a/jarvis/brain/router.py+++ b/jarvis/brain/router.py@@ -314,6 +314,14 @@ Du sortierst jede Ruben-Nachricht in genau eine von drei Kategorien:"oeffne ein Terminal, starte Claude Code darin und gib ihm den Prompt X"→ computer_use(goal=<verbatim>), selbst wenn der Prompt-INHALT (X) nachschwerer Arbeit klingt — das andere Programm arbeitet, nicht du.+ EXCEPTION — elliptical follow-ups (BUG-105): the desktop operator can+ NOT see this conversation. If the utterance only corrects or refers+ back to an earlier desktop request ("do it in my Chrome browser",+ "try again", "also open his newest post"), the goal must be+ SELF-CONTAINED: keep the user's words AND fold in the referenced task+ and its constraints from the conversation — the underlying objective,+ the target app/browser/site, and what the previous attempt got wrong.+ An unexpanded "do it in Chrome" just opens Chrome and stops.- Shell-Kommando: "ls im Desktop", "starte notepad" (run_shell)- Bildschirm beschreiben: "was siehst du auf meinem Screen" (screenshot)- "merk dir X": KEIN Tool — beginne deine Antwort mit "Notiert" (siehediff --git a/jarvis/cu/engine.py b/jarvis/cu/engine.pyindex d77ba21637..db6a8f0473 100644--- a/jarvis/cu/engine.py+++ b/jarvis/cu/engine.py@@ -614,6 +614,22 @@ async def run_cu_loop(ledger = ActionLedger()history: list[str] = []step_idx = 0+ # Follow-up context (BUG-105): a mission starts blind to the conversation,+ # so a corrective goal ("do it in my Chrome browser") used to launch an+ # operator that knew nothing about the task it was correcting — it opened+ # Chrome on a stale tab and declared success. The run registry records+ # every mission of this process regardless of launch route (voice fast+ # path, tool-brain, REST/CLI), so the recently finished tail is the+ # route-agnostic memory of "what we were just doing". Read once at+ # mission start (the live registry already lists THIS run as active and+ # is excluded); decide-prompt only — the done-judge keeps verifying+ # strictly against the goal, never against prior missions' outcomes.+ try:+ from jarvis.harness import cu_run_registry # noqa: PLC0415++ prior_missions = cu_run_registry.recent_runs_context()+ except Exception: # noqa: BLE001 — context is best-effort, never mission-fatal+ prior_missions = ""def _final(stdout: str = "", stderr: str = "", exit_code: int = 0) -> HarnessResult:profile = profiler.summary(step_idx, t_start)@@ -872,6 +888,13 @@ async def run_cu_loop(+ conv_mod.action_grammar_block())lines = [f"GOAL: {goal}"]+ if prior_missions:+ lines.append(+ "EARLIER DESKTOP MISSIONS of this conversation (context "+ "only — they already finished; use them to resolve what "+ "an elliptical GOAL refers to, do NOT redo them):\n"+ + prior_missions,+ )if _title:lines.append(f"FOREGROUND WINDOW: {_title}")if _labels:diff --git a/jarvis/harness/cu_run_registry.py b/jarvis/harness/cu_run_registry.pyindex d33bf6b6d7..430ce5cbd0 100644--- a/jarvis/harness/cu_run_registry.py+++ b/jarvis/harness/cu_run_registry.py@@ -166,6 +166,48 @@ def active_run_count() -> int:return sum(1 for r in _RUNS.values() if r.status in ACTIVE_STATUSES)+#: Bounds for the follow-up context block below. A mission older than this is+#: no longer "the thing we were just doing"; the char clamps keep the block a+#: few prompt lines, never a transcript dump.+_CONTEXT_MAX_AGE_S = 15 * 60.0+_CONTEXT_MAX_RUNS = 2+_CONTEXT_GOAL_MAX = 200+_CONTEXT_RESULT_MAX = 240+++def recent_runs_context(now: float | None = None) -> str:+ """Compact summary of the most recently FINISHED runs, "" when none.++ Follow-up context for the next mission (BUG-105): a desktop mission+ starts blind to the conversation, so an elliptical follow-up goal+ ("do it in my Chrome browser") used to launch an operator that knew+ nothing about the task it was correcting. The registry already records+ every mission's goal and outcome — this renders the recent tail as a+ few English prompt lines the engine folds into its decide prompt.+ Active runs are excluded (the current mission is registered before its+ loop starts and must not describe itself as prior work).+ """+ now_s = time.time() if now is None else float(now)+ recent: list[str] = []+ runs = sorted(_RUNS.values(), key=lambda r: r.ended_at or 0.0, reverse=True)+ for run in runs:+ if run.status not in TERMINAL_STATUSES or run.ended_at is None:+ continue+ age_s = now_s - run.ended_at+ if age_s < 0 or age_s > _CONTEXT_MAX_AGE_S:+ continue+ goal = " ".join(run.goal.split())[:_CONTEXT_GOAL_MAX]+ result = " ".join(run.result_text.split())[:_CONTEXT_RESULT_MAX]+ age_min = max(1, round(age_s / 60.0))+ line = f"- {age_min} min ago ({run.status}): goal was: {goal}"+ if result:+ line += f" | outcome: {result}"+ recent.append(line)+ if len(recent) >= _CONTEXT_MAX_RUNS:+ break+ return "\n".join(recent)++def clear_runs() -> None:"""Test/teardown helper — wipes the registry."""_RUNS.clear()diff --git a/jarvis/plugins/tool/computer_use_tool.py b/jarvis/plugins/tool/computer_use_tool.pyindex 772aa9f6f6..468820bb28 100644--- a/jarvis/plugins/tool/computer_use_tool.py+++ b/jarvis/plugins/tool/computer_use_tool.py@@ -111,9 +111,16 @@ class ComputerUseTool:"operate any GUI application. Use this for ANY on-screen / app / ""desktop action the user asks for (e.g. 'open a terminal', 'open Chrome ""and go to gmail', 'click the blue button', 'type X into Notepad', "- "'scroll down'). Pass the user's request verbatim as 'goal'. This drives "- "the real machine — unlike spawn_worker, which only works in an "- "isolated code workspace and cannot touch the desktop."+ "'scroll down'). The desktop operator canNOT see this conversation: "+ "'goal' must be one complete, self-contained instruction. Keep the "+ "user's own words, and when the request corrects or refers back to an "+ "earlier turn ('do it in my Chrome browser', 'try again', 'also open "+ "his newest post'), fold the referenced task and its constraints into "+ "the goal — the underlying objective, the target app/browser/site, "+ "and what the previous attempt got wrong. An unexpanded 'do it in "+ "Chrome' just opens Chrome and stops. This drives the real machine — "+ "unlike spawn_worker, which only works in an isolated code workspace "+ "and cannot touch the desktop.")schema: dict[str, Any] = {"type": "object",@@ -121,8 +128,11 @@ class ComputerUseTool:"goal": {"type": "string","description": (- "The desktop action to perform, in the user's own words "- "(e.g. 'open a terminal and start the cloud config')."+ "The complete desktop task as ONE self-contained "+ "instruction in the user's words, with everything the "+ "conversation established folded in (target app/site, "+ "the actual objective behind a follow-up correction). "+ "The operator sees only this text, never the chat."),},},diff --git a/tests/unit/cu/test_engine_loop.py b/tests/unit/cu/test_engine_loop.pyindex 4f4e3cc27a..0749e9bcae 100644--- a/tests/unit/cu/test_engine_loop.py+++ b/tests/unit/cu/test_engine_loop.py@@ -194,6 +194,41 @@ async def test_done_is_verified_and_proof_flows_to_stdout(patched):assert "[cu] done (verified: the calculator shows 8)" in final.stdout+async def test_recent_missions_reach_the_decide_prompt_but_not_the_judge(patched):+ """Follow-up context (BUG-105): a corrective goal ('do it in my Chrome+ browser') starts a mission that is blind to the conversation. The engine+ folds the registry's recently finished runs into the DECIDE prompt so+ the operator can resolve what the elliptical goal refers to — while the+ done-judge keeps verifying strictly against the goal alone, so a prior+ mission's outcome can never count as proof for this one."""+ from jarvis.harness import cu_run_registry++ cu_run_registry.clear_runs()+ cu_run_registry.register_run(+ "prior1", "open the newest post of the profile on x.com", None,+ )+ cu_run_registry.finish_run(+ "prior1", "finished", exit_code=0,+ result_text="[cu] done (verified: post visible in Safari)",+ )+ try:+ brain = FakeBrain([+ '{"action": "done", "reason": "it is visible"}', # decide+ '{"done": true, "proof": "the post is open"}', # judge+ ])+ chunks = await _run(_ctx(brain, FakeExecutor()))+ final = _final(chunks)+ assert final.exit_code == 0+ decide_user = brain.calls[0][1]+ assert "EARLIER DESKTOP MISSIONS" in decide_user+ assert "open the newest post of the profile" in decide_user+ assert "post visible in Safari" in decide_user+ judge_user = brain.calls[-1][1]+ assert "EARLIER DESKTOP MISSIONS" not in judge_user+ finally:+ cu_run_registry.clear_runs()++async def test_dispatch_refuses_action_after_screen_permission_revocation(monkeypatch,):diff --git a/tests/unit/harness/test_cu_run_registry.py b/tests/unit/harness/test_cu_run_registry.pyindex 1cfbd99526..6caad140a4 100644--- a/tests/unit/harness/test_cu_run_registry.py+++ b/tests/unit/harness/test_cu_run_registry.py@@ -110,6 +110,53 @@ def test_list_runs_newest_first() -> None:assert ids == ["new", "old"]+# ----------------------------------------------------------------------+# Follow-up context for the next mission (BUG-105)+# ----------------------------------------------------------------------++def test_recent_runs_context_summarizes_finished_runs_newest_first() -> None:+ reg.register_run("a", "open the newest post of the profile", CancelToken())+ reg.finish_run(+ "a", "finished", exit_code=0,+ result_text="[cu] done (verified: post visible in Safari)",+ )+ reg._RUNS["a"].ended_at -= 120+ reg.register_run("b", "open Chrome", CancelToken())+ reg.finish_run("b", "error", exit_code=5, result_text="fail at step-5")++ block = reg.recent_runs_context()+ lines = block.splitlines()+ assert len(lines) == 2+ assert "open Chrome" in lines[0] and "(error)" in lines[0]+ assert "newest post" in lines[1] and "post visible in Safari" in lines[1]+++def test_recent_runs_context_excludes_active_old_and_overflow_runs() -> None:+ # Active (the CURRENT mission registers itself before its loop starts).+ reg.register_run("live", "the running goal", CancelToken())+ # Too old to still be "what we were just doing".+ reg.register_run("stale", "an ancient goal", CancelToken())+ reg.finish_run("stale", "finished", exit_code=0)+ reg._RUNS["stale"].ended_at -= reg._CONTEXT_MAX_AGE_S + 60+ # Three fresh terminal runs — only the newest two may appear.+ for i in range(3):+ reg.register_run(f"f{i}", f"goal number {i}", CancelToken())+ reg.finish_run(f"f{i}", "finished", exit_code=0)+ reg._RUNS[f"f{i}"].ended_at -= (3 - i)++ block = reg.recent_runs_context()+ assert "the running goal" not in block+ assert "an ancient goal" not in block+ assert len(block.splitlines()) == reg._CONTEXT_MAX_RUNS+ assert "goal number 2" in block and "goal number 1" in block+++def test_recent_runs_context_is_empty_without_finished_runs() -> None:+ assert reg.recent_runs_context() == ""+ reg.register_run("only-active", "g", CancelToken())+ assert reg.recent_runs_context() == ""++# ----------------------------------------------------------------------# Harness integration# ----------------------------------------------------------------------