feat(voice_worker): the v2 brain answers in Korean unless asked for another language

The brain passes default_language (worker --reply-language, default Korean) to
the reply engine; unlike the output_language lock it gives way when the user
explicitly asks for a language. Tools get the ko code (--tool-language).

Eval evals/test_reply_language_default.py (Qwen3.6 on Strata): 6/6, English
questions answered in Korean, an explicit English request in English, and the
control without the default answers English in English.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
javis-bot
2026-11-12 10:34:12 +09:00
parent cefe9b9253
commit 7623d6d002
9 changed files with 170 additions and 25 deletions

View File

@@ -136,6 +136,20 @@ class TestReplyLanguageDirective:
directive = reply_language_directive("Korean", "melo")
assert directive is not None and "Korean" in directive
def test_default_language_gives_way_only_to_a_lock(self):
from jarvis.system_prompt import default_language_directive
directive = reply_language_directive(None, "piper", "Korean")
assert directive == default_language_directive("Korean")
assert "Korean" in directive and "explicitly asks" in directive
assert reply_language_directive("Japanese", "melo", "Korean") == output_language_directive("Japanese")
assert default_language_directive(" ") is None
assert reply_language_directive(None, "melo", None) is None
def test_default_language_hands_the_persona_language_clause_to_the_directive(self):
prompt = build_system_prompt("Jarvis", None, "Korean")
assert "in the user's language" not in prompt
assert "in the reply language" in prompt
def test_edge_is_multilingual(self):
# Edge TTS (the default Korean voice) is not English-only: no lock → the
# user's own language, and a lock is honoured (not forced to English).