Skip to content

fix(minimax): apply request policy to media generation requests - #102072

Merged
sallyom merged 12 commits into
openclaw:mainfrom
Alix-007:alix/minimax-media-request-policy
Jul 12, 2026
Merged

sallyom merged 12 commits into
openclaw:mainfrom
Alix-007:alix/minimax-media-request-policy

Conversation

@Alix-007

@Alix-007 Alix-007 commented Jul 8, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • MiniMax video, music, and image generation now pass models.providers.<providerId>.request into provider HTTP resolution instead of silently ignoring configured request overrides.
  • MiniMax video follow-up requests now carry the same resolved request policy through status polling, file metadata retrieval, direct video downloads, and file-id video downloads.
  • MiniMax music URL downloads now use the same guarded request policy as the initial music generation request.
  • The guarded video/music follow-up requests preserve the existing provider poll/download retry semantics instead of turning transient failures into immediate user-visible failures.
  • Removes the image caller-level hard-coded allowPrivateNetwork: false so configured request policy can control private-network access while the default remains deny-by-default when no request override is configured.
  • collision check: searched minimax request policy, minimax allowPrivateNetwork, and minimax video proxy; no same-file or same-problem open PR was found for these MiniMax media generation paths.

Verification

  • TMPDIR=/media/vdc/0668001470/tmp/openclaw-task-tmp node scripts/run-vitest.mjs extensions/minimax/video-generation-provider.test.ts extensions/minimax/music-generation-provider.test.ts extensions/minimax/image-generation-provider.test.ts - passed; Test Files 3 passed (3), Tests 31 passed (31).
  • TMPDIR=/media/vdc/0668001470/tmp/openclaw-task-tmp OPENCLAW_OXLINT_SKIP_PREPARE=1 node scripts/run-oxlint.mjs --tsconfig config/tsconfig/oxlint.extensions.json extensions/minimax/video-generation-provider.ts extensions/minimax/video-generation-provider.test.ts extensions/minimax/music-generation-provider.ts extensions/minimax/music-generation-provider.test.ts extensions/minimax/image-generation-provider.ts extensions/minimax/image-generation-provider.test.ts extensions/minimax/provider-http.test-helpers.ts - passed; exit 0.
  • node scripts/run-tsgo.mjs -p test/tsconfig/tsconfig.extensions.test.json --incremental --tsBuildInfoFile .artifacts/tsgo-cache/extensions-test.tsbuildinfo - passed; exit 0.
  • git diff --check HEAD~1..HEAD - passed; exit 0.
  • focused regression coverage now asserts the resolved MiniMax request policy reaches video status polling, file-id metadata retrieval, direct/file-id video downloads, and music URL downloads via guarded fetch calls.
  • focused retry coverage now asserts transient video status polling and music URL download failures retry while the guarded request policy remains attached to each retry attempt.
  • mutation check: temporarily removing the image request: parameter made extensions/minimax/image-generation-provider.test.ts fail because resolveProviderHttpRequestConfig no longer received the configured request object; restoring the patch returned the test to green.
  • mutation check from the original commit: temporarily removing the video and music request: parameters made the focused Vitest fail with expected undefined to deeply equal { allowPrivateNetwork: true, headers: ... } in both portal media tests; restoring the patch returned the test to green.

Real behavior proof

Behavior addressed: MiniMax video/music/image generation now honor configured provider request overrides such as custom headers and allowPrivateNetwork for the active provider id. The actual network-path proof below exercises video and music against a local MiniMax-compatible node:http endpoint; image is covered by a focused regression because MiniMax image generation intentionally uses a dedicated fixed regional endpoint rather than the text/media baseUrl.

Real environment tested: local Linux Node source checkout; actual exported MiniMax portal video and music provider builders; local node:http server; no third-party MiniMax network traffic; proxy env vars unset for the proof process.

Exact command run after this patch:

env HTTP_PROXY= HTTPS_PROXY= http_proxy= https_proxy= ALL_PROXY= all_proxy= NO_PROXY= no_proxy= node --import tsx scratchpad/minimax-request-policy-proof.mts

