From d0a7c8ed252fb1544158d9559f8fee01b8bf7db5 Mon Sep 17 00:00:00 2001 From: kdletters Date: Wed, 2 Sep 2026 17:52:24 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20Agent=20Runtime=20?= =?UTF-8?q?=E9=94=81=E7=AD=89=E5=BE=85=E7=AB=9E=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 延长运行时任务锁的有界等待窗口。 避免慢速磁盘或 CI 负载下误报 Agent 正在执行。 --- .../src-tauri/src/agent/runtime_state.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/apps/ai-game-creator-shell/src-tauri/src/agent/runtime_state.rs b/apps/ai-game-creator-shell/src-tauri/src/agent/runtime_state.rs index 938f4f82e..30fb3866c 100644 --- a/apps/ai-game-creator-shell/src-tauri/src/agent/runtime_state.rs +++ b/apps/ai-game-creator-shell/src-tauri/src/agent/runtime_state.rs @@ -2403,13 +2403,17 @@ pub(super) fn try_acquire_game_creator_agent_runtime_task_lock_with_wait( root: &Path, agent_id: &str, ) -> Result, String> { - for attempt in 0..25 { + // Runtime state transitions can persist several audit projections while holding + // the lane lock. Keep the wait bounded, but allow a slow CI/disk-backed + // transition to finish before reporting a false busy error. + const MAX_ATTEMPTS: usize = 100; + for attempt in 0..MAX_ATTEMPTS { if let Some(runtime_lock) = try_acquire_game_creator_agent_runtime_task_lock(root, agent_id)? { return Ok(Some(runtime_lock)); } - if attempt < 24 { + if attempt + 1 < MAX_ATTEMPTS { std::thread::sleep(Duration::from_millis(10)); } }