From d8a167e0f3bea4e58626f2c01564c832dcfe1da1 Mon Sep 17 00:00:00 2001 From: Linghong Date: Tue, 15 Sep 2026 18:33:37 +0000 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=AD=96=E5=88=92=E9=A1=B9?= =?UTF-8?q?=E7=9B=AE=E9=A6=96=E6=9D=A1=E5=AF=B9=E8=AF=9D=E4=BF=9D=E5=AD=98?= =?UTF-8?q?=E9=94=81=E7=AB=9E=E4=BA=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 项目对话保存改为使用有界等待项目写锁 --- apps/ai-game-creator-shell/src-tauri/src/commands.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/apps/ai-game-creator-shell/src-tauri/src/commands.rs b/apps/ai-game-creator-shell/src-tauri/src/commands.rs index 6b00b2ff1..9de008de2 100644 --- a/apps/ai-game-creator-shell/src-tauri/src/commands.rs +++ b/apps/ai-game-creator-shell/src-tauri/src/commands.rs @@ -5170,7 +5170,12 @@ pub(crate) fn create_game_creator_agent_session( let root = Path::new(project_path.trim()); enforce_project_permission_policy(root, "conversation.read")?; enforce_project_permission_policy(root, "conversation.write")?; - let _lock = acquire_project_write_lock(root, "conversation.write")?; + // 首轮策划消息可能紧跟项目初始化写入到达;对话保存应等待这段短暂的 + // 项目锁竞争,避免把可恢复的初始化竞态直接显示成保存失败。 + let _lock = acquire_game_creator_agent_runtime_project_write_lock_with_wait( + root, + "conversation.write", + )?; create_game_creator_agent_session_at(root, agent_id.trim(), title.trim()) }