Skip to content

fix(minimax): stop advertising music duration control#84585

Closed
neeravmakwana wants to merge 3 commits into
openclaw:mainfrom
neeravmakwana:fix/minimax-music-duration-capability
Closed

fix(minimax): stop advertising music duration control#84585
neeravmakwana wants to merge 3 commits into
openclaw:mainfrom
neeravmakwana:fix/minimax-music-duration-capability

Conversation

@neeravmakwana

@neeravmakwana neeravmakwana commented May 20, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Stop MiniMax music generation from advertising durationSeconds support because the official MiniMax /v1/music_generation request contract does not document a duration field.
  • Send the MiniMax prompt as authored instead of appending a duration hint that the provider cannot enforce.
  • Update MiniMax provider tests and music generation docs so the exposed controls match runtime behavior.

Fixes #84508

Root Cause

The MiniMax music provider claimed supportsDuration: true, but durationSeconds was only converted into prompt text. That made the shared music_generate capability advertise a runtime control that MiniMax does not actually enforce through a documented structured API field.

Why This Is Safe

This narrows the advertised MiniMax capability to match the vendor API contract and existing runtime behavior. Callers that request duration through the shared music generation runtime now get the normal unsupported-override handling instead of a misleading MiniMax-specific prompt hint.

Security/runtime controls are unchanged: provider authentication, HTTP request configuration, private-network blocking, response validation, download handling, and mp3-only format validation are untouched.

Real behavior proof

Behavior addressed: MiniMax music generation no longer advertises durationSeconds support because the official MiniMax /v1/music_generation API contract does not document a duration request field.

Real environment tested: Local macOS checkout with MINIMAX_API_KEY configured from .env, using the patched provider code. Secret values were not printed; the live provider log is redacted.

Exact steps or command run after this patch:

node --import tsx --input-type=module - <<'NODE'
import { buildMinimaxMusicGenerationProvider } from './extensions/minimax/music-generation-provider.ts';
import { resolveMusicGenerationOverrides } from './src/music-generation/normalization.ts';

const provider = buildMinimaxMusicGenerationProvider();
const generateCaps = provider.capabilities.generate;
const resolved = resolveMusicGenerationOverrides({
  provider,
  model: 'music-2.6',
  durationSeconds: 30,
  format: 'mp3',
});

console.log(JSON.stringify({
  provider: provider.id,
  model: 'music-2.6',
  advertisedControls: {
    supportsLyrics: generateCaps?.supportsLyrics === true,
    supportsInstrumental: generateCaps?.supportsInstrumental === true,
    supportsDuration: generateCaps?.supportsDuration === true,
    supportsFormat: generateCaps?.supportsFormat === true,
    supportedFormats: generateCaps?.supportedFormats ?? [],
  },
  requestedOverrides: { durationSeconds: 30, format: 'mp3' },
  sanitizedRequest: {
    durationSeconds: resolved.durationSeconds ?? null,
    format: resolved.format ?? null,
  },
  ignoredOverrides: resolved.ignoredOverrides,
}, null, 2));
NODE

pnpm test extensions/minimax/music-generation-provider.test.ts
OPENCLAW_LIVE_TEST=1 OPENCLAW_LIVE_TEST_QUIET=0 OPENCLAW_LIVE_MUSIC_GENERATION_PROVIDERS=minimax pnpm test:live -- extensions/music-generation-providers.live.test.ts --reporter=verbose

Capability and ignored-override evidence after fix:

{
  "provider": "minimax",
  "model": "music-2.6",
  "advertisedControls": {
    "supportsLyrics": true,
    "supportsInstrumental": true,
    "supportsDuration": false,
    "supportsFormat": true,
    "supportedFormats": [
      "mp3"
    ]
  },
  "requestedOverrides": {
    "durationSeconds": 30,
    "format": "mp3"
  },
  "sanitizedRequest": {
    "durationSeconds": null,
    "format": "mp3"
  },
  "ignoredOverrides": [
    {
      "key": "durationSeconds",
      "value": 30
    }
  ]
}

Live MiniMax generation evidence after fix:

$ node scripts/test-live.mjs -- extensions/music-generation-providers.live.test.ts --reporter=verbose

 RUN  v4.1.6 /Users/neeravmakwana/Desktop/github_repos/openclaw_repo_prrefresh

