From 8beade5b4df81fddc792b480129d444cb91f8baf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=BE=B7=E5=AE=87?= Date: Sat, 12 Sep 2026 13:13:56 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=BA=E4=B8=9A=E5=8A=A1=E6=A0=A1=E9=AA=8C?= =?UTF-8?q?=E9=87=8D=E8=AF=95=E5=A2=9E=E5=8A=A0=E9=80=80=E9=81=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 校验失败重试复用请求错误的递增等待并记录日志 --- .../src-tauri/src/ui_editor/commands/utils.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/apps/ai-game-creator-shell/src-tauri/src/ui_editor/commands/utils.rs b/apps/ai-game-creator-shell/src-tauri/src/ui_editor/commands/utils.rs index fe38199ab..d432c09e1 100644 --- a/apps/ai-game-creator-shell/src-tauri/src/ui_editor/commands/utils.rs +++ b/apps/ai-game-creator-shell/src-tauri/src/ui_editor/commands/utils.rs @@ -64,6 +64,16 @@ where match validator(&value) { Ok(()) => return Ok(value), Err(error) if attempt < max_retries => { + app_log!( + "ui_editor.llm.retry validation_error attempt={} max_retries={} error={}", + attempt + 1, + max_retries, + error + ); + tokio::time::sleep(std::time::Duration::from_millis( + 200 * (attempt as u64 + 1), + )) + .await; let serialized = serde_json::to_string(&value) .map_err(|serialize_error| format!("序列化修复反馈失败:{serialize_error}"))?; history.push(LlmMessage::system(format!(