fix: 事件异常测服会话和卡片不加 [test]

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-09-21 18:35:05 +08:00
co-authored by Cursor
parent a878b046d2
commit 8afe909230
3 changed files with 19 additions and 8 deletions
+5 -6
View File
@@ -2646,9 +2646,11 @@ def event_exception_session_text(
事件异常会话两行话术。
mention=True 时姓名前加 @,多人空格拼接。小时数用后台规则值。
测服也不加 [test]:这是销售/航线/产品会话,不是运维告警。
"""
from agent.policy.event_exception import format_timeout_hours
_ = test_prefix
no = (work_order_no or "").strip() or "-"
kind = (exception_type or "").strip() or "事件异常"
hour_text = format_timeout_hours(hours)
@@ -2661,10 +2663,7 @@ def event_exception_session_text(
f"关联询价工单 {no}。{tagged}已超过 {hour_text} 工作小时 无响应,"
f"事件异常已记录工单,请及时处理。"
)
text = f"{kind}\n{body}"
if test_prefix and not text.startswith("[test]"):
return f"[test] {text}"
return text
return f"{kind}\n{body}"
def event_exception_alert_payload(
@@ -2678,13 +2677,13 @@ def event_exception_alert_payload(
事件异常通知卡:走询价消息服务,不走询价小助手。
对齐现网「询价机器人事件告警」:标题用响应异常,正文用「您已超过」。
测服标题也不加 [test];test_prefix 仅保留兼容入参。
"""
from agent.policy.event_exception import format_timeout_hours
_ = test_prefix
no = (work_order_no or "").strip() or "-"
title = (card_title or "").strip() or "事件响应异常"
if test_prefix and not title.startswith("[test]"):
title = f"[test] {title}"
hour_text = format_timeout_hours(hours)
from agent.config import get_settings