feat: enforce full AI outbound generation and reduce template replies

This commit is contained in:
2026-03-02 11:09:26 +08:00
parent 6433708597
commit 9d0276be41
5 changed files with 415 additions and 34 deletions

View File

@@ -432,6 +432,31 @@ class RegressionPipelineTest(unittest.IsolatedAsyncioTestCase):
self.assertTrue(resp.should_reply)
self.assertIn(resp.reply, ("嗯咯", "嗯啦", "", ""))
async def test_meaningless_short_text_not_ping_when_collecting(self):
agent = CustomerServiceAgent()
st = agent._get_conversation_state(self.customer_id)
st.pending_image_urls = ["https://img.alicdn.com/a.jpg"]
st.quote_phase = "collecting"
agent._sync_pending_quote_state(self.customer_id, st)
msg = CustomerMessage(
msg_id="m-meaningless-collecting",
acc_id="test_shop",
msg="好的",
from_id=self.customer_id,
from_name="t",
cy_id=self.customer_id,
acc_type="AliWorkbench",
msg_type=0,
cy_name="t",
goods_name="专业找图",
goods_order="",
)
resp = await agent.process_message(msg)
self.assertTrue(resp.should_reply)
self.assertTrue((resp.reply or "").strip())
self.assertNotIn(resp.reply, ("嗯咯", "嗯啦", "", ""))
def tearDown(self):
db.clear_pending_quote_state(self.customer_id)