From 34616e1631dc9c79d1a02fc2139ef6d4ad22ffc6 Mon Sep 17 00:00:00 2001 From: Linghong Date: Sat, 12 Sep 2026 05:21:21 +0000 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20CI=20=E8=B0=83=E8=AF=95?= =?UTF-8?q?=E5=B7=A5=E4=BD=9C=E5=8C=BA=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 格式化 design runtime 调试命令 为 debug fixture 测试显式开启并清理 debug 环境变量 --- .../src-tauri/src/agent/design_runtime.rs | 5 ++++- .../tests/designWorkspaceDebug.test.tsx | 2 ++ 2 files changed, 6 insertions(+), 1 deletion(-) 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') {