From e04075fd957e12efc2689d6554fda4d6bbf43374 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 02:07:02 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=BA=E5=88=86=E7=A6=BB=E6=A8=A1=E5=9E=8B?= =?UTF-8?q?=E8=AF=B7=E6=B1=82=E5=A2=9E=E5=8A=A0=E9=87=8D=E8=AF=95=E9=80=80?= =?UTF-8?q?=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 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 5111aadd8..fe38199ab 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 @@ -55,6 +55,8 @@ where max_retries, error ); + tokio::time::sleep(std::time::Duration::from_millis(200 * (attempt as u64 + 1))) + .await; continue; } Err(error) => return Err(error), @@ -71,7 +73,7 @@ where Err(error) => return Err(error), } } - Err("LLM 修复重试流程未产生结果".to_string()) + unreachable!("重试循环在最后一次尝试时始终返回结果") } pub(crate) fn parse_limited_llm_tool_arguments(