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 92952b610..14c1e9ec7 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 @@ -870,7 +870,10 @@ pub(crate) fn debug_fast_forward_design_session( target_phase: String, ) -> Result { if !cfg!(debug_assertions) - || std::env::var("GENARRATIVE_AGC_DESIGN_DEBUG").ok().as_deref() != Some("1") + || std::env::var("GENARRATIVE_AGC_DESIGN_DEBUG") + .ok() + .as_deref() + != Some("1") { return Err("策划 Agent 快速推进仅可用于 Debug 构建".to_string()); } diff --git a/apps/ai-game-creator-shell/tests/designWorkspaceDebug.test.tsx b/apps/ai-game-creator-shell/tests/designWorkspaceDebug.test.tsx index 5a29e9c6b..f5198b50e 100644 --- a/apps/ai-game-creator-shell/tests/designWorkspaceDebug.test.tsx +++ b/apps/ai-game-creator-shell/tests/designWorkspaceDebug.test.tsx @@ -18,10 +18,12 @@ vi.mock('../src/components/ChatMarkdownMessage', () => ({ afterEach(() => { cleanup(); + vi.unstubAllEnvs(); delete window.__TAURI__; }); it('prepares debug fixtures from the header and refreshes the phase and files without a manual refresh', async () => { + vi.stubEnv('VITE_GENARRATIVE_AGC_DESIGN_DEBUG', '1'); let prepared = false; const invoke = vi.fn(async (command: string) => { if (command === 'debug_fast_forward_design_session') {