From d04b79501ef03f14d636783e6262d8023e1136cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=BE=B7=E5=AE=87?= Date: Tue, 18 Aug 2026 13:54:31 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=84=E8=8C=83=20UI=20=E8=AF=AD=E4=B9=89?= =?UTF-8?q?=E5=BB=BA=E8=AE=AE=E9=94=99=E8=AF=AF=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 将 LLM 缺少工具调用、参数解析和结果校验失败统一标记为响应无效 保留详细校验原因供排障 --- .../src/ui_editor/commands/ui_design_suggestion.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/ai-game-creator-shell/src-tauri/src/ui_editor/commands/ui_design_suggestion.rs b/apps/ai-game-creator-shell/src-tauri/src/ui_editor/commands/ui_design_suggestion.rs index d8da10676..bf92132e7 100644 --- a/apps/ai-game-creator-shell/src-tauri/src/ui_editor/commands/ui_design_suggestion.rs +++ b/apps/ai-game-creator-shell/src-tauri/src/ui_editor/commands/ui_design_suggestion.rs @@ -191,17 +191,17 @@ pub(crate) async fn suggest_ui_design_semantic_impl( .find(|call| call.name == "suggest_ui_design_semantics") .ok_or_else(|| { eprintln!("ui_design_suggestion.error stage=parse_tool_call reason=missing_tool_call"); - "LLM 未返回 suggest_ui_design_semantics 工具调用".to_string() + "LLM 响应无效(详情:未返回 suggest_ui_design_semantics 工具调用)".to_string() })?; let suggestions = serde_json::from_str::(&call.arguments) .map_err(|error| { eprintln!("ui_design_suggestion.error stage=parse_arguments error={error}"); - format!("UI 语义建议工具参数无效:{error}") + format!("LLM 响应无效(详情:UI 语义建议工具参数无效:{error})") })? .ui_designs; validate_suggestions(&suggestions, &ids).map_err(|error| { eprintln!("ui_design_suggestion.error stage=validate_result error={error}"); - error + format!("LLM 响应无效(详情:{error})") })?; // TODO: future single-page policy may reject multiple Page suggestions. Ok(suggestions)