[test:live] still running (40s elapsed, 39s since last output)
[test:live] still running (60s elapsed, 20s since last output)
[live:music-generation] attempted=minimax:generate:music-2.6 (env: MINIMAX_API_KEY [redacted]) skipped=none failures=none shellEnv=none
 ✓ extensions/music-generation-providers.live.test.ts > music generation provider live > covers generate plus declared edit paths with shell/profile auth 60367ms

 Test Files  1 passed (1)
      Tests  1 passed (1)
   Start at  09:17:15
   Duration  68.90s (transform 6.20s, setup 237ms, import 8.17s, tests 60.37s, environment 0ms)

Observed result after fix: MiniMax no longer advertises duration support, the shared runtime normalization drops durationSeconds and records it as an ignored override, and MiniMax still generates an audio track successfully through the live provider path.

What was not tested: I did not verify MiniMax duration control because the official MiniMax API reference does not expose a documented duration request parameter.

Verification

  • pnpm docs:list
  • git diff --check
  • pnpm test extensions/minimax/music-generation-provider.test.ts
  • pnpm check:changed
  • node --import tsx --input-type=module ... capability/ignored-override proof shown above
  • OPENCLAW_LIVE_TEST=1 OPENCLAW_LIVE_TEST_QUIET=0 OPENCLAW_LIVE_MUSIC_GENERATION_PROVIDERS=minimax pnpm test:live -- extensions/music-generation-providers.live.test.ts --reporter=verbose

Out of Scope

  • Adding a MiniMax duration request field if MiniMax later documents one.
  • Refactoring MiniMax music generation into async task polling.
  • Changing other music providers that already have documented duration controls.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation extensions: minimax size: XS triage: mock-only-proof Candidate: PR proof only shows tests, mocks, snapshots, lint, typecheck, or CI. labels May 20, 2026
@clawsweeper

clawsweeper Bot commented May 20, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

Workflow note: Future ClawSweeper reviews update this same comment in place.

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.

Summary
The PR removes MiniMax duration capability advertising, stops appending duration hints to MiniMax prompts, drops duration metadata, and updates MiniMax docs and tests.

Reproducibility: yes. Current main source shows MiniMax advertises duration support, only prompt-embeds the requested duration, and sends no structured duration field; the linked issue also gives a concrete music_generate call and observed default-length output.

PR rating
Overall: 🐚 platinum hermit
Proof: 🦞 diamond lobster
Patch quality: 🐚 platinum hermit
Summary: The proof is strong and the patch is focused with no blocking findings, while the intentional compatibility change still needs maintainer acceptance.

Rank-up moves:

  • none
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.

Real behavior proof
Sufficient (terminal): The PR body includes redacted terminal proof for the patched capability/ignored-override behavior and a live MiniMax generation run after the patch.

Risk before merge

  • Merging intentionally changes existing MiniMax callers that pass durationSeconds: they will get normal ignored-override behavior instead of the old best-effort Target duration prompt hint and requestedDurationSeconds metadata.

Maintainer options:

  1. Accept MiniMax Duration As Unsupported (recommended)
    Merge as-is if maintainers agree that contract accuracy and ignored-override reporting are preferable to advertising an unenforceable prompt hint.
  2. Pause For A Vendor Field
    Pause or close this PR only if maintainers want to preserve duration steering until MiniMax documents a structured duration parameter.

Next step before merge
No automated code repair remains; a maintainer should accept or reject the MiniMax compatibility tradeoff and then land or close the linked fix path.

Security
Cleared: The diff narrows MiniMax request metadata and docs without changing auth, secrets, dependencies, downloads, CI, or package execution paths.

Review details

Best possible solution:

Merge this after maintainer acceptance of the compatibility tradeoff: MiniMax should not advertise duration support until the vendor publishes a structured duration request field.

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

Yes. Current main source shows MiniMax advertises duration support, only prompt-embeds the requested duration, and sends no structured duration field; the linked issue also gives a concrete music_generate call and observed default-length output.

Is this the best way to solve the issue?

Yes. The patch matches the official MiniMax request schema and reuses the existing shared unsupported-override path instead of inventing or relying on an undocumented vendor field.

Label changes:

  • add proof: sufficient: Contributor real behavior proof is sufficient. The PR body includes redacted terminal proof for the patched capability/ignored-override behavior and a live MiniMax generation run after the patch.
  • add rating: 🐚 platinum hermit: Current PR rating is 🐚 platinum hermit because proof is 🦞 diamond lobster, patch quality is 🐚 platinum hermit, and The proof is strong and the patch is focused with no blocking findings, while the intentional compatibility change still needs maintainer acceptance.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (terminal): The PR body includes redacted terminal proof for the patched capability/ignored-override behavior and a live MiniMax generation run after the patch.
  • remove rating: 🦐 gold shrimp: Current PR rating is rating: 🐚 platinum hermit, so this older rating label is no longer current.
  • remove status: ⏳ waiting on author: Current PR status label is status: 👀 ready for maintainer look.

