fix: honor top-level STT transcript echo config

This commit is contained in:
devatnull 2026-07-05 10:54:00 +03:00 committed by Teknium
parent 406eb719c3
commit 4be749d151
2 changed files with 15 additions and 1 deletions

View file

@ -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"]

View file

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