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