The temporary proof script was not committed. It configured models.providers.minimax-portal.request with allowPrivateNetwork: true and headers: { "X-MiniMax-Proof": "policy-applied" }, then called the real MiniMax portal video and music providers against the local endpoint.

Observed output after fix:

minimax-request-policy-proof
video_files=1
music_files=1
provider_paths=/v1/video_generation,/v1/query/video_generation?task_id=video-task,/v1/music_generation
proof_headers=policy-applied,policy-applied,policy-applied
auth_headers=Bearer ***,Bearer ***,Bearer ***

Evidence after fix: the local endpoint received configured request headers on the actual video submit request, video poll request, and music generation request, and both providers returned generated media. Additional focused regression coverage verifies that the follow-up legs ClawSweeper called out now receive guarded request options, including video status polling, file metadata retrieval, generated video download, and music URL download. Additional retry regression coverage verifies that guarded video polling and music URL downloads still use provider poll/download retry semantics. The image regression separately verifies the image provider passes the same sanitized request object to provider HTTP resolution and that the final image POST receives allowPrivateNetwork: true plus the configured header.

@clawsweeper

clawsweeper Bot commented Jul 8, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed July 12, 2026, 6:11 AM ET / 10:11 UTC.

Summary
The PR makes MiniMax image, music, and video generation honor sanitized provider request policy across submission, polling, metadata retrieval, and guarded media downloads while preserving retry behavior.

PR surface: Source +204, Tests +284. Total +488 across 7 files.

Reproducibility: yes. at source level: current main ignores configured MiniMax request policy on these media paths and leaves generated-media follow-ups outside the guarded path; the canonical issue and after-fix live output independently corroborate the behavior.

Review metrics: 1 noteworthy metric.

  • Request-policy capabilities: 3 changed. Image, music, and video begin honoring an existing security- and compatibility-sensitive provider setting.

Stored data model
Persistent data-model change detected: serialized state: extensions/minimax/image-generation-provider.test.ts, serialized state: extensions/minimax/music-generation-provider.test.ts. Confirm migration or upgrade compatibility proof before merge.

Root-cause cluster
Relationship: fixed_by_candidate
Canonical: #103083
Summary: This PR is the MiniMax-specific candidate fix for the canonical generated-video SSRF issue.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Merge readiness
Overall: 🦞 diamond lobster
Proof: 🦞 diamond lobster
Patch quality: 🦞 diamond lobster
Result: ready for maintainer review.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Risk before merge

  • [P1] Existing MiniMax provider request configuration begins affecting additional media requests, including explicit private-network allowance and dispatcher routing; this is intentional but security- and compatibility-sensitive.

Maintainer options:

  1. Approve and land the unified boundary (recommended)
    Accept the intentional configuration-scope change after provider HTTP owner confirmation and exact-head merge checks.
  2. Restrict result-URL authorization
    Revise only if explicit private-network authorization should stop at MiniMax-owned endpoints.

Next step before merge

  • No automated repair is needed; a provider HTTP owner should confirm the expanded request-policy authorization scope, then normal exact-head merge gates can decide landing.

Maintainer decision needed

  • Question: Should MiniMax’s configured provider request policy authorize private-network and dispatcher behavior for media submit, poll, metadata, and provider-returned download URLs?
  • Rationale: The implementation is correct and proven, but it expands the effective scope of an existing security-sensitive configuration setting and therefore requires owner intent.
  • Likely owner: steipete — He has the broadest recent merged history across the provider HTTP, retry, timeout, SDK, and MiniMax media surfaces involved in this decision.
  • Options:
    • Approve provider-wide scope (recommended): Land the PR because it preserves default SSRF denial and applies only explicit sanitized overrides without leaking provider headers to result URLs.
    • Keep downloads deny-only: Pause and define a narrower contract if provider-returned URLs must ignore explicit private-network authorization.

Security
Cleared: The patch closes unguarded MiniMax downloads, preserves default SSRF denial, sanitizes overrides, avoids credential leakage, and releases guarded responses correctly.

Review details

Best possible solution:

