修复策划项目首条对话保存锁竞争
Project CI / AI game creator shell Rust shard 1/4 (pull_request) Successful in 5m2s
Project CI / AI game creator shell Rust shard 2/4 (pull_request) Successful in 4m45s
Project CI / AI game creator shell Rust shard 3/4 (pull_request) Failing after 4m33s
Project CI / AI game creator shell Rust shard 4/4 (pull_request) Failing after 3m56s
Project CI / Backend tests (pull_request) Failing after 10s
Project CI / AI game creator shell Rust smoke (pull_request) Successful in 1m32s
Project CI / Repository checks (pull_request) Failing after 10s
Project CI / AI game creator shell Rust crates (pull_request) Successful in 2m18s
Project CI / AI game creator shell web tests (pull_request) Failing after 3m3s
Project CI / Frontend tests (pull_request) Successful in 4m31s
Project CI / Native shell tests (pull_request) Successful in 6m49s

项目对话保存改为使用有界等待项目写锁
This commit is contained in:
2026-09-15 18:33:37 +00:00
parent bef1a42506
commit d8a167e0f3
@@ -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())
}