Skip to content

Add MiniMax H3 video v2 support - #854

Merged
AbirAbbas merged 2 commits into
Agent-Field:mainfrom
octo-patch:octo/20260801-parameter-refresh-recvqVX8KZ2fvE
Aug 5, 2026
Merged

Add MiniMax H3 video v2 support#854
AbirAbbas merged 2 commits into
Agent-Field:mainfrom
octo-patch:octo/20260801-parameter-refresh-recvqVX8KZ2fvE

Conversation

@octo-patch

Copy link
Copy Markdown
Contributor

Reason: Refresh MiniMax video support for the H3 v2 API and current pricing metadata.

  • add v2 video task create, query, list, and delete operations
  • validate H3 multimodal content, roles, 2K resolution, duration, ratio, and regional fields
  • route H3 generation through v2 while preserving existing v1 video and music behavior
  • expose current H3 model and regional pricing metadata

Checks:

  • uvx --from ruff==0.15.22 ruff check sdk/python/agentfield/media_providers.py sdk/python/tests/test_minimax_video.py
  • uv run --frozen --extra dev python -m pytest tests/test_minimax_video.py tests/test_media_providers.py tests/test_media_integration.py -q --no-cov
  • python -m py_compile sdk/python/agentfield/media_providers.py sdk/python/tests/test_minimax_video.py
  • git diff --check

@octo-patch
octo-patch requested review from a team and AbirAbbas as code owners August 1, 2026 07:33
@github-actions

github-actions Bot commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

Performance

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

✓ No regressions detected

@github-actions

github-actions Bot commented Aug 1, 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.08% 90.42% ↑ +0.66 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 1, 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 force-pushed the octo/20260801-parameter-refresh-recvqVX8KZ2fvE branch from e79ba90 to ce8ee63 Compare August 5, 2026 15:54

@AbirAbbas AbirAbbas left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Picked this up since it had been quiet for a few days. I tested it rather than just reading the diff — ran the V2 lifecycle against a local mock server, and replayed the legacy V1 video and music calls against both this branch and main to diff the outgoing requests. The preservation claim holds: legacy request construction is byte-identical to main.

Two things needed fixing before this could land, and I've pushed a commit for both:

Pricing was wrong in a way that matters. Global rates were $0.02/sec for reference video and $0.03 per additional image; MiniMax publishes $0.13/sec and $0.04. Because cost_usd flows into AgentField's usage tracking, that under-reports real spend rather than just being a cosmetic metadata error. The fixture asserted $0.72 where the correct math gives $0.95. I corrected the constants for both regions and made _estimate_h3_cost_usd pick its rate from the task's actual resolution instead of assuming 2K.

768P was rejected. The official V2 schema's resolution enum is ["768P", "2K"], but _build_h3_request hard-required 2K, so a valid 768P request failed locally. Now both are accepted and both are advertised in the metadata, with 768P pricing filled in for both regions.

I also dropped expired from the status enum (official statuses end at cancelled), added validation for task_type — it was previously unvalidated, so filter.task_type=bogus sailed through to the server — and added a regression test locking the legacy music request shape, since that preservation guarantee was only proven by my throwaway probe and needed to be protected in the suite while the three MiniMax PRs get reconciled.

Worth flagging for the other two: #852 and #853 conflict with each other in supported_modalities and the shared video test. This one is textually clean against both, so it goes first.

@AbirAbbas
AbirAbbas added this pull request to the merge queue Aug 5, 2026
Merged via the queue into Agent-Field:main with commit fd15a67 Aug 5, 2026
23 checks passed
AbirAbbas added a commit that referenced this pull request Aug 5, 2026
…886)

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>
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