Skip to content

Add MiniMax image generation support - #853

Merged
AbirAbbas merged 2 commits into
Agent-Field:mainfrom
octo-patch:octo/20260801-text-to-image-tool-recvqKZVIThJcF
Aug 5, 2026
Merged

Add MiniMax image generation support#853
AbirAbbas merged 2 commits into
Agent-Field:mainfrom
octo-patch:octo/20260801-text-to-image-tool-recvqKZVIThJcF

Conversation

@octo-patch

Copy link
Copy Markdown
Contributor

Reason: Add native MiniMax image generation support to the existing media provider pipeline.

Changes:

  • Implement image generation requests with global and China regional endpoint support.
  • Support URL and base64 image responses, optional request fields, and model-prefix routing.
  • Add focused tests for request construction, response parsing, validation, and provider registration.

Checks:

  • git diff --check origin/main...HEAD

@octo-patch
octo-patch requested review from a team and AbirAbbas as code owners August 1, 2026 05:14
@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.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 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-text-to-image-tool-recvqKZVIThJcF branch from 2024139 to 4a06417 Compare August 5, 2026 16:13

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

Last of the three MiniMax PRs — took these over since they'd been quiet for a few days.

I found one real bug here. Response parsing read data.image_urls unconditionally, but MiniMax documents base64 responses under data.image_base64. So response_format="base64" — one of the two modes this PR advertises — would have failed against the real API every time with "returned no image_urls". The reason it looked fine is that the base64 test built its fixture with an image_urls payload, so it asserted the implementation's assumption rather than the provider's actual contract, and passed while masking the defect.

I've pushed a fix that selects the response key from the requested format and names the actual mode in the error, plus corrected the base64 fixture to the documented image_base64 shape. I confirmed it fails before the change and passes after.

Two smaller things in the same commit: base_resp and data were only type-checked at the top level, so a non-dict nested value leaked AttributeError instead of the normalized RuntimeError (#852 already did this properly, so I matched its idiom), and I added regression coverage for the branches that had none — empty model, HTTP status errors, non-dict JSON, missing and empty image collections.

On the test_minimax_video.py edit: I checked it isn't weakening video coverage. It only drops the obsolete generate_image NotImplementedError expectation, which this PR makes untrue.

Since this landed last of the three, I rebased it and reconciled the overlap with #852 and #854 by hand: supported_modalities is now the union ['video', 'music', 'audio', 'image'], the H3 constants and video_model_metadata from #854 are preserved, and both stale NotImplementedError assertions are gone. Full Python SDK suite is green on the reconciled result.

@AbirAbbas
AbirAbbas added this pull request to the merge queue Aug 5, 2026
Merged via the queue into Agent-Field:main with commit b7613b5 Aug 5, 2026
23 checks passed
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