fix: enforce H3 reference input limit - #222
Conversation
NianJiuZst
left a comment
There was a problem hiding this comment.
Could you share the authoritative source for the 12-item combined reference limit? The current Video Generation V2 documentation describes reference-to-video as accepting any combination of reference images, videos, and audio, and documents only the per-type caps (9 images, 3 videos, and 3 audios), without a combined cap. With this change, a request containing 9 images, 3 videos, and 1 audio is rejected locally even though it is within those published per-type limits.
The implementation and tests look correct if the backend really enforces 12 total. Before merging, please either link the relevant service/spec evidence or update the public docs so the CLI does not risk rejecting a documented-valid request.
Summary
Root cause
The H3 validator checked each media type independently but did not check their combined count. A request containing 9 reference images, 3 reference videos, and 3 reference audios therefore passed local validation with 15 total references, even though mixed-reference requests allow at most 12.
Impact
Oversized mixed-reference requests now fail locally with an actionable usage error before a paid generation request is submitted.
Validation
bun test test/video/v2.test.ts— 12 passedbun test— 450 passedbun run typecheckbun run lint— 0 errors; 1 pre-existing warning intest/sdk/speech.test.tsbun run buildNeed help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.