diff --git a/backend/app/agent/agent_service.py b/backend/app/agent/agent_service.py index e5127b9..8984536 100644 --- a/backend/app/agent/agent_service.py +++ b/backend/app/agent/agent_service.py @@ -177,6 +177,14 @@ class AIAgentService: message_chunk, metadata = chunk["data"] node_name = metadata.get("langgraph_node", "unknown") info(f"📨 处理消息chunk, node: {node_name}") + # 详细记录消息内容,看看这些 chunk 到底是什么 + if hasattr(message_chunk, "content"): + content_preview = str(message_chunk.content)[:200] + info(f"📄 消息内容预览 ({len(content_preview)} chars): {repr(content_preview)}") + if hasattr(message_chunk, "type"): + info(f"📋 消息类型: {message_chunk.type}") + if hasattr(message_chunk, "tool_calls"): + info(f"🔧 包含工具调用: {message_chunk.tool_calls}") # 检测节点变化,发送节点开始事件 if node_name != current_node: