修复(AI客服): 退款操作统一转人工处理
隐藏并拦截退款类业务动作,兼容旧确认流程,确保所有客户类型的退款请求进入人工支持,并补充回归测试。
This commit is contained in:
@@ -178,3 +178,22 @@ func TestKnowledgeFallbackAllowsOrdinaryAutonomousAnswers(t *testing.T) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestRefundPolicyAppliesToEveryCustomerSegment(t *testing.T) {
|
||||
for _, customerType := range []string{"card", "device", "mall_user", ""} {
|
||||
t.Run(customerType, func(t *testing.T) {
|
||||
engine := NewAgentLoopEngine()
|
||||
engine.retrieve = nil
|
||||
engine.history = nil
|
||||
turn := engine.prepareTurn(context.Background(), RunInput{
|
||||
Conversation: models.Conversation{CustomerType: customerType},
|
||||
UserMessage: models.Message{Content: "我要退款,我已经确认了"},
|
||||
}, nil)
|
||||
for _, want := range []string{"退款必须由人工客服处理", "即使客户明确授权或确认也不允许", "不得进入退款确认流程", "人工客服", "客户仅查询退款政策或进度时", "Refund requests are human-only", "available permitted write operation"} {
|
||||
if !strings.Contains(turn.SystemPrompt, want) {
|
||||
t.Fatalf("refund policy missing %q", want)
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user