落地系统异常:大模型/TMS/建群故障停住本单并告警,后台可重试失败步骤。
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -123,6 +123,17 @@ class LandTextInquiryFlow(SeaTextInquiryFlow):
|
||||
allow_b=allow_b,
|
||||
chat_fn=chat_fn,
|
||||
)
|
||||
from agent.policy.system_exception import handle_extract_tech_fail
|
||||
|
||||
llm_phase = handle_extract_tech_fail(
|
||||
snap=snap,
|
||||
ledger=self._ledger,
|
||||
reply=reply,
|
||||
sender_id=sender_id,
|
||||
sess=sess,
|
||||
)
|
||||
if llm_phase:
|
||||
return llm_phase
|
||||
mode = (snap.get("business_line") or "").upper()
|
||||
snap_facts = dict(snap.get("facts") or {})
|
||||
facts = dict(snap_facts)
|
||||
@@ -308,7 +319,11 @@ class LandTextInquiryFlow(SeaTextInquiryFlow):
|
||||
) or ""
|
||||
self._wait_inquiry_sent(str(out_id), work_order_no=no)
|
||||
|
||||
tms = self._ledger.query_tms(work_order_no=no, facts=facts, business_line="LAND")
|
||||
from agent.policy.system_exception import query_tms_resilient
|
||||
|
||||
tms = query_tms_resilient(
|
||||
self._ledger, work_order_no=no, facts=facts, business_line="LAND"
|
||||
)
|
||||
sess = FlowSession(
|
||||
sender_id=sender_id,
|
||||
thread_id=sender_id,
|
||||
@@ -335,7 +350,11 @@ class LandTextInquiryFlow(SeaTextInquiryFlow):
|
||||
reply(copy.LAND_CONFIRM_EXPIRED)
|
||||
return "land_confirm_expired"
|
||||
reply(copy.LAND_TMS_RETRYING.format(wo=no))
|
||||
tms = self._ledger.query_tms(work_order_no=no, facts=facts, business_line="LAND")
|
||||
from agent.policy.system_exception import query_tms_resilient
|
||||
|
||||
tms = query_tms_resilient(
|
||||
self._ledger, work_order_no=no, facts=facts, business_line="LAND"
|
||||
)
|
||||
return self._apply_land_tms(sess=sess, tms=tms, reply=reply, retrying=True)
|
||||
|
||||
def _apply_land_tms(
|
||||
@@ -350,6 +369,18 @@ class LandTextInquiryFlow(SeaTextInquiryFlow):
|
||||
_ = retrying
|
||||
no = (sess.work_order_no or "").strip()
|
||||
if not tms.get("ok"):
|
||||
from agent.policy.system_exception import confirm_tms_quote_if_tech
|
||||
|
||||
if confirm_tms_quote_if_tech(
|
||||
ledger=self._ledger,
|
||||
reply=reply,
|
||||
work_order_no=no,
|
||||
tms=tms,
|
||||
sender_id=sess.sender_id,
|
||||
ticket_status="询价中",
|
||||
):
|
||||
self.drop_current_bookmark(sess.sender_id)
|
||||
return "system_exception"
|
||||
reply("TMS 查询失败,请稍后重试。工单已创建:" + no)
|
||||
sess.phase = "tms_tech"
|
||||
self._save(sess)
|
||||
|
||||
Reference in New Issue
Block a user