From 4da1494a1d77a4db59ecdef9924686ae96503aae Mon Sep 17 00:00:00 2001 From: Linghong Date: Wed, 16 Sep 2026 13:55:02 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8E=A5=E5=85=A5=E5=81=9A=E6=88=90=E6=B8=B8?= =?UTF-8?q?=E6=88=8F=E5=90=8E=E7=9A=84=E7=AD=96=E5=88=92=E6=96=87=E6=A1=A3?= =?UTF-8?q?=E6=8C=87=E4=BB=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 切换到 GameAgent 后自动请求读取 design_artifacts 文档 为切换消息增加独立去重键,避免策划首轮占用 --- apps/ai-game-creator-shell/src/App.tsx | 12 ++++++++---- .../features/app-shell/WorkspaceLauncher.tsx | 19 +++++++++++++------ 2 files changed, 21 insertions(+), 10 deletions(-) diff --git a/apps/ai-game-creator-shell/src/App.tsx b/apps/ai-game-creator-shell/src/App.tsx index ee075cfa5..5bf3330e9 100644 --- a/apps/ai-game-creator-shell/src/App.tsx +++ b/apps/ai-game-creator-shell/src/App.tsx @@ -605,16 +605,20 @@ function isPersistableDirectCodexConversationMessage(message: ChatMessage) { return /^[a-z0-9][a-z0-9-]{5,159}$/iu.test(turnId); } -function claimInitialSupervisorMessageForPage(projectPath: string) { +function claimInitialSupervisorMessageForPage( + projectPath: string, + messageKey = '', +) { let claimedProjectPaths = initialSupervisorMessageClaimsByPage.get(window); if (!claimedProjectPaths) { claimedProjectPaths = new Set(); initialSupervisorMessageClaimsByPage.set(window, claimedProjectPaths); } - if (claimedProjectPaths.has(projectPath)) { + const claimKey = `${projectPath}\u0000${messageKey}`; + if (claimedProjectPaths.has(claimKey)) { return false; } - claimedProjectPaths.add(projectPath); + claimedProjectPaths.add(claimKey); return true; } @@ -7501,7 +7505,7 @@ export function App({ } if ( chatAgentBusy || - !claimInitialSupervisorMessageForPage(latch.projectPath) + !claimInitialSupervisorMessageForPage(latch.projectPath, latch.prompt) ) { return; } diff --git a/apps/ai-game-creator-shell/src/features/app-shell/WorkspaceLauncher.tsx b/apps/ai-game-creator-shell/src/features/app-shell/WorkspaceLauncher.tsx index 4727bf323..8b64a4505 100644 --- a/apps/ai-game-creator-shell/src/features/app-shell/WorkspaceLauncher.tsx +++ b/apps/ai-game-creator-shell/src/features/app-shell/WorkspaceLauncher.tsx @@ -495,6 +495,9 @@ export function WorkspaceLauncherShell({ }); } + const approvedDesignBuildPrompt = + '查看当前项目 design_artifacts/ 目录及其子目录下的文档,理解其游戏设计,并按照这些文档将游戏实现出来。'; + const currentHelpTitle = launcherView === 'guide' ? '使用指南' @@ -661,14 +664,18 @@ export function WorkspaceLauncherShell({ initialProjectManifest={currentProjectContext.manifest} initialProjectKind={currentProjectContext.projectKind} initialSupervisorMessage={ - !suppressInitialGameTurn - ? currentProjectContext.initialPrompt - : '' + switchedToGameRuntime + ? approvedDesignBuildPrompt + : !suppressInitialGameTurn + ? currentProjectContext.initialPrompt + : '' } initialCreationType={ - !suppressInitialGameTurn - ? currentProjectContext.creationType - : null + switchedToGameRuntime + ? 'game' + : !suppressInitialGameTurn + ? currentProjectContext.creationType + : null } initialAttachments={ !suppressInitialGameTurn