checkpoint: 提交当前工作区代码(同义词配置初版 + 既有流程改动)
- 新增 inq_synonym 表、62组同义词种子与智能体只读接口 - Python 同义词加载/归一化与 1板/2箱 机读 - 同步当前分支既有协作、报价识别、陆运等改动
This commit is contained in:
@@ -26,18 +26,39 @@ os.environ.setdefault("LEDGER_BACKEND", "memory")
|
||||
from agent.channel.wecom.models import InboundMessage
|
||||
from agent.policy import inquiry_copy as copy
|
||||
from agent.redis_coord.group_bot import (
|
||||
allow_archive_retry,
|
||||
bot_text_handled,
|
||||
clear_at_burst,
|
||||
clear_active_work_order,
|
||||
get_active_work_order,
|
||||
in_at_burst,
|
||||
is_group_bot,
|
||||
mark_at_burst,
|
||||
mark_bot_text_handled,
|
||||
mark_group_bot,
|
||||
)
|
||||
from agent.routing.decision import RouteDecision
|
||||
from agent.routing.dispatch import dispatch_inbound
|
||||
|
||||
|
||||
class BotTextDedupTests(unittest.TestCase):
|
||||
"""同群不同人发同一句不是重复消息(2026-11-23 真机 WO202611230017)。"""
|
||||
|
||||
def test_same_text_different_sender_not_deduped(self) -> None:
|
||||
chat = "wr_dedup_sender_diff"
|
||||
mark_bot_text_handled(chat, "WO1 USD11/kg, TH、11月23日", "u_lin")
|
||||
self.assertTrue(bot_text_handled(chat, "WO1 USD11/kg, TH、11月23日", "u_lin"))
|
||||
# 吴季林再发同一句:指纹不同,必须照常处理,不能被静默吞掉。
|
||||
self.assertFalse(bot_text_handled(chat, "WO1 USD11/kg, TH、11月23日", "u_wu"))
|
||||
|
||||
def test_archive_retry_still_releases_same_sender(self) -> None:
|
||||
chat = "wr_dedup_retry_same"
|
||||
mark_bot_text_handled(chat, "WO1 成交", "u_lin")
|
||||
self.assertTrue(bot_text_handled(chat, "WO1 成交", "u_lin"))
|
||||
allow_archive_retry(chat, "WO1 成交", "u_lin")
|
||||
self.assertFalse(bot_text_handled(chat, "WO1 成交", "u_lin"))
|
||||
|
||||
|
||||
def _msg(
|
||||
*,
|
||||
chat_id: str,
|
||||
|
||||
Reference in New Issue
Block a user