refactor: unify core pipeline logging with cs_agent logger

This commit is contained in:
2026-03-01 16:29:52 +08:00
parent a6b7bf1982
commit 8dd5a11b4b
11 changed files with 82 additions and 55 deletions

View File

@@ -1,10 +1,13 @@
from __future__ import annotations
import asyncio
import logging
from typing import TYPE_CHECKING, Optional
from core.post_ops import record_deal_success
from core.order_helpers import parse_order_info
logger = logging.getLogger("cs_agent")
if TYPE_CHECKING:
from core.pydantic_ai_agent import AgentResponse, ConversationState, CustomerMessage, CustomerServiceAgent
@@ -53,9 +56,9 @@ async def handle_order_notification(
)
)
except Exception as e:
print(f"[Agent] 触发作图失败: {e}")
logger.exception("[Agent] 触发作图失败: %s", e)
elif not customer_text:
print(f"[Agent] 订单通知静默({pay_status or order_status}),跳过回复")
logger.info("[Agent] 订单通知静默(%s),跳过回复", pay_status or order_status)
return AgentResponse(reply="", should_reply=False, need_transfer=False)
return None