Label justifications:

  • P2: This is a focused provider capability and docs correction for a user-visible MiniMax music-generation mismatch with limited blast radius.
  • merge-risk: 🚨 compatibility: The PR intentionally removes the old prompt-based duration hint and metadata path for existing MiniMax callers.
  • rating: 🐚 platinum hermit: Current PR rating is 🐚 platinum hermit because proof is 🦞 diamond lobster, patch quality is 🐚 platinum hermit, and The proof is strong and the patch is focused with no blocking findings, while the intentional compatibility change still needs maintainer acceptance.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (terminal): The PR body includes redacted terminal proof for the patched capability/ignored-override behavior and a live MiniMax generation run after the patch.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body includes redacted terminal proof for the patched capability/ignored-override behavior and a live MiniMax generation run after the patch.

What I checked:

  • Current main advertises unsupported MiniMax duration: Current main declares supportsDuration: true, appends Target duration to the MiniMax prompt, and records requestedDurationSeconds, while the actual JSON body has no structured duration field. (extensions/minimax/music-generation-provider.ts:109, c8a953af9371)
  • Shared runtime already has unsupported-override behavior: When a provider does not support duration, shared normalization drops durationSeconds and records it in ignoredOverrides, then runtime passes the sanitized request to the provider. (src/music-generation/normalization.ts:81, c8a953af9371)
  • PR head removes the runtime advertisement and prompt hint: At head 920a85c333ca7aac9792ccf1f4211736097d326c, MiniMax no longer declares supportsDuration, sends req.prompt.trim() directly, and no longer emits requestedDurationSeconds metadata. (extensions/minimax/music-generation-provider.ts:127, 920a85c333ca)
  • PR head aligns MiniMax docs and tests: The final PR commit removes MiniMax durationSeconds from supported-controls tables and removes the MiniMax duration steering provider note; the provider test asserts the request prompt is unchanged and no duration property is sent. Public docs: docs/tools/music-generation.md. (docs/tools/music-generation.md:102, 920a85c333ca)
  • Official MiniMax request contract has no duration field: The MiniMax OpenAPI schema for POST /v1/music_generation lists request properties such as model, prompt, lyrics, stream, output_format, audio_setting, lyrics_optimizer, is_instrumental, audio_url, audio_base64, and cover_feature_id; duration is not present in GenerateMusicReq.
  • Real behavior proof is present in the PR body: The PR body includes redacted terminal output showing patched capability resolution (supportsDuration: false, sanitized durationSeconds: null, ignored override recorded) plus a live MiniMax generation run with attempted=minimax:generate:music-2.6, skipped=none, and failures=none. (920a85c333ca)

Likely related people:

  • Ayaan Zaidi: Blame and git log -S show the MiniMax music-generation provider, shared music normalization, and matching docs were introduced together in the current main history by this commit. (role: introduced behavior and current area contributor; confidence: high; commits: e067203b2217; files: extensions/minimax/music-generation-provider.ts, src/music-generation/normalization.ts, src/music-generation/runtime.ts)

Codex review notes: model gpt-5.5, reasoning high; reviewed against c8a953af9371.

@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. labels May 20, 2026
@clawsweeper

clawsweeper Bot commented May 20, 2026

Copy link
Copy Markdown
Contributor

ClawSweeper PR egg

✨ Hatched: 🥚 common Moonlit Shellbean

Hatch command

Comment @clawsweeper hatch when this PR is hatchable.

Hatchability rules:

  • Merged PRs are hatchable.
  • Open PRs are hatchable when they are status: 👀 ready for maintainer look, status: 🚀 automerge armed, or labeled clawsweeper:automerge.
  • Closed unmerged PRs are hatchable only when one of those hatchable labels is still present in the durable record.

Rarity: 🥚 common.
Trait: polishes edge cases.
Image traits: location proof lagoon; accessory little merge flag; palette coral, mint, and warm cream; mood patient; pose waving from a small platform; shell smooth pearl shell; lighting soft studio lighting; background soft code-shaped tiles.
Share on X: post this hatch
Copy: My PR egg hatched a 🥚 common Moonlit Shellbean in ClawSweeper.

