fix: 已出号后新一轮询价不带上一单字段

点名海运时丢掉旧陆运补问草稿,避免补字段误发填写样例图。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-09-20 18:27:13 +08:00
co-authored by Cursor
parent b3b3cf2903
commit 19acbb9156
8 changed files with 256 additions and 9 deletions
+8 -1
View File
@@ -99,6 +99,8 @@ class SeaTextInquiryFlow(AirTextInquiryFlow):
adjusted = try_private_adjust(self, sess, text, reply)
if adjusted:
return adjusted
# 上一单已出号:新一轮从本句重收,禁止把旧贸易条款/分类带进下一张工单。
sess = self._detach_ticketed_for_new_inquiry(sess)
snap = extract_inquiry_snapshot(
text,
@@ -139,6 +141,8 @@ class SeaTextInquiryFlow(AirTextInquiryFlow):
if mode == "LAND":
from agent.policy.land_text_flow import get_land_text_flow
# 本句已是陆运:丢掉海运补问草稿,避免下一句又被海运吃掉。
self.drop_current_bookmark(sender_id)
return get_land_text_flow().on_text(
sender_id=sender_id,
text=text,
@@ -153,6 +157,7 @@ class SeaTextInquiryFlow(AirTextInquiryFlow):
# 空运交给空运 Owner,避免海运流程半做空运
from agent.policy.air_text_flow import get_air_text_flow
self.drop_current_bookmark(sender_id)
return get_air_text_flow().on_text(
sender_id=sender_id,
text=text,
@@ -165,9 +170,11 @@ class SeaTextInquiryFlow(AirTextInquiryFlow):
inbound_raw=inbound_raw,
)
from agent.schema.sea_options import harvest_sea_class
from agent.schema.sea_options import drop_invented_door_trade_terms, harvest_sea_class
facts = harvest_sea_class(text, facts)
# 旧陆运/补问草稿可能把「门到门」塞进贸易条款;原话没写条款则丢掉。
facts = drop_invented_door_trade_terms(text, facts)
check = validate_required_fields(facts=facts, business_line="SEA")
facts = dict(check["facts"])
tms_ready = assemble_sea_query(facts)