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(society): delegate routine tool approval to the app

rubenluetke10-beep3489db4bae8e
diff --git a/jarvis/agent_chat/jarvis_harness.py b/jarvis/agent_chat/jarvis_harness.py
index 34ae2aac92..d03d8fbeed 100644
--- a/jarvis/agent_chat/jarvis_harness.py
+++ b/jarvis/agent_chat/jarvis_harness.py
@@ -182,6 +182,14 @@ def codex_config_args(session_id: str | None = None) -> list[str]:
# tools. Surface startup failures instead of a tools-free chat
# that can only promise to configure the running app.
args += ["-c", f"mcp_servers.{_SERVER_NAME}.required=true"]
+ # This local configuration tool already verifies the current
+ # user request and routes permission changes to Jarvis' own
+ # approval card. A second Codex write prompt cannot be answered
+ # by `exec` and would reject even explicit routine requests.
+ args += [
+ "-c",
+ f'mcp_servers.{_SERVER_NAME}.tools.society_propose_change.approval_mode="approve"',
+ ]
return args
except Exception: # noqa: BLE001 — see mcp_config_json
log.warning("agent chat: could not build the Codex MCP overrides", exc_info=True)
diff --git a/tests/unit/society/test_cli_routines.py b/tests/unit/society/test_cli_routines.py
index 1bd445e174..b897c709c1 100644
--- a/tests/unit/society/test_cli_routines.py
+++ b/tests/unit/society/test_cli_routines.py
@@ -227,7 +227,22 @@ def test_resumed_society_seat_refreshes_routine_contract(monkeypatch, tmp_path):
identity=identity,
)
assert "mcp_servers.jarvis.required=true" in plan.argv
+ assert 'mcp_servers.jarvis.tools.society_propose_change.approval_mode="approve"' in plan.argv
+ assert not any("default_tools_approval_mode" in arg for arg in plan.argv)
assert "society_propose_change" in plan.stdin_text
assert "LARGE OLD IDENTITY" not in plan.stdin_text
assert plan.stdin_text.endswith("Check comments every hour")
assert "test-key" not in " ".join(plan.argv)
+
+
+def test_routine_approval_delegation_is_only_for_society(monkeypatch):
+ from jarvis.agent_chat import jarvis_harness
+
+ monkeypatch.setattr(jarvis_harness, "control_key", lambda: "test-key")
+ monkeypatch.setattr(
+ jarvis_harness, "endpoint", lambda: "http://localhost:47821/api/control/mcp/"
+ )
+ for session_id in (None, "ordinary-chat"):
+ assert not any(
+ "approval_mode" in arg for arg in jarvis_harness.codex_config_args(session_id)
+ )