Skip to content

fix: enforce H3 reference input limit - #222

Open
shaoohh wants to merge 1 commit into
MiniMax-AI:mainfrom
shaoohh:agent/fix-h3-reference-limit
Open

fix: enforce H3 reference input limit#222
shaoohh wants to merge 1 commit into
MiniMax-AI:mainfrom
shaoohh:agent/fix-h3-reference-limit

Conversation

@shaoohh

@shaoohh shaoohh commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Summary

  • enforce MiniMax-H3's combined limit of 12 reference images, videos, and audios
  • keep the existing per-media limits of 9 images, 3 videos, and 3 audios
  • add regression coverage proving 12 mixed references are accepted and 13 are rejected

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 passed
  • bun test — 450 passed
  • bun run typecheck
  • bun run lint — 0 errors; 1 pre-existing warning in test/sdk/speech.test.ts
  • bun run build

View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

@NianJiuZst
NianJiuZst marked this pull request as ready for review August 4, 2026 10:11
@NianJiuZst
NianJiuZst self-requested a review August 4, 2026 10:11
@NianJiuZst NianJiuZst self-assigned this Aug 4, 2026

@NianJiuZst NianJiuZst left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants