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.
This commit is contained in:
javis-bot
2026-06-15 16:57:01 +09:00
parent 8868381f13
commit b3088dd75f

View File

@@ -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: