转人工协同按运输方式各自落地:海运说转人工直接建正式单建群发摘要和空白表,陆运先选业务类型和报价场景再建群,空运先落正式单让销售把工单号发进原群,转人工后群里报价不再被当成冻结单拦住。产品报价只发摘要和成交卡,要 Excel/PDF 说「生成报价单」再出,多段逐段出、没价出空白表,出表后补推成交跟进不涨版本、不重置等待计时。结束询价口令不再进模型,直接清上下文。卡片回执按本次入站消息号去重,第二次点提交不会再被静默吞掉。陆转人工按选定模板名直取,避免陆运七种业务靠关键词猜错;空运舱位只回一条时直接出价,TMS 分桶费用落到对应段。后台工单补需求字段与模板预览样例,新增 AIR_NEED_WO 回复语、协同模式、陆运岗位与陆运超时卡迁移脚本;测服文档改为独立企微应用 1000015。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
linmianxun
2026-11-19 14:07:52 +08:00
co-authored by Cursor
parent b878a094b5
commit b3637f3fc4
84 changed files with 9293 additions and 572 deletions
+18
View File
@@ -13,6 +13,7 @@ from typing import Callable, Optional
from agent.channel.wecom.models import InboundMessage
from agent.handlers import abnormal, card_action, close_deal, continue_thread, new_inquiry
from agent.handlers.echo_text import handle_echo_text
from agent.handlers.end_inquiry import handle_end_inquiry
from agent.handlers.group_collab import handle_group_collab
from agent.handlers.image_inquiry import handle_image_inquiry
from agent.handlers.attachment_inquiry import handle_attachment_inquiry
@@ -87,6 +88,11 @@ def _wrap_card(message: InboundMessage) -> None:
action = copy.canonical_button(message.content or "") or (message.content or "").strip()
payload = dict(message.raw or {})
payload.setdefault("event_key", message.content or "")
# 本次点击的入站消息号:出一张卡会被反复点,回执去重必须按「这一次点击」算,
# 不能只按工单+动作+正文,否则第二次点提交会被当成重复消息静默吞掉
# (销售看到按钮已置灰却收不到任何回复)。
if message.message_id:
payload.setdefault("inbound_msg_id", message.message_id)
if message.chat_id:
payload["chat_id"] = message.chat_id
payload["chat_type"] = message.chat_type
@@ -111,6 +117,11 @@ def _wrap_abnormal(message: InboundMessage) -> None:
abnormal.handle_abnormal(sender_id=message.sender_id, inquiry_no="", reason="dispatch")
def _wrap_end_inquiry(message: InboundMessage) -> None:
"""结束/终止询价:清上下文,允许新开。"""
handle_end_inquiry(message)
def _wrap_route_failed(message: InboundMessage) -> None:
"""模型没给出路由结论:请销售再说一次,不假装听懂。"""
from agent.channel.queue import get_message_store
@@ -169,6 +180,7 @@ HANDLER_REGISTRY: dict[str, HandlerFn] = {
"continue_thread": _wrap_continue,
"card_action": _wrap_card,
"close_deal": _wrap_close,
"end_inquiry": _wrap_end_inquiry,
"abnormal": _wrap_abnormal,
"reject_no_sender": _noop,
"ignore_empty": _noop,
@@ -263,6 +275,12 @@ def dispatch_inbound(message: InboundMessage, decision: RouteDecision) -> str:
handle_image_inquiry(message)
return "image_inquiry"
if kind in {"text", ""}:
from agent.policy import inquiry_copy as copy
# 结束询价优先于附件/图片波次并字:否则「结束询价」会被当成补字段。
if copy.looks_like_end_inquiry(message.content or ""):
handle_end_inquiry(message)
return "end_inquiry"
from agent.handlers.attachment_inquiry import (
abandon_idle_attach_wait,
append_attach_text,