Land the shared guarded implementation after the provider HTTP owner confirms that the existing provider request policy intentionally authorizes every MiniMax media leg, while retaining default SSRF denial and never forwarding provider credentials to arbitrary result URLs.

Do we have a high-confidence way to reproduce the issue?

Yes at source level: current main ignores configured MiniMax request policy on these media paths and leaves generated-media follow-ups outside the guarded path; the canonical issue and after-fix live output independently corroborate the behavior.

Is this the best way to solve the issue?

Yes technically: the patch reuses the canonical sanitizer, resolver, guarded fetch, retry engine, and release contract, while keeping credentials off arbitrary provider-returned URLs; only the intended authorization scope needs human confirmation.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 7bb59c451122.

Label changes

Label changes:

  • add rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • remove rating: 🐚 platinum hermit: Current PR rating is rating: 🦞 diamond lobster, so this older rating label is no longer current.

Label justifications:

  • P2: This is a bounded MiniMax request-policy correctness and SSRF-hardening fix with focused impact.
  • merge-risk: 🚨 compatibility: Existing MiniMax request headers, dispatcher routing, and private-network settings gain effect on media paths that previously ignored them.
  • merge-risk: 🚨 security-boundary: The PR extends explicit private-network authorization to provider-controlled media URLs while retaining default SSRF denial.
  • rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The PR provides after-fix live output from actual MiniMax video and music provider builders plus focused image, follow-up, retry, lint, and type evidence.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR provides after-fix live output from actual MiniMax video and music provider builders plus focused image, follow-up, retry, lint, and type evidence.
Evidence reviewed

PR surface:

Source +204, Tests +284. Total +488 across 7 files.

View PR surface stats
Area Files Added Removed Net
Source 4 270 66 +204
Tests 3 292 8 +284
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 7 562 74 +488

What I checked:

  • Current-main problem: Current main does not consistently carry configured MiniMax request policy into media generation and uses unguarded follow-up download paths, matching the source-level reproduction in the canonical security issue. (extensions/minimax/video-generation-provider.ts:222, 7bb59c451122)
  • Shared guarded-fetch contract: The SDK guarded-fetch primitive applies the SSRF guard even when explicit options are absent, so the PR preserves default private-network denial while allowing sanitized explicit policy overrides. (src/media-understanding/shared.ts:439, 7bb59c451122)
  • Retry and cleanup correctness: The new MiniMax helpers release failed guarded responses before retry and release successful responses after parsing or bounded body reads, matching the shared provider helper pattern. (extensions/minimax/video-generation-provider.ts:137, b25360215377)
  • Credential boundary: MiniMax authorization and configured headers remain limited to provider-owned submit, poll, and metadata endpoints; arbitrary provider-returned download URLs receive method-only GET requests. (extensions/minimax/video-generation-provider.ts:295, b25360215377)
  • Re-review continuity: No unresolved finding remains from earlier review cycles; the media-provider changes were already clean at a706afd, and subsequent head commits merge current main rather than introducing a new media implementation. (b25360215377)
  • Canonical related work: The broader open SSRF report explicitly identifies this PR as the complete MiniMax-specific candidate fix while retaining separate work for other providers. (extensions/minimax/video-generation-provider.ts:295, 7bb59c451122)

Likely related people:

  • steipete: Live history shows repeated merged work on provider timeout resolvers, retry stages, retry deadlines, plugin SDK seams, and MiniMax media behavior. (role: shared provider HTTP and retry owner; confidence: high; commits: 9f46e9cb8540, bd326cdd5e1c, af021aac8d94; files: extensions/minimax/video-generation-provider.ts, extensions/minimax/music-generation-provider.ts, src/media-understanding/shared.ts)
  • vincentkoc: Live history includes the runtime request-override implementation, shared image transport work, bounded media downloads, and related provider response hardening. (role: provider request and media hardening contributor; confidence: high; commits: abec88cfab3e, 9e002c12ac7a, 036298fbaec0; files: src/agents/provider-request-config.ts, extensions/minimax/video-generation-provider.ts, extensions/minimax/music-generation-provider.ts)
  • tars90percent: The MiniMax portal music and video generation behavior appears to date to this merged introduction commit on both affected provider modules. (role: MiniMax portal media introducer; confidence: high; commits: d5b6667823a4; files: extensions/minimax/video-generation-provider.ts, extensions/minimax/music-generation-provider.ts)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

