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()) } diff --git a/apps/ai-game-creator-shell/src/features/project-workspace/ProjectSupervisorView.tsx b/apps/ai-game-creator-shell/src/features/project-workspace/ProjectSupervisorView.tsx index 655d5cef5..fb292db68 100644 --- a/apps/ai-game-creator-shell/src/features/project-workspace/ProjectSupervisorView.tsx +++ b/apps/ai-game-creator-shell/src/features/project-workspace/ProjectSupervisorView.tsx @@ -491,7 +491,9 @@ export function ProjectSupervisorView({ placeholder={ directCodex ? '告诉陶泥儿接下来要做什么,或输入 @ 选择资源' - : '告诉项目总控接下来要做什么,或输入 @ 选择资源' + : planningSurfaceActive + ? '' + : '告诉项目总控接下来要做什么,或输入 @ 选择资源' } onChange={onChatInputChange} /> diff --git a/apps/ai-game-creator-shell/tests/appSurface/plan-gdd.suite.ts b/apps/ai-game-creator-shell/tests/appSurface/plan-gdd.suite.ts index 510d73029..310faa120 100644 --- a/apps/ai-game-creator-shell/tests/appSurface/plan-gdd.suite.ts +++ b/apps/ai-game-creator-shell/tests/appSurface/plan-gdd.suite.ts @@ -577,6 +577,21 @@ export function registerPlanGddApprovalTests() { expect(screen.queryByText(/计划 \d+\/\d+/)).toBeNull(); }); + it('keeps the chat composer but hides its placeholder in the planning lane', async () => { + const harness = createProjectSupervisorRuntimeHarness({ + planningV2Result: planningV2WorkingResult(), + }); + await mountPlanningSurface(harness); + + expect(screen.getByRole('textbox', { name: '项目需求' })).not.toBeNull(); + expect( + screen.queryByText('告诉策划 Agent 接下来要做什么,或输入 @ 选择资源'), + ).toBeNull(); + expect( + screen.queryByText('告诉项目总控接下来要做什么,或输入 @ 选择资源'), + ).toBeNull(); + }); + it('still surfaces the clarification card on the planning lane', async () => { // 澄清卡是 V2 策划链路唯一需要用户动手的交互面之一。 const harness = createProjectSupervisorRuntimeHarness({