测试:完成BGM提示词优化收口并切换助手模型

增加 TypeScript/Rust 共用 canonicalization fixture
补齐 BGM 跨层等值、SFX 和后端边界测试
将 BGM 补全与简化请求模型改为 gpt-5.6-luna,保留画布 Agent gpt-5.4-mini
同步权威设计、项目记忆和 T6 发布门禁记录
验证本地定向测试与真实 VectorEngine 补全/简化请求
This commit is contained in:
2026-08-05 13:35:02 +00:00
parent 69426ee61c
commit aeb5894b9d
13 changed files with 628 additions and 209 deletions
@@ -1,5 +1,6 @@
import { afterEach, describe, expect, it, vi } from 'vitest';
import backgroundMusicPromptCanonicalizationCases from '../../../packages/shared/test-fixtures/background-music-prompt-canonicalization.json';
import {
completeEditorBackgroundMusicPrompt,
createEditorAsset,
@@ -1582,13 +1583,21 @@ describe('editorProjectClient', () => {
});
it('generates editor background music through the backend BFF', async () => {
const representativeComplexPromptCase =
backgroundMusicPromptCanonicalizationCases.find(
({ name }) => name === 'representative-complex',
);
if (!representativeComplexPromptCase) {
throw new Error('missing representative-complex prompt fixture');
}
const canonicalPrompt = representativeComplexPromptCase.prompt;
requestJsonMock.mockResolvedValueOnce({
audioSrc: '/generated-character-drafts/editor-audios/bgm.mp3',
width: 420,
height: 120,
sourceType: 'generated',
prompt: '森林冒险背景音乐',
actualPrompt: '森林冒险背景音乐',
prompt: canonicalPrompt,
actualPrompt: canonicalPrompt,
model: 'chirp-v4',
provider: 'VectorEngine',
taskId: 'music-task-1',
@@ -1596,7 +1605,7 @@ describe('editorProjectClient', () => {
});
const result = await generateEditorBackgroundMusic({
gptDescriptionPrompt: '森林冒险背景音乐',
gptDescriptionPrompt: canonicalPrompt,
makeInstrumental: true,
assetFolderId: 'project',
assetLabel: '游戏背景音乐 1',
@@ -1609,7 +1618,7 @@ describe('editorProjectClient', () => {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
gptDescriptionPrompt: '森林冒险背景音乐',
gptDescriptionPrompt: canonicalPrompt,
makeInstrumental: true,
assetFolderId: 'project',
assetLabel: '游戏背景音乐 1',