Skip to content

fix(sdk/python): forward MiniMax v1 video optional fields regressed by #854 - #886

Merged
AbirAbbas merged 1 commit into
mainfrom
fix/minimax-v1-video-kwargs
Aug 5, 2026
Merged

fix(sdk/python): forward MiniMax v1 video optional fields regressed by #854#886
AbirAbbas merged 1 commit into
mainfrom
fix/minimax-v1-video-kwargs

Conversation

@AbirAbbas

Copy link
Copy Markdown
Contributor

Summary

PR #854 (MiniMax H3 video v2) promoted content, ratio, callback_url, and aigc_watermark from **kwargs to named parameters on MiniMaxProvider.generate_video, then added a guard rejecting all four for any non-H3 model. In v0.1.123 the last three fell through **kwargsoverrides → the v1 /video_generation request body and were forwarded verbatim (callback_url and aigc_watermark are documented v1 fields), so existing Hailuo callers like

await provider.generate_video(prompt, model="minimax/MiniMax-Hailuo-02", duration=6, callback_url="https://hook.example/cb")

now raise ValueError("MiniMax v2 request fields require the MiniMax-H3 model") instead of submitting the job.

Changes Made

  • Forward ratio, callback_url, and aigc_watermark verbatim into the v1 request body when provided, restoring v0.1.123 behavior byte-for-byte.
  • Keep the client-side guard for content only: structured content is a v2 request shape that never worked against v1, so the clear error is strictly better than the old server-side rejection.
  • No new names in the reserved override check, so the extra={"callback_url": ...} path (which kept working throughout) is unchanged.

Validation Contract

  1. A v1 (non-H3) call passing ratio / callback_url / aigc_watermark as named kwargs submits them verbatim in the v1 POST body with no exception — covered by test_minimax_video_legacy_forwards_v1_optional_fields.
  2. content=[...] with a non-H3 model still raises a clear ValueError — covered by test_minimax_video_legacy_rejects_h3_structured_content.
  3. H3 path behavior is untouched (existing H3 tests unchanged and passing).

Test Plan

  • Differential probe against a v0.1.123 checkout (captured submit bodies): all five scenarios — each named field, plain control, and the extra= path — are byte-identical between v0.1.123 and this branch.
  • ruff check . clean at CI's pinned 0.15.22; ruff format --check clean on touched files.
  • Full sdk/python suite: 1872 passed, 4 skipped (includes the 2 new tests).

🤖 Generated with Claude Code

PR #854 promoted content/ratio/callback_url/aigc_watermark to named
parameters of MiniMaxProvider.generate_video and rejected all four for
non-H3 models. Before that, the last three fell through **kwargs into
the v1 request body and were forwarded verbatim — callback_url and
aigc_watermark are documented v1 fields — so existing Hailuo callers
now raise ValueError.

Forward ratio/callback_url/aigc_watermark verbatim on the v1 path
again, matching v0.1.123 byte-for-byte. Keep the guard for content
only: structured content is a v2 request shape that never worked
against v1, so the client-side error stays.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@AbirAbbas
AbirAbbas requested a review from a team as a code owner August 5, 2026 21:28
@github-actions

github-actions Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Performance

SDK Memory Δ Latency Δ Tests Status
Python 9.0 KB - 0.38 µs +9%

✓ No regressions detected

@github-actions

github-actions Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

📊 Coverage gate

Thresholds from .coverage-gate.toml: per-surface ≥ 84%, aggregate ≥ 85%, max per-surface regression ≤ 1.0 pp, max aggregate regression ≤ 0.50 pp.

Surface Current Baseline Δ
control-plane 87.10% 87.40% ↓ -0.30 pp 🟡
sdk-go 92.70% 92.00% ↑ +0.70 pp 🟢
sdk-python 93.82% 93.73% ↑ +0.09 pp 🟢
sdk-typescript 91.17% 90.42% ↑ +0.75 pp 🟢
web-ui 84.75% 84.79% ↓ -0.04 pp 🟡
aggregate 85.62% 85.75% ↓ -0.13 pp 🟡

✅ Gate passed

No surface regressed past the allowed threshold and the aggregate stayed above the floor.

@github-actions

github-actions Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

📐 Patch coverage gate

Threshold: 80% on lines this PR touches vs origin/main (from .coverage-gate.toml:thresholds.min_patch).

Surface Touched lines Patch coverage Status
control-plane 0 ➖ no changes
sdk-go 0 ➖ no changes
sdk-python 0 ➖ no changes
sdk-typescript 0 ➖ no changes
web-ui 0 ➖ no changes

✅ Patch gate passed

Every surface whose lines were touched by this PR has patch coverage at or above the threshold.

@AbirAbbas
AbirAbbas merged commit de30ec6 into main Aug 5, 2026
32 checks passed
@AbirAbbas
AbirAbbas deleted the fix/minimax-v1-video-kwargs branch August 5, 2026 21:37
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.

1 participant