Move caller dialog to Sonnet 4.6, add SearXNG for Devon, and fix stale model ids

Working-tree changes that had accumulated without being committed. The test
updates matter most: tests/test_caller_gen.py was left behind when caller_gen
started requiring voice and age in regulars_included, so the committed tree had
a failing suite that only passed locally.

- Caller dialog moves from Haiku 4.5 to Sonnet 4.6 (~$1/show to ~$3-4/show)
- Grok pinned to x-ai/grok-4.3; grok-4, grok-4-fast and grok-4.1-fast were
  retired from OpenRouter, and llm.py swallows the 404 and returns empty text,
  so a retired id makes callers go silent with nothing in the logs
- Devon's web_search now runs against SearXNG on the NAS
- Assorted TTS, audio, news, cost tracker and control-panel changes
- CLAUDE.md updated to match

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
2026-08-14 04:21:55 -05:00
co-authored by Claude Opus 5
parent 2901e5f4fb
commit 44ef13336e
21 changed files with 731 additions and 186 deletions
+10 -3
View File
@@ -63,8 +63,15 @@ def test_resolve_voice_case_insensitive():
def test_resolve_voice_falls_back_when_no_match():
from backend.services.caller_gen import resolve_voice
roster = ["Marcus", "Dennis"]
# Deterministic fallback: return first from roster
assert resolve_voice("Santiago", roster) == "Marcus"
# Random fallback, so hallucinated voices don't all collapse onto roster[0]
assert resolve_voice("Santiago", roster) in roster
def test_resolve_voice_fallback_spreads_across_roster():
from backend.services.caller_gen import resolve_voice
roster = ["Marcus", "Dennis", "Priya", "Edward"]
picked = {resolve_voice("Santiago", roster) for _ in range(60)}
assert len(picked) > 1, "fallback collapsed onto a single voice"
def test_resolve_voice_empty_suggestion_falls_back():
@@ -103,7 +110,7 @@ def test_build_batch_prompt_includes_silas_lore_when_present():
"weather": "...",
"headlines": [],
"recent_caller_summaries": [],
"regulars_included": [{"name": "Silas", "lore": "Silas leads a small desert cult...", "arc_state": "seeking new members"}],
"regulars_included": [{"name": "Silas", "voice": "Sebastian", "age": 52, "lore": "Silas leads a small desert cult...", "arc_state": "seeking new members"}],
"caller_count": 12,
"voice_roster": ["Marcus"],
}