fix: preserve delivered page links when auto images fail

This commit is contained in:
john
2026-07-24 17:57:39 +08:00
parent 412e5f149b
commit 550969bed2
6 changed files with 152 additions and 5 deletions
+9
View File
@@ -48,6 +48,15 @@ test('image generation user override can force or disable image generation', ()
}).mode, IMAGE_GENERATION_MODE.DISABLED);
});
test('visual page hints keep image generation best-effort unless the user explicitly requests an image', () => {
const decision = resolveImageGenerationDecision({
text: '帮我写一首诗词,做个页面吧',
requestedMode: 'auto',
});
assert.equal(decision.mode, IMAGE_GENERATION_MODE.AUTO);
assert.equal(decision.source, 'intent');
});
test('router injects a fail-closed generate_image contract for required visual pages', async () => {
const router = createChatIntentRouter();
const text = '帮我生成一个精美唐诗页面,背景是大唐盛景图片';