What is this egg doing here?
  • Eggs appear after the PR passes real-behavior proof. It is here for vibes, not verdicts: it does not change labels, ratings, merge decisions, or automation.
  • The shell reacts to review momentum: open follow-up work warms it up, re-review makes it wobble, and a clean final review lets it hatch.
  • Hatchability usually comes from sufficient real-behavior proof, no blocking P0/P1/P2 findings, no security attention needed, and clean correctness. A merged PR is already final, so merge makes the egg hatchable independently.
  • The hatch is seeded from this repository and PR number, so the same PR keeps the same creature; the reviewed head SHA can only change safe visual details.
  • Rarity is just collectible sparkle: 🥚 common, 🌱 uncommon, 💎 rare, ✨ glimmer, and 🌈 legendary.

@neeravmakwana

Copy link
Copy Markdown
Contributor Author

Added stronger real behavior proof to the PR body.

What I added:

  • Redacted terminal output from the live MiniMax run showing minimax:generate:music-2.6, skipped=none, and failures=none.
  • A patched-checkout proof script that imports the MiniMax provider plus shared music normalization and shows:
    • supportsDuration: false
    • requested durationSeconds: 30
    • sanitized durationSeconds: null
    • ignoredOverrides: [{ key: "durationSeconds", value: 30 }]

The live MiniMax log still has the API key redacted.

@clawsweeper re-review

@openclaw-barnacle openclaw-barnacle Bot added triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup. and removed triage: mock-only-proof Candidate: PR proof only shows tests, mocks, snapshots, lint, typecheck, or CI. labels May 20, 2026
@clawsweeper

clawsweeper Bot commented May 20, 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.

Re-review progress:

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. 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. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels May 20, 2026
@openclaw-barnacle openclaw-barnacle Bot removed the proof: sufficient ClawSweeper judged the real behavior proof convincing. label May 20, 2026
@neeravmakwana

Copy link
Copy Markdown
Contributor Author

I have updated the MiniMax provider doc too.
@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented May 20, 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.

Re-review progress:

@clawsweeper clawsweeper Bot added the proof: sufficient ClawSweeper judged the real behavior proof convincing. label May 20, 2026
@neeravmakwana

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@openclaw-barnacle openclaw-barnacle Bot removed the proof: sufficient ClawSweeper judged the real behavior proof convincing. label May 20, 2026
@clawsweeper

clawsweeper Bot commented May 20, 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.

Re-review progress:

@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: 🦐 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 May 20, 2026
@Takhoffman

Copy link
Copy Markdown
Contributor

@clawsweeper merge

@Takhoffman

Copy link
Copy Markdown
Contributor

@clawsweeper automerge

@clawsweeper clawsweeper Bot added the clawsweeper:automerge Maintainer opted this PR into bounded ClawSweeper-reviewed automerge label May 21, 2026
@clawsweeper

clawsweeper Bot commented May 21, 2026

Copy link
Copy Markdown
Contributor

🦞🔧
ClawSweeper automerge is enabled.

Draft PRs stay fix-only until GitHub marks them ready for review. Pause with /clawsweeper stop.

Automerge progress:

  • 2026-05-21 01:58:32 UTC review queued 920a85c333ca (queued)

@clawsweeper

clawsweeper Bot commented May 21, 2026

Copy link
Copy Markdown
Contributor

ClawSweeper 🐠 reef update

Thanks for the work here. GitHub would not let ClawSweeper push to this branch with the available credentials, so the fix moved to a narrow replacement PR. nothing personal, just permission currents.

Why replacement: ClawSweeper could not update the source PR branch directly; GitHub did not grant sufficient push rights to the bot for that branch.
Replacement PR: #84765
Why close: this run explicitly closes the superseded source PR after the credited replacement PR is open, so review continues in one place.
This source PR is being closed only under the explicit source-close setting for this ClawSweeper run.
The replacement PR carries the original credit trail forward.
Co-author credit kept:

fish notes: model gpt-5.5, reasoning high; reviewed against 1c616da.

@clawsweeper clawsweeper Bot closed this May 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

clawsweeper:automerge Maintainer opted this PR into bounded ClawSweeper-reviewed automerge docs Improvements or additions to documentation extensions: minimax merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XS status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[bug] MiniMax music_generation provider: durationSeconds is not passed to API, silently produces default-length tracks

2 participants