fix(voice): race slow streaming asr finalize

This commit is contained in:
Yera All
2026-04-19 01:06:03 +05:00
parent a44a1b97a1
commit 77df41bce0
4 changed files with 317 additions and 34 deletions
+13
View File
@@ -1546,6 +1546,19 @@ def test_voice_postprocess_reply_rewrites_midcall_greeting_with_followup_questio
assert "о чем именно" not in normalized
def test_voice_reply_with_name_strips_midcall_greeting_and_does_not_double_prefix():
reply_text = voice_module._voice_reply_with_name(
"ru",
"Здравствуйте, Ернур! Чтобы уточнить график работы, назовите город или филиал.",
"Ернур",
)
normalized = reply_text.lower()
assert reply_text.startswith("Ернур, Чтобы уточнить")
assert normalized.count("ернур") == 1
assert "здравствуйте" not in normalized
def test_voice_postprocess_reply_reuses_active_topic_after_frustration_turn():
reply_text = voice_module._voice_postprocess_reply_text(
language="ru",