落地海运协同群:测服靠会话存档听群话,报价单能带上协同字段。
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -68,12 +68,17 @@ def _wrap_card(message: InboundMessage) -> None:
|
||||
from agent.policy import inquiry_copy as copy
|
||||
|
||||
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.chat_id:
|
||||
payload["chat_id"] = message.chat_id
|
||||
payload["chat_type"] = message.chat_type
|
||||
card_action.handle_card_action(
|
||||
sender_id=message.sender_id,
|
||||
thread_id="",
|
||||
wait_version=0,
|
||||
action=action or "unknown",
|
||||
payload=dict(message.raw or {}),
|
||||
payload=payload,
|
||||
)
|
||||
|
||||
|
||||
@@ -136,6 +141,17 @@ def dispatch_inbound(message: InboundMessage, decision: RouteDecision) -> str:
|
||||
副作用:仅 handler 内产生;本函数不做业务。
|
||||
"""
|
||||
if (message.chat_type or "") == "group":
|
||||
from agent.policy import inquiry_copy as copy
|
||||
|
||||
event = str((message.raw or {}).get("event") or "").lower()
|
||||
action = copy.canonical_button(message.content or "")
|
||||
if event in {"template_card_event", "click", "templatecardevent"} or action in {
|
||||
copy.BTN_DEAL,
|
||||
copy.BTN_LOST,
|
||||
copy.BTN_NEGOTIATE,
|
||||
}:
|
||||
_wrap_card(message)
|
||||
return "card_action"
|
||||
phase = handle_group_collab(message)
|
||||
logger.info("dispatch group_collab phase=%s chat=%s", phase, message.chat_id)
|
||||
return "group_collab"
|
||||
|
||||
Reference in New Issue
Block a user