From 1b4b41133c7c37c1923569f2aad12c15edbbedba Mon Sep 17 00:00:00 2001 From: Ricardo-M-L Date: Sat, 14 Nov 2026 20:08:28 +0800 Subject: [PATCH] fix(video): validate configured image-only models --- src/commands/video/generate.ts | 2 +- test/commands/video/generate.test.ts | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/commands/video/generate.ts b/src/commands/video/generate.ts index f6465973..485a6a64 100644 --- a/src/commands/video/generate.ts +++ b/src/commands/video/generate.ts @@ -131,7 +131,7 @@ export default defineCommand({ } // MiniMax-Hailuo-2.3-Fast only supports I2V, not T2V - if (explicitModel === 'MiniMax-Hailuo-2.3-Fast' && !inputImage) { + if (model === 'MiniMax-Hailuo-2.3-Fast' && !inputImage) { throw new CLIError( 'MiniMax-Hailuo-2.3-Fast only supports I2V (image-to-video). Use --image to provide an input image.', ExitCode.USAGE, diff --git a/test/commands/video/generate.test.ts b/test/commands/video/generate.test.ts index 0bc44b11..891f06a0 100644 --- a/test/commands/video/generate.test.ts +++ b/test/commands/video/generate.test.ts @@ -664,11 +664,12 @@ describe('video generate command', () => { ).rejects.toThrow('require --model MiniMax-H3'); }); - it('rejects explicit MiniMax-Hailuo-2.3-Fast without --image', async () => { + it.each(['flag', 'config'])('rejects MiniMax-Hailuo-2.3-Fast without --image via %s', async (source) => { const config = { apiKey: 'test-key', region: 'global' as const, baseUrl: 'https://api.mmx.io', + defaultVideoModel: source === 'config' ? 'MiniMax-Hailuo-2.3-Fast' : undefined, output: 'json' as const, timeout: 10, verbose: false, @@ -683,7 +684,7 @@ describe('video generate command', () => { await expect( generateCommand.execute(config, { prompt: 'A cat', - model: 'MiniMax-Hailuo-2.3-Fast', + model: source === 'flag' ? 'MiniMax-Hailuo-2.3-Fast' : undefined, quiet: false, verbose: false, noColor: true,