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(computer-use): lift the 120s mission guillotine and make it configurable

Harald8628631555de
diff --git a/docs/computer-use.md b/docs/computer-use.md
index 63b1d96a46..7c6f3a6a13 100644
--- a/docs/computer-use.md
+++ b/docs/computer-use.md
@@ -168,10 +168,15 @@ cursor_glide_ms = 0 # set a positive value to opt into cursor animation
max_steps = 100
max_replans = 2
per_step_timeout_s = 30.0
+mission_timeout_s = 600.0 # wall-clock ceiling for one whole mission
verify_after_each_step = true
step_budget = 100
```
+`mission_timeout_s` bounds a whole mission, `per_step_timeout_s` a single step.
+Raise it for long GUI flows; lower it to cut runaway missions short. It is read
+when the brain is built, so a change applies after a restart.
+
`ROUTER_TOOLS` should remain a pure router-visible dispatcher set. Direct local
tools are loaded separately as hidden BrainManager tools so the model does not
need to decide among OS-control primitives for simple local commands.
diff --git a/jarvis/brain/factory.py b/jarvis/brain/factory.py
index 0dd8aa132b..3d60f7fdfe 100644
--- a/jarvis/brain/factory.py
+++ b/jarvis/brain/factory.py
@@ -471,10 +471,21 @@ def _load_tools_for_tier(
elif ep.name == "computer-use":
# Wave 1: wraps the harness-dispatch plumbing with a fixed
# computer-use harness identity (see computer_use_tool.py).
+ #
+ # The mission ceiling comes from [computer_use].mission_timeout_s
+ # (audit AU-07): without it every voice/chat-triggered desktop
+ # mission ran under the tool's own fallback and no user could
+ # change it. ``None`` (config absent, e.g. a minimal test config)
+ # keeps the tool's fallback.
inst = cls(
bus=bus,
manager=harness_manager,
max_output_chars=config.harness.max_output_chars,
+ timeout_s=getattr(
+ getattr(config, "computer_use", None),
+ "mission_timeout_s",
+ None,
+ ),
)
elif ep.name in ("verify-via-curl", "verify-localhost"):
inst = cls()
diff --git a/jarvis/core/config.py b/jarvis/core/config.py
index 79400f896a..ab3915a805 100644
--- a/jarvis/core/config.py
+++ b/jarvis/core/config.py
@@ -2068,6 +2068,15 @@ class ComputerUseConfig(BaseModel):
# no-progress guard in the loop still aborts dead-ends early.
max_replans: int = Field(default=2, ge=0, le=40)
per_step_timeout_s: float = Field(default=30.0, gt=0.0, le=300.0)
+ # Wall-clock ceiling for ONE whole computer-use mission (audit AU-07). This
+ # is the budget the router-tier ``computer_use`` tool hands the harness; the
+ # harness turns it into a deadline and raises TimeoutError when it passes.
+ # Default 600 (was a hardcoded 120): at a realistic 6-15 s per step the old
+ # ceiling exhausted after 8-20 steps while ``step_budget`` allowed 100, so
+ # every longer desktop task died halfway. Lower it to cut runaway missions
+ # short, raise it for long GUI flows. Read at brain build time — a change
+ # applies after a restart.
+ mission_timeout_s: float = Field(default=600.0, ge=10.0, le=3600.0)
# L10 (CU speed): ceiling on a single CU model (think/plan/judge) call.
# Default keeps the legacy 10.0 (no behaviour change); lower it -- with the
# cu_bench harness as proof -- to bound tail latency. The configured
diff --git a/jarvis/plugins/tool/computer_use_tool.py b/jarvis/plugins/tool/computer_use_tool.py
index d38c2de2a9..2c8cbd8f80 100644
--- a/jarvis/plugins/tool/computer_use_tool.py
+++ b/jarvis/plugins/tool/computer_use_tool.py
@@ -62,10 +62,15 @@ def _ctx_output_language(ctx: ExecutionContext) -> str:
return resolve_phrase_language(None, ctx.user_utterance)
-#: Default ceiling for a single computer-use run, in seconds. A multi-step GUI
-#: loop (open app → screenshot → click/type → verify) needs a generous budget;
-#: the per-step timeout inside the loop bounds individual actions.
-_DEFAULT_TIMEOUT_S = 120.0
+#: Fallback ceiling for a single computer-use run, in seconds, used only when
+#: no config value is wired (tests / minimal wiring). Production reads
+#: ``[computer_use].mission_timeout_s`` (jarvis/brain/factory.py).
+#:
+#: A multi-step GUI loop (open app → screenshot → click/type → verify) needs a
+#: generous budget: at a realistic 6-15 s per step the old fixed 120 s cut every
+#: mission off after 8-20 of its 100 allowed steps, so real desktop tasks died
+#: halfway. The per-step timeout inside the loop still bounds individual actions.
+_DEFAULT_TIMEOUT_S = 600.0
def _cu_failure_detail(output: Any) -> tuple[int | None, str | None]:
@@ -149,8 +154,11 @@ class ComputerUseTool:
bus: EventBus | None = None,
manager: HarnessManager | None = None,
max_output_chars: int = 4000,
- timeout_s: float = _DEFAULT_TIMEOUT_S,
+ timeout_s: float | None = None,
) -> None:
+ # ``None`` = "no config wired" and resolves to the module fallback, so
+ # the mission ceiling has exactly ONE default (AP: no second source of
+ # truth drifting away from [computer_use].mission_timeout_s).
# Reuse the harness-dispatch plumbing (streaming, trimming, timeout)
# rather than re-implementing it; we only fix the harness identity.
self._dispatch = DispatchToHarnessTool(
@@ -159,7 +167,9 @@ class ComputerUseTool:
max_output_chars=max_output_chars,
)
self._bus = bus
- self._timeout_s = float(timeout_s)
+ self._timeout_s = (
+ _DEFAULT_TIMEOUT_S if timeout_s is None else float(timeout_s)
+ )
# Strong refs so background missions are never garbage-collected
# mid-flight (same pattern as BrainManager._cu_background_tasks).
self._background_tasks: set[asyncio.Task[None]] = set()
diff --git a/jarvis/ui/web/computer_use_routes.py b/jarvis/ui/web/computer_use_routes.py
index 411f5721d1..73ff4c66fc 100644
--- a/jarvis/ui/web/computer_use_routes.py
+++ b/jarvis/ui/web/computer_use_routes.py
@@ -22,14 +22,22 @@ from typing import Any
from fastapi import APIRouter, HTTPException, Query
from pydantic import BaseModel, Field
+from jarvis.core.config import ComputerUseConfig
from jarvis.harness import cu_run_registry
log = logging.getLogger(__name__)
router = APIRouter(prefix="/api/computer-use", tags=["computer-use"])
-#: Matches the LLM tool's default mission timeout.
-_DEFAULT_TIMEOUT_S = 120.0
+#: Mission ceiling for a goal started over HTTP, taken from the SAME schema
+#: default as voice/tool launches (``[computer_use].mission_timeout_s``) so the
+#: two surfaces cannot drift apart — a hardcoded literal here silently kept the
+#: REST/CLI path on the old 120 s after audit AU-07 raised the tool to 600 s.
+#: Reading the field default keeps this import-time and I/O-free; a value set in
+#: jarvis.toml reaches this surface only when the caller passes ``timeout_s``.
+_DEFAULT_TIMEOUT_S = float(
+ ComputerUseConfig.model_fields["mission_timeout_s"].default
+)
_MIN_TIMEOUT_S = 10.0
_MAX_TIMEOUT_S = 3600.0