diff --git a/apps/ai-game-creator-shell/tests/agentSwarmTestEntry.test.ts b/apps/ai-game-creator-shell/tests/agentSwarmTestEntry.test.ts index f0152b2ec..99418c563 100644 --- a/apps/ai-game-creator-shell/tests/agentSwarmTestEntry.test.ts +++ b/apps/ai-game-creator-shell/tests/agentSwarmTestEntry.test.ts @@ -584,6 +584,9 @@ describe('terminal configuration wizard persistence', () => { it('moves the default LLM to primary config and lets later GUI saves win', async () => { await withTemporaryRoot(async (root) => { + // 读写都要带上这个桩:读路径同样会加固私有目录与配置文件, + // 在 Windows 上每次加固都要拉起一个 powershell.exe(约 0.6 秒), + // 本用例只校验配置分层优先级,不该为无关的 DACL 子进程耗掉超时预算。 const persistenceOptions = process.platform === 'win32' ? { secureWindowsPath: async () => {} } @@ -601,7 +604,10 @@ describe('terminal configuration wizard persistence', () => { '{"llm":{"model":"stale-local","stream":true},"agentLlm":{"planner":{"model":"planner"}}}\n', ); - const state = await readGameCreatorWizardConfigState(configDir); + const state = await readGameCreatorWizardConfigState( + configDir, + persistenceOptions, + ); expect(state.configPath).toBe(primaryPath); expect(state.effectiveConfig.llm.model).toBe('stale-local'); const wizardConfig = buildGameCreatorWizardConfig(state.writeConfig, { @@ -619,7 +625,10 @@ describe('terminal configuration wizard persistence', () => { const sanitizedLocal = JSON.parse(await readFile(localPath, 'utf8')); expect(sanitizedLocal.llm).toBeUndefined(); expect(sanitizedLocal.agentLlm.planner.model).toBe('planner'); - const afterWizard = await readGameCreatorWizardConfigState(configDir); + const afterWizard = await readGameCreatorWizardConfigState( + configDir, + persistenceOptions, + ); expect(afterWizard.effectiveConfig.llm).toMatchObject({ apiKey: 'wizard-key', model: 'wizard-model', @@ -638,7 +647,10 @@ describe('terminal configuration wizard persistence', () => { guiConfig, persistenceOptions, ); - const afterGui = await readGameCreatorWizardConfigState(configDir); + const afterGui = await readGameCreatorWizardConfigState( + configDir, + persistenceOptions, + ); expect(afterGui.effectiveConfig.llm.apiKey).toBe('gui-key'); expect(afterGui.effectiveConfig.llm.model).toBe('gui-model'); });