diff --git a/gateway/config.py b/gateway/config.py index 0103f891f2c..1c7735a6ed7 100644 --- a/gateway/config.py +++ b/gateway/config.py @@ -927,6 +927,8 @@ def load_gateway_config() -> GatewayConfig: stt_cfg = yaml_cfg.get("stt") if isinstance(stt_cfg, dict): gw_data["stt"] = stt_cfg + if "stt_echo_transcripts" in yaml_cfg: + gw_data["stt_echo_transcripts"] = yaml_cfg["stt_echo_transcripts"] if "group_sessions_per_user" in yaml_cfg: gw_data["group_sessions_per_user"] = yaml_cfg["group_sessions_per_user"] diff --git a/tests/gateway/test_stt_transcript_echo_config.py b/tests/gateway/test_stt_transcript_echo_config.py index 52d5c26ebc6..4fd3649c9ec 100644 --- a/tests/gateway/test_stt_transcript_echo_config.py +++ b/tests/gateway/test_stt_transcript_echo_config.py @@ -1,7 +1,7 @@ from pathlib import Path from types import SimpleNamespace -from gateway.config import GatewayConfig +from gateway.config import GatewayConfig, load_gateway_config from gateway.run import GatewayRunner @@ -29,6 +29,18 @@ def test_top_level_stt_echo_transcripts_takes_precedence(): assert cfg.stt_echo_transcripts is False +def test_load_gateway_config_honors_top_level_stt_echo_transcripts(monkeypatch, tmp_path): + monkeypatch.setenv("HERMES_HOME", str(tmp_path)) + (tmp_path / "config.yaml").write_text( + "stt:\n echo_transcripts: true\nstt_echo_transcripts: false\n", + encoding="utf-8", + ) + + cfg = load_gateway_config() + + assert cfg.stt_echo_transcripts is False + + def test_gateway_runner_uses_stt_echo_transcripts_flag(): runner = GatewayRunner.__new__(GatewayRunner)