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(config): heal ack_brain env keys from the user registry at boot

Ruben Lütke6fb6fdda6357
diff --git a/jarvis/core/config.py b/jarvis/core/config.py
index 97f955c96e..5774e6e4ea 100644
--- a/jarvis/core/config.py
+++ b/jarvis/core/config.py
@@ -1874,6 +1874,17 @@ _PERSISTED_PROVIDER_ENV_KEYS: tuple[str, ...] = (
"JARVIS__BRAIN__SUB_JARVIS__PROVIDER",
"JARVIS__TTS__PROVIDER",
"JARVIS__STT__PROVIDER",
+ # ack_brain subsystem master + flash provider selection. Same drift-guard
+ # 3-layer sync as the provider tiers above, so a stale inherited value must
+ # heal at boot too. Forensic 2026-06-21: an in-app restart inherited a
+ # pre-change ancestor env with JARVIS__ACK_BRAIN__ENABLED=false /
+ # PROVIDER=gemini; absent from this list it survived the restart (env > toml)
+ # and kept the grounded spawn announcer in canned-pool mode even though the
+ # registry already held enabled=true / provider=grok. The spoken spawn ACK
+ # then stayed a generic stock phrase instead of context-aware text.
+ "JARVIS__ACK_BRAIN__ENABLED",
+ "JARVIS__ACK_BRAIN__PROVIDER",
+ "JARVIS__ACK_BRAIN__FALLBACK_PROVIDER",
)
diff --git a/tests/unit/core/test_persisted_provider_env_refresh.py b/tests/unit/core/test_persisted_provider_env_refresh.py
index c7bbb8f85b..1aaba0cbd8 100644
--- a/tests/unit/core/test_persisted_provider_env_refresh.py
+++ b/tests/unit/core/test_persisted_provider_env_refresh.py
@@ -73,9 +73,36 @@ def test_refresh_covers_all_persistent_provider_keys() -> None:
"JARVIS__BRAIN__SUB_JARVIS__PROVIDER",
"JARVIS__TTS__PROVIDER",
"JARVIS__STT__PROVIDER",
+ # ack_brain master + flash provider: drift-guard-maintained, so a stale
+ # inherited value must heal too. Forensic 2026-06-21: a restart inherited
+ # JARVIS__ACK_BRAIN__ENABLED=false / PROVIDER=gemini from a pre-change
+ # ancestor env; not being on this list, it survived the restart and kept
+ # the grounded spawn announcer in canned-pool mode despite the registry
+ # already holding enabled=true / provider=grok.
+ "JARVIS__ACK_BRAIN__ENABLED",
+ "JARVIS__ACK_BRAIN__PROVIDER",
+ "JARVIS__ACK_BRAIN__FALLBACK_PROVIDER",
} <= keys
+def test_refresh_heals_stale_ack_brain_enabled(monkeypatch: pytest.MonkeyPatch) -> None:
+ """The exact 2026-06-21 regression: a stale inherited enabled=false is healed
+ to the registry's true, so the spawn announcer's LLM path is wired on boot."""
+ monkeypatch.setenv("JARVIS__ACK_BRAIN__ENABLED", "false") # stale inherited
+ monkeypatch.setenv("JARVIS__ACK_BRAIN__PROVIDER", "gemini") # stale, dead provider
+ reg = {
+ "JARVIS__ACK_BRAIN__ENABLED": "true",
+ "JARVIS__ACK_BRAIN__PROVIDER": "grok",
+ }
+
+ changed = config.refresh_persisted_env_from_user_registry(read=reg.get)
+
+ assert os.environ["JARVIS__ACK_BRAIN__ENABLED"] == "true"
+ assert os.environ["JARVIS__ACK_BRAIN__PROVIDER"] == "grok"
+ assert changed["JARVIS__ACK_BRAIN__ENABLED"] == "true"
+ assert changed["JARVIS__ACK_BRAIN__PROVIDER"] == "grok"
+
+
def test_refresh_default_reader_is_noop_off_win32(monkeypatch: pytest.MonkeyPatch) -> None:
"""With no injected reader on a non-win32 platform the default reader yields
None for every key, so nothing is changed (cloud-first / Linux VPS safe)."""