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.

chore: auto-save WIP via Claude stop-hook safety net (2026-06-30 16:56)

Ruben Lütke7933f51e2d42
diff --git a/jarvis/core/self_mod/provider_lock.py b/jarvis/core/self_mod/provider_lock.py
index 282aa0874d..58a00e0f59 100644
--- a/jarvis/core/self_mod/provider_lock.py
+++ b/jarvis/core/self_mod/provider_lock.py
@@ -16,6 +16,7 @@ Kept dependency-free (string patterns + ``fnmatch`` only) so both the writer
and the schema introspector can consult it without an import cycle, mirroring
``forbidden.py``.
"""
+
from __future__ import annotations
from fnmatch import fnmatch
diff --git a/tests/unit/plugins/tool/test_app_control_tools.py b/tests/unit/plugins/tool/test_app_control_tools.py
index 840d15027c..e1e60ce71c 100644
--- a/tests/unit/plugins/tool/test_app_control_tools.py
+++ b/tests/unit/plugins/tool/test_app_control_tools.py
@@ -267,8 +267,12 @@ async def test_switch_provider_tool_missing_credential(no_keys, monkeypatch):
from jarvis.plugins.tool.switch_provider import SwitchProviderTool
monkeypatch.setattr("jarvis.brain.app_control.resolve_running_cfg", lambda: make_cfg())
+ # tier=tts: the brain provider is locked to user-only channels (CLI / manual
+ # UI switch) and is refused up-front by the tool, so the missing-credential
+ # path is exercised on a still-voice-switchable tier. The brain lock itself
+ # is covered by tests/unit/plugins/tool/test_switch_provider_brain_lock.py.
res = await SwitchProviderTool().execute(
- {"tier": "brain", "provider": "gemini", "reason": "test"}, _ctx()
+ {"tier": "tts", "provider": "cartesia", "reason": "test"}, _ctx()
)
assert res.success is False
assert "not configured" in (res.error or "")
diff --git a/tests/unit/plugins/tool/test_switch_provider_brain_lock.py b/tests/unit/plugins/tool/test_switch_provider_brain_lock.py
index b81907a303..d419876b67 100644
--- a/tests/unit/plugins/tool/test_switch_provider_brain_lock.py
+++ b/tests/unit/plugins/tool/test_switch_provider_brain_lock.py
@@ -6,6 +6,7 @@ which is what calls this tool — must refuse a brain switch with an honest
message and never reach the actual switch path. TTS / STT / subagent switches
stay fully voice-controllable.
"""
+
from __future__ import annotations
import jarvis.brain.app_control as app_control
diff --git a/tests/unit/self_mod/test_provider_lock.py b/tests/unit/self_mod/test_provider_lock.py
index a83cd0d77a..1db721db84 100644
--- a/tests/unit/self_mod/test_provider_lock.py
+++ b/tests/unit/self_mod/test_provider_lock.py
@@ -11,6 +11,7 @@ Control-API mutation, so the lock holds regardless of which tool initiates the
write. The dedicated ``config_writer.set_brain_primary`` path used by the UI
button + ``jarvis brain switch`` does NOT flow through here and stays allowed.
"""
+
from __future__ import annotations
import json
@@ -62,9 +63,7 @@ def writer(fixture_path: Path, tmp_path: Path) -> AtomicConfigWriter:
def _req(path: str, value: object, actor: AuditActor) -> MutationRequest:
- return MutationRequest(
- path=path, new_value=value, actor=actor, source=AuditSource.VOICE
- )
+ return MutationRequest(path=path, new_value=value, actor=actor, source=AuditSource.VOICE)
# ----------------------------------------------------------------------
@@ -133,9 +132,7 @@ class TestWriterEnforcement:
assert result.ok is True
assert _isolated_loader(fixture_path).tts.provider == "elevenlabs"
- def test_refused_switch_is_audited(
- self, writer: AtomicConfigWriter, tmp_path: Path
- ) -> None:
+ def test_refused_switch_is_audited(self, writer: AtomicConfigWriter, tmp_path: Path) -> None:
with pytest.raises(ProviderSwitchLockedError):
writer.mutate(_req("brain.primary", "gemini", AuditActor.HAUPTJARVIS))
entries = [