How this review workflow works
  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.
Review history (8 earlier review cycles)
  • reviewed 2026-07-08T07:10:47.355Z sha f91e6d9 :: needs real behavior proof before merge. :: [P2] Apply request policy to MiniMax images too
  • reviewed 2026-07-08T07:43:36.034Z sha cfc1481 :: needs maintainer review before merge. :: none
  • reviewed 2026-07-09T06:37:06.871Z sha 930b838 :: needs maintainer review before merge. :: none
  • reviewed 2026-07-09T08:40:23.478Z sha 089cc39 :: needs changes before merge. :: [P2] Thread policy into MiniMax video follow-ups
  • reviewed 2026-07-09T09:39:01.186Z sha 843b443 :: needs changes before merge. :: [P2] Preserve retries on guarded MiniMax video fetches | [P2] Preserve retries on guarded MiniMax music downloads
  • reviewed 2026-07-09T09:45:38.265Z sha 843b443 :: needs changes before merge. :: [P2] Preserve retries on guarded MiniMax video fetches | [P2] Preserve retries on guarded MiniMax music downloads
  • reviewed 2026-07-09T09:59:53.945Z sha a706afd :: needs maintainer review before merge. :: none
  • reviewed 2026-07-09T10:09:33.378Z sha a706afd :: needs maintainer review before merge. :: none

@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P2 Normal backlog priority with limited blast radius. labels Jul 8, 2026
@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Jul 8, 2026
@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Jul 9, 2026
@Alix-007

Alix-007 commented Jul 9, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jul 9, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. labels Jul 9, 2026
@clawsweeper clawsweeper Bot added the merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. label Jul 9, 2026
@Alix-007

Alix-007 commented Jul 9, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jul 9, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Jul 9, 2026
@clawsweeper clawsweeper Bot added rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. labels Jul 12, 2026
@sallyom sallyom self-assigned this Jul 12, 2026
@sallyom

sallyom commented Jul 12, 2026

Copy link
Copy Markdown
Contributor

Clean maintainer review. This fixes a real MiniMax request-policy and generated-media SSRF gap at the narrowest plugin-owned boundary across image, music, and video generation. No breaking API, config, or storage changes; the only compatibility impact is the intended security tightening that private/internal result URLs now require the existing request.allowPrivateNetwork opt-in. Provider credentials remain restricted to MiniMax-owned endpoints. CI is green at HEAD 052e9833ac58f14d0c645dc268eb87eb9d9fb808. Merge-ready.

@sallyom
sallyom merged commit 20f19d8 into openclaw:main Jul 12, 2026
95 checks passed
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 13, 2026
…claw#102072)

* fix(minimax): apply request policy to media generation requests

* fix(minimax): include image request policy

* fix(minimax): apply request policy to follow-up media fetches

* fix(minimax): preserve retries for guarded media fetches
yetval added a commit to yetval/openclaw that referenced this pull request Jul 27, 2026
…ownloads

The byteplus and runway video-generation providers fetched the generated
video from a URL taken out of the provider's own completion response using
an unguarded download call, never re-applying the SSRF guard (DNS pinning,
private/loopback/link-local blocking) they already apply to submit and poll.
A compromised, MITM'd, or malicious-base-URL provider could point that result
URL at an internal address and OpenClaw would fetch it and save the bytes as
the generated video (CWE-918), with default configuration.

Add a canonical fetchGuardedProviderDownloadResponse helper that mirrors
fetchProviderDownloadResponse but always routes the download through the SSRF
guard, blocking private targets by default while honoring the resolved
allowPrivateNetwork and dispatcherPolicy operator opt-in. Thread the resolved
policy into both providers' download step. This matches the always-on guard
already used by fal and openrouter and closes the default-configuration gap.

minimax (openclaw#102072) and xai (openclaw#104836) are already guarded; vydra is covered by
open PR openclaw#105884.

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

Labels

extensions: minimax merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. size: L status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants