智能体按 reply_code 读后台回复语;陆运整车报价单顶栏色与填表更稳,工单页展示同步收紧。
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -418,21 +418,21 @@ class AirTextInquiryFlow:
|
||||
hit.business_line = str(view.get("business_line") or "").strip().upper()
|
||||
if hit is None:
|
||||
if not callable(getter):
|
||||
reply(f"找不到工单 {no},请核对工单号后再试。")
|
||||
reply(copy.continue_ticket_not_found(no))
|
||||
return "ticket_missing"
|
||||
if not view.get("found"):
|
||||
reply(f"找不到工单 {no},请核对工单号后再试。")
|
||||
reply(copy.continue_ticket_not_found(no))
|
||||
return "ticket_missing"
|
||||
line = str(view.get("business_line") or "").strip().upper()
|
||||
owner = self._handoff_owner_for_line(line)
|
||||
if owner is None:
|
||||
reply(copy.ASK_TRANSPORT)
|
||||
reply(copy.ask_transport())
|
||||
return "need_mode"
|
||||
hit = owner._session_from_ledger(sender_id=sender_id, view=view)
|
||||
line = (hit.business_line or "").strip().upper()
|
||||
owner = self._handoff_owner_for_line(line)
|
||||
if owner is None:
|
||||
reply(copy.ASK_TRANSPORT)
|
||||
reply(copy.ask_transport())
|
||||
return "need_mode"
|
||||
logger.info(
|
||||
"handoff.named wo=%s line=%s phase=%s chat=%s",
|
||||
@@ -474,7 +474,7 @@ class AirTextInquiryFlow:
|
||||
mode = (sess.business_line if sess else "") or detect_transport_mode(text) or ""
|
||||
mode = (mode or "").upper()
|
||||
if not mode:
|
||||
reply(copy.ASK_TRANSPORT)
|
||||
reply(copy.ask_transport())
|
||||
self._save(
|
||||
FlowSession(
|
||||
sender_id=sender_id,
|
||||
@@ -538,7 +538,7 @@ class AirTextInquiryFlow:
|
||||
sess.business_line = "SEA"
|
||||
line = (sess.business_line or "").upper()
|
||||
if has_collab_group(sess):
|
||||
reply(copy.HANDOFF_ALREADY_COLLAB)
|
||||
reply(copy.already_collab())
|
||||
return "handoff_already"
|
||||
why = copy.HANDOFF_CLARIFY_REASON if reason == "clarify" else copy.HANDOFF_INTENT_REASON
|
||||
if line == "AIR":
|
||||
@@ -711,7 +711,7 @@ class AirTextInquiryFlow:
|
||||
"""
|
||||
no = (work_order_no or "").strip().upper()
|
||||
if not no:
|
||||
reply("请告诉我要继续的工单号,例如 WO202609140034。")
|
||||
reply(copy.continue_need_wo())
|
||||
return "need_work_order"
|
||||
with self._lock:
|
||||
sess = self._by_ticket.get(no)
|
||||
@@ -730,11 +730,11 @@ class AirTextInquiryFlow:
|
||||
return self._replay_wait(keep, reply, source="session")
|
||||
getter = getattr(self._ledger, "get_for_agent", None)
|
||||
if not callable(getter):
|
||||
reply(f"找不到工单 {no},请核对工单号后再试。")
|
||||
reply(copy.continue_ticket_not_found(no))
|
||||
return "ticket_missing"
|
||||
view = getter(work_order_no=no, sender_id=sender_id) or {}
|
||||
if not view.get("found"):
|
||||
reply(f"找不到工单 {no},请核对工单号后再试。")
|
||||
reply(copy.continue_ticket_not_found(no))
|
||||
return "ticket_missing"
|
||||
if view.get("owned") is False:
|
||||
reply("这张工单不属于当前账号,不能继续。")
|
||||
@@ -879,7 +879,7 @@ class AirTextInquiryFlow:
|
||||
if sess.phase == "wait_file":
|
||||
self._refresh_wait_file(sess)
|
||||
if sess.phase == "wait_file":
|
||||
reply("报价单正在生成,请稍候。")
|
||||
reply(copy.quote_generating())
|
||||
return "wait_file"
|
||||
if sess.phase == "wait_deal":
|
||||
# 成交卡已经绑在报价文件那条出站上。只续办、没说成交结果时不再另发一张卡。
|
||||
@@ -964,9 +964,8 @@ class AirTextInquiryFlow:
|
||||
reply=reply,
|
||||
sess=sess,
|
||||
)
|
||||
if (not sess or sess.phase != "wait_confirm") and looks_like_confirm(text) and not sess:
|
||||
reply(copy.AIR_CONFIRM_EXPIRED)
|
||||
return "confirm_expired"
|
||||
# 核对卡不再设时效。没有待确定会话时不当成「已过期」,
|
||||
# 让本句按新询价走,避免正文里的「确认」误伤。
|
||||
sess = self._detach_ticketed_for_new_inquiry(sess)
|
||||
|
||||
snap = extract_inquiry_snapshot(
|
||||
@@ -1006,7 +1005,7 @@ class AirTextInquiryFlow:
|
||||
)
|
||||
|
||||
if not mode:
|
||||
reply(copy.ASK_TRANSPORT)
|
||||
reply(copy.ask_transport())
|
||||
self._save(
|
||||
FlowSession(
|
||||
sender_id=sender_id,
|
||||
@@ -1055,7 +1054,7 @@ class AirTextInquiryFlow:
|
||||
chat_fn=chat_fn,
|
||||
inbound_raw=inbound_raw,
|
||||
)
|
||||
reply(copy.ASK_TRANSPORT)
|
||||
reply(copy.ask_transport())
|
||||
return "need_mode"
|
||||
|
||||
if is_waiting_mode_session(sess):
|
||||
|
||||
Reference in New Issue
Block a user