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(voice): create, pause, resume or test-run a routine without a second yes

rubenluetke10-beepcb5928bc82de
diff --git a/jarvis/commands/registry.py b/jarvis/commands/registry.py
index 97af9e900b..79dae0a421 100644
--- a/jarvis/commands/registry.py
+++ b/jarvis/commands/registry.py
@@ -408,8 +408,10 @@ def _build_registry() -> tuple[AppCommand, ...]:
"prompt is the complete task the agent runs each time: sources, steps, "
"output. Speak the returned next_run; on timezone_required ask the user."
),
+ # Not dangerous: the user ordered it, and a routine is paused or
+ # deleted in one step (a second spoken yes was a live complaint).
method="POST", path="/api/society/agents/{agent_id}/routines",
- path_params=("agent_id",), ui_section="agents", dangerous=True,
+ path_params=("agent_id",), ui_section="agents",
params={"type": "object", "properties": {
"agent_id": _str_param("Agent id or exact name.", min_length=1),
"title": _str_param("Short routine name.", min_length=1, max_length=200),
diff --git a/jarvis/plugins/tool/app_command.py b/jarvis/plugins/tool/app_command.py
index 21d0905a7c..fa1f18a153 100644
--- a/jarvis/plugins/tool/app_command.py
+++ b/jarvis/plugins/tool/app_command.py
@@ -270,6 +270,14 @@ def _remember(command_id: str, outcome: str, detail: str) -> None:
log.warning("app-actions history unavailable", exc_info=True)
+# Dangerous commands whose argument names the one destructive form. The
+# others are what the user just ordered and run without a second spoken yes
+# (live 2026-10-01: "test-run the routine" was asked back twice).
+_ONLY_ASKS_FOR: dict[str, tuple[str, frozenset[str]]] = {
+ "society-routine-operation": ("operation", frozenset({"delete"})),
+}
+
+
class RegistryCommandTool:
"""One registry command as a flat, schema-validated brain tool."""
@@ -278,8 +286,12 @@ class RegistryCommandTool:
self._runtime = runtime
self.name: str = command.id
self.risk_tier: str = "ask" if command.dangerous else "monitor"
+ narrowed = _ONLY_ASKS_FOR.get(command.id)
note = (
- " Requires the user's spoken confirmation before it runs."
+ f" Requires the user's spoken confirmation when {narrowed[0]} is "
+ f"{' or '.join(sorted(narrowed[1]))}."
+ if command.dangerous and narrowed
+ else " Requires the user's spoken confirmation before it runs."
if command.dangerous else ""
)
self.description: str = (
@@ -297,21 +309,25 @@ class RegistryCommandTool:
from jarvis.app_actions.catalog import live_catalog
from jarvis.app_actions.policy import effective_tier, load_policy
+ base = self.risk_tier
+ narrowed = _ONLY_ASKS_FOR.get(self.name)
+ if narrowed and str((args or {}).get(narrowed[0]) or "") not in narrowed[1]:
+ base = "monitor"
policy = load_policy()
if not policy:
- return self.risk_tier
+ return base
method = self._cmd.method.upper()
for entry in live_catalog().values():
if entry.method == method and entry.path == self._cmd.path:
if entry.id not in policy:
- return self.risk_tier
+ return base
tier = effective_tier(entry, policy)
if tier == "block":
from jarvis.app_actions import history
history.record(entry.id, "blocked", "Blocked in Jarvis actions", via=self.name)
return tier
- return self.risk_tier
+ return base
async def execute(self, args: dict[str, Any], ctx: Any) -> ToolResult:
cmd = self._cmd
diff --git a/tests/unit/plugins/tool/test_app_command.py b/tests/unit/plugins/tool/test_app_command.py
index e0f33d0621..7eb26d3a3e 100644
--- a/tests/unit/plugins/tool/test_app_command.py
+++ b/tests/unit/plugins/tool/test_app_command.py
@@ -433,3 +433,14 @@ async def test_installing_a_skill_by_name_reports_what_landed() -> None:
# verdict, not just an `ok: true` the model would have to interpret.
assert response["state"] == "installed"
assert response["ready"] is True
+
+
+def test_an_ordered_routine_runs_without_a_second_yes_but_delete_still_asks() -> None:
+ # Live 2026-10-01: "create the routine" and "test-run it" each needed a
+ # second spoken yes although the user had just asked for exactly that.
+ tools = _tools()
+ assert tools["society-create-routine"].risk_tier == "monitor"
+ operation = tools["society-routine-operation"]
+ for safe in ("pause", "resume", "run"):
+ assert operation.risk_tier_for_args({"operation": safe}) == "monitor"
+ assert operation.risk_tier_for_args({"operation": "delete"}) == "ask"