refactor: extract order helpers and stabilize first-image ack replies

This commit is contained in:
2026-03-01 15:30:56 +08:00
parent 55e6fd51ec
commit 54b1db17a7
3 changed files with 49 additions and 62 deletions

View File

@@ -3,6 +3,7 @@ from __future__ import annotations
import asyncio
from typing import TYPE_CHECKING, Optional
from core.post_ops import record_deal_success
from core.order_helpers import parse_order_info
if TYPE_CHECKING:
from core.pydantic_ai_agent import AgentResponse, ConversationState, CustomerMessage, CustomerServiceAgent
@@ -22,7 +23,7 @@ async def handle_order_notification(
_, order_block = agent._split_customer_text(message.msg)
customer_text, _ = agent._split_customer_text(message.msg)
order = agent._parse_order_info(order_block or message.msg)
order = parse_order_info(order_block or message.msg)
pay_status = order.get("pay_status", "")
order_status = order.get("order_status", "")