diff --git a/apps/ai-game-creator-shell/scripts/start-tauri-dev.mjs b/apps/ai-game-creator-shell/scripts/start-tauri-dev.mjs index 95a866f95..87144db48 100644 --- a/apps/ai-game-creator-shell/scripts/start-tauri-dev.mjs +++ b/apps/ai-game-creator-shell/scripts/start-tauri-dev.mjs @@ -20,6 +20,7 @@ import { const appRoot = fileURLToPath(new URL('..', import.meta.url)); const repoRoot = resolve(appRoot, '../..'); const tauriCliPath = resolve(repoRoot, 'node_modules/@tauri-apps/cli/tauri.js'); +const AGC_DESIGN_DEBUG_ENV = 'GENARRATIVE_AGC_DESIGN_DEBUG'; function buildTauriArguments(argv, devUrl = readAgcDevEndpoint().url) { const args = [...argv]; @@ -108,7 +109,10 @@ async function runTauriDev( if (!prepared || shutdownSignal) return 1; const tauriArguments = buildTauriArguments(argv, endpoint.url); child = spawnCli(tauriArguments, { - env: withAgcDevEndpointEnv(endpoint), + env: { + ...withAgcDevEndpointEnv(endpoint), + [AGC_DESIGN_DEBUG_ENV]: '1', + }, }); const childResult = waitForCli(child); const outcome = await Promise.race([ diff --git a/apps/ai-game-creator-shell/src-tauri/src/agent/design_runtime.rs b/apps/ai-game-creator-shell/src-tauri/src/agent/design_runtime.rs index f20f92c23..8dba870dd 100644 --- a/apps/ai-game-creator-shell/src-tauri/src/agent/design_runtime.rs +++ b/apps/ai-game-creator-shell/src-tauri/src/agent/design_runtime.rs @@ -460,6 +460,13 @@ fn build_design_request( // 调试队列只接收副本,写盘慢或失败时丢弃,不参与会话恢复。 fn design_debug(root: &Path, kind: &str, data: Value) { + if std::env::var("GENARRATIVE_AGC_DESIGN_DEBUG") + .ok() + .as_deref() + != Some("1") + { + return; + } type Entry = (PathBuf, Value); static QUEUE: OnceLock> = OnceLock::new(); let sender = QUEUE.get_or_init(|| {