feat: web switch for her inner voice (Dolphin/3090 | Qwen-32B/MI50 | Off)

Her introspection (reflect/think) voice is now switchable live from the web
settings, read each cycle by the dream loop — so Brian can flip it off the 3090
before gaming without touching config or restarting.

- memory: runtime key/value settings table + get_setting/set_setting.
- self_state: INTROSPECTION_MODES (dolphin=local/dolphin3:8b, mi50=Qwen-32B,
  off=paused) + introspection_target()/set_introspection_mode(); default "dolphin".
  reflect() resolves from the live setting and SKIPS entirely when off.
- thoughts.think(): same resolution + skip-when-off.
- server: GET/POST /settings/introspection.
- index.html: "Inner Voice (introspection)" selector in Settings, applies instantly.
- tests: routing (dolphin/mi50), off-skip for think + reflect. Suite 77, ruff clean.

Default = Dolphin on the 3090 (richer voice). Flip to MI50 or Off in Settings
before gaming — that was the GPU-contention culprit.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-06-22 19:16:35 +00:00
parent a705e573a9
commit a7966e4bab
7 changed files with 139 additions and 8 deletions
+16 -3
View File
@@ -275,10 +275,10 @@ def test_ping_salience_floor_is_optional(lyra, monkeypatch):
assert th.maybe_ping(1, "hey", 0.8) is True
def test_think_routes_to_introspection_backend(lyra, monkeypatch):
def test_think_routes_to_selected_voice(lyra, monkeypatch):
from lyra import self_state
_, th, box = lyra
monkeypatch.setenv("INTROSPECTION_BACKEND", "local")
monkeypatch.setenv("INTROSPECTION_MODEL", "dolphin3:8b")
self_state.set_introspection_mode("dolphin")
seen = {}
def cap(messages, backend="local", model=None):
@@ -290,6 +290,19 @@ def test_think_routes_to_introspection_backend(lyra, monkeypatch):
th.think(force_mode="new")
assert seen["backend"] == "local" and seen["model"] == "dolphin3:8b"
self_state.set_introspection_mode("mi50") # gaming-safe: Qwen-32B on the MI50
th.think(force_mode="new")
assert seen["backend"] == "mi50" and seen["model"] is None
def test_think_skipped_when_introspection_off(lyra):
from lyra import self_state
_, th, box = lyra
self_state.set_introspection_mode("off")
_gen(box, content="should not be generated")
assert th.think(force_mode="new") is None # paused -> no thought, no LLM call
assert th.list_threads() == []
def test_no_ping_without_ntfy(lyra, monkeypatch):
_, th, _ = lyra