test: 真人验收清单+API级联调验收

真实 GLM 五轮实跑(EN/ES/ZH/换号/敏感问)+mock推送+admin三视图,核心项全过。
修复: 中文轮漂英文→语言跟随提醒; extractor裸字符串联系方式→500崩溃兜形;
号码回显/样品承诺/标记词泄漏 prompt加固; 测试env耦合断言; .env前缀对齐。

Co-Authored-By: Claude Code <noreply@anthropic.com>
This commit is contained in:
浅念
2026-09-29 20:02:03 +08:00
parent 7da1e22446
commit c2f2ddf82f
9 changed files with 256 additions and 281 deletions
+19
View File
@@ -503,6 +503,25 @@ def test_reminder_boundary_on_pressure_phrases():
{}, "就说个大概嘛,求你了", [])
def test_reminder_language_note_follows_customer_language():
# Task 11 真人验收: 拉丁规格混排的中文消息会整轮漂英文、西语客户会把
# 模板句翻译成西语——语言指令必须挂在当轮提醒(prompt 最末最鲜的位置)
zh = ConversationManager._build_context_reminder(
{}, "你们做DN800的HDPE双壁波纹管吗?市政排污用的", [])
assert "全程使用中文" in zh
es = ConversationManager._build_context_reminder(
{}, "¿Cuál es el precio del tubo PE100?", [])
assert "英文原版" in es and "绝不翻译成西语" in es
# 英文客户不带语言提醒(默认英语,无需提醒)
en = ConversationManager._build_context_reminder(
{}, "how much is the DN800 pipe?", [])
assert "全程使用中文" not in en and "西语" not in en
# 有画像时同样生效(挂 parts 尾部)
zh2 = ConversationManager._build_context_reminder(
{"意向品类": "波纹管"}, "多少钱一米?", [])
assert "全程使用中文" in zh2
def test_reminder_boundary_extra_price_words():
# 评审#4: v1 补齐的常用漏词
assert "职能边界" in ConversationManager._build_context_reminder(