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(missions): preserve tool time after approval
Ruben Lütkeb526d5e4dd8b
diff --git a/jarvis/missions/workers/broker_stdio.py b/jarvis/missions/workers/broker_stdio.pyindex 320deb7cea..ceea893fca 100644--- a/jarvis/missions/workers/broker_stdio.py+++ b/jarvis/missions/workers/broker_stdio.py@@ -16,9 +16,15 @@ from mcp import typesfrom mcp.server import Serverfrom mcp.server.stdio import stdio_server-from .worker_tool_broker import BROKER_TOKEN_ENV, BROKER_URL_ENV--_HTTP_TIMEOUT_S = 65.0+from .worker_tool_broker import (+ BROKER_EXECUTION_TIMEOUT_S,+ BROKER_TOKEN_ENV,+ BROKER_URL_ENV,+)++# The client must outlive the supervisor-side wait so it can receive the+# broker's deterministic timeout response instead of dropping the socket first.+_HTTP_TIMEOUT_S = BROKER_EXECUTION_TIMEOUT_S + 5.0def _endpoint() -> tuple[str, int]:diff --git a/jarvis/missions/workers/worker_tool_broker.py b/jarvis/missions/workers/worker_tool_broker.pyindex 43e712d540..5618024e23 100644--- a/jarvis/missions/workers/worker_tool_broker.py+++ b/jarvis/missions/workers/worker_tool_broker.py@@ -33,7 +33,11 @@ BROKER_TOKEN_ENV = "JARVIS_WORKER_BROKER_TOKEN" # noqa: S105 - env variable namBROKER_URL_ENV = "JARVIS_WORKER_BROKER_URL"_DEFAULT_TTL_S = 25 * 60.0-_EXECUTION_TIMEOUT_S = 65.0+# Approval alone may consume ToolExecutor's 60-second window. Keep the process+# boundary open for the subsequent action and let mission cancellation revoke+# the grant and cancel the in-flight task. A 65-second cap left only five+# seconds for the real MCP/app call after a last-moment approval.+BROKER_EXECUTION_TIMEOUT_S = 15 * 60.0_MAX_REQUEST_BYTES = 1024 * 1024_FORBIDDEN_EXACT = frozenset(@@ -550,7 +554,7 @@ class _BrokerRequestHandler(BaseHTTPRequestHandler):scope.execute(name, arguments), scope.loop)try:- result = future.result(timeout=_EXECUTION_TIMEOUT_S)+ result = future.result(timeout=BROKER_EXECUTION_TIMEOUT_S)except TimeoutError:future.cancel()self._send(504, {"error": "supervisor tool execution timed out"})@@ -697,6 +701,7 @@ def issue_worker_tool_binding(__all__ = [+ "BROKER_EXECUTION_TIMEOUT_S","BROKER_SERVER_ID","BROKER_TOKEN_ENV","BROKER_URL_ENV",diff --git a/tests/missions/test_worker_tool_broker.py b/tests/missions/test_worker_tool_broker.pyindex bda4103d5e..a37401fb5e 100644--- a/tests/missions/test_worker_tool_broker.py+++ b/tests/missions/test_worker_tool_broker.py@@ -26,12 +26,18 @@ from jarvis.missions.workers.codex_direct_worker import _build_codex_direct_cmdfrom jarvis.missions.workers.gemini_worker import _build_isolated_gemini_envfrom jarvis.missions.workers.worker_tool_broker import (_BROKER,+ BROKER_EXECUTION_TIMEOUT_S,BROKER_TOKEN_ENV,BROKER_URL_ENV,)from jarvis.safety import ApprovalWorkflow, RiskTierEvaluator, ToolExecutor+def test_broker_timeout_leaves_room_after_the_approval_window() -> None:+ assert BROKER_EXECUTION_TIMEOUT_S >= 2 * 60.0+ assert broker_stdio._HTTP_TIMEOUT_S > BROKER_EXECUTION_TIMEOUT_S++@dataclassclass _Tool:name: str