From b3088dd75f632766e5a0cae4a40bc96b6a0e8e68 Mon Sep 17 00:00:00 2001 From: javis-bot Date: Mon, 15 Jun 2026 16:57:01 +0900 Subject: [PATCH] fix: settings output_language overrides the compose env default The settings-UI output_language was ignored because the OUTPUT_LANGUAGE env took precedence. Read the config value first, fall back to env, so changing the language in /settings actually applies. --- src/jarvis/reply/engine.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/jarvis/reply/engine.py b/src/jarvis/reply/engine.py index 48098b8..2052bae 100644 --- a/src/jarvis/reply/engine.py +++ b/src/jarvis/reply/engine.py @@ -1696,8 +1696,10 @@ def run_reply_engine(db: "Database", cfg, tts: Optional[Any], # Placed at the FRONT (after the persona header) so a small model gives # it primacy over the persona's "use the user's language" lines — a tail # instruction loses to those when the query itself is in another language. + # Settings-UI value (config) wins over the compose OUTPUT_LANGUAGE env so + # changing the language in the settings page actually takes effect. _lang_directive = reply_language_directive( - os.environ.get("OUTPUT_LANGUAGE") or _extra_config("output_language", ""), + _extra_config("output_language", "") or os.environ.get("OUTPUT_LANGUAGE"), getattr(cfg, "tts_engine", "piper"), ) if _lang_directive: