调整客服自动接待和手动排队规则

This commit is contained in:
songxinnuo
2026-11-04 13:37:26 +08:00
parent efb2e5b4b4
commit ba8a7104b3
22 changed files with 1086 additions and 21 deletions
+2
View File
@@ -85,6 +85,7 @@ class DevIntegrationTests(unittest.TestCase):
def test_human_send_rejects_closed_missing_or_mismatched_conversations(self):
sid = self.session()
self.client.post('/api/human/accept', json={'sid': sid})
payload = {'sid': sid, 'side': 'customer', 'content': '不能串到其他会话'}
other_cid = self.client.post('/api/new_chat').json['id']
self.assertEqual(self.client.post('/api/human/send', json={**payload, 'conv_id': other_cid}).status_code, 409)
@@ -96,6 +97,7 @@ class DevIntegrationTests(unittest.TestCase):
def test_recall_targets_older_agent_message_and_is_idempotent(self):
sid = self.session()
self.client.post('/api/human/accept', json={'sid': sid})
for side, text in (('agent', '早先的回复'), ('customer', '客户消息'), ('agent', '最新回复')):
self.client.post('/api/human/send', json={'sid': sid, 'side': side, 'content': text})
before = self.client.get(f'/api/human/poll?sid={sid}').json['messages']