diff --git a/backend/app/main_graph/nodes/hybrid_router.py b/backend/app/main_graph/nodes/hybrid_router.py index 072782a..ce1e627 100644 --- a/backend/app/main_graph/nodes/hybrid_router.py +++ b/backend/app/main_graph/nodes/hybrid_router.py @@ -219,11 +219,11 @@ def route_from_hybrid_decision(state: MainGraphState) -> str: def check_fast_path_success(state: MainGraphState) -> str: - """检查快速路径是否成功""" - if state.debug_info.get("fast_path_failed"): + """检查快速路径是否成功 - 使用新的结构化字段""" + if state.fast_path.failed: info("[Fast Path Check] 快速路径失败,升级到 React 循环") return "escalate" - + info("[Fast Path Check] 快速路径成功,进入 llm_call") return "llm_call" diff --git a/backend/app/main_graph/nodes/routing.py b/backend/app/main_graph/nodes/routing.py index dff32f5..01ce993 100644 --- a/backend/app/main_graph/nodes/routing.py +++ b/backend/app/main_graph/nodes/routing.py @@ -45,8 +45,8 @@ def route_by_reasoning(state: MainGraphState) -> str: info(f"[条件路由] step={state.reasoning_step}, phase={state.current_phase}, history={previous_actions}") - # ========== 获取推理结果 ========== - reasoning_result = state.debug_info.get("reasoning_result") + # ========== 获取推理结果 - 从新的结构化字段获取 ========== + reasoning_result = state.react_reasoning.reasoning_result latest_action = reasoning_result.action.name if reasoning_result else None # ========== 核心检查:DIRECT_RESPONSE 优先 ========== diff --git a/backend/app/main_graph/nodes/web_search.py b/backend/app/main_graph/nodes/web_search.py index d02d9da..bba819e 100644 --- a/backend/app/main_graph/nodes/web_search.py +++ b/backend/app/main_graph/nodes/web_search.py @@ -35,8 +35,8 @@ async def web_search_node(state: MainGraphState, config: Optional[RunnableConfig except Exception as e: info(f"[web_search_node] 无法发送开始事件: {e}") - # 获取搜索查询 - reasoning_result = state.debug_info.get("reasoning_result") + # 获取搜索查询 - 从新的结构化字段获取 + reasoning_result = state.react_reasoning.reasoning_result search_query = reasoning_result.metadata.get("search_query", state.user_query) if reasoning_result else state.user_query try: