落地转人工:三次补问或明确接管后出入口,真正转人工后冻结本票并允许新开询价。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-09-20 16:42:13 +08:00
co-authored by Cursor
parent 26dd5d72a1
commit 7eedf28e8d
23 changed files with 1499 additions and 132 deletions
@@ -30,6 +30,7 @@ from agent.policy.air_text_flow import get_air_text_flow
from agent.policy.sea_group_ops import (
capture_group_lost_reason,
group_client_of,
is_handoff_ticket,
send_group_text,
ticket_view,
)
@@ -112,6 +113,12 @@ def handle_air_group(
return "duplicate_inbound"
mark_air_text(chat_id=chat_id, sender_id=message.sender_id, text=text)
wo = copy.extract_work_order_no(text)
if wo:
from agent.policy.handoff_human import try_commit_air_group_handoff
handed = try_commit_air_group_handoff(engine, chat_id=chat_id, work_order_no=wo)
if handed:
return handed
intent = classify_air_group_text(text, injected=injected_intent)
logger.info(
"air_group 文字 chat=%s sender=%s intent=%s wo=%s",
@@ -138,6 +145,9 @@ def handle_air_group(
)
if ticket is None:
return phase
if is_handoff_ticket(ticket):
logger.info("air_group 转人工不再跟 chat=%s", chat_id)
return "handoff_ignore"
if intent == INTENT_ACTIVATE:
return phase
else:
@@ -145,6 +155,9 @@ def handle_air_group(
if ticket is None:
send_group_text(group_client_of(engine), chat_id, copy.air_need_work_order())
return "need_work_order"
if is_handoff_ticket(ticket):
logger.info("air_group 转人工不再跟 chat=%s", chat_id)
return "handoff_ignore"
return _handle_bound(
engine,
message,
@@ -177,6 +190,9 @@ def _handle_file(engine, message: InboundMessage) -> str:
if ticket is None:
send_group_text(group_client_of(engine), chat_id, copy.air_need_work_order())
return "need_work_order"
if is_handoff_ticket(ticket):
logger.info("air_group 转人工不再跟 chat=%s", chat_id)
return "handoff_ignore"
return apply_air_file(
flow=engine,
ticket=ticket,