fix(minimax): stream music generation responses#84561
Conversation
|
Codex review: needs maintainer review before merge. Workflow note: Future ClawSweeper reviews update this same comment in place. How this review workflow works
Summary Reproducibility: no. independent live reproduction was performed in this read-only review. Source inspection confirms the provider-level direct POST used the 120s fallback when no runtime timeout reached it, and the linked issue plus PR body provide the observed timeout and after-fix live-run details. PR rating Rank-up moves:
What the crustacean ranks mean
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 Risk before merge
Maintainer options:
Next step before merge Security Review detailsBest possible solution: Land the provider-local streaming fix after required checks if maintainers accept the documented streaming API as the supported MiniMax path; ask for redacted raw live logs only if the proof gate remains disputed. Do we have a high-confidence way to reproduce the issue? No independent live reproduction was performed in this read-only review. Source inspection confirms the provider-level direct POST used the 120s fallback when no runtime timeout reached it, and the linked issue plus PR body provide the observed timeout and after-fix live-run details. Is this the best way to solve the issue? Yes, this looks like the best supported implementation path: MiniMax documents stream plus hex output for music generation, while the proposed polling endpoint is not in the docs and was reportedly 404 in a live probe. Keeping JSON/audio fallbacks also limits compatibility risk if MiniMax returns the older shape. Label changes:
Label justifications:
What I checked:
Likely related people:
Codex review notes: model gpt-5.5, reasoning high; reviewed against 99c88629c336. |
|
ClawSweeper PR egg ✨ Hatched: 🥚 common Cosmic Lint Imp Hatch commandComment Hatchability rules:
Rarity: 🥚 common. What is this egg doing here?
|
|
@clawsweeper hatch |
|
🦞👀 I queued a comment sync for this PR. If the egg is hatchable, ClawSweeper will generate the image once and update the existing review comment. |
|
ClawSweeper could not hatch this PR egg yet. Reason: there is no current durable ClawSweeper review record for this PR, so there is no PR egg state record to update. |
|
@clawsweeper automerge |
|
🦞🔧
Draft PRs stay fix-only until GitHub marks them ready for review. Pause with Automerge progress:
|
|
ClawSweeper 🐠 reef update Thanks for the work here. ClawSweeper could not write to the source branch, so it opened a replacement PR rather than letting the fix drift. attribution still points back here. Why replacement: ClawSweeper could not update the source PR branch directly; GitHub did not grant sufficient push rights to the bot for that branch.
fish notes: model gpt-5.5, reasoning high; reviewed against cd49fa8. |
Summary
Root Cause
MiniMax music generation can take longer than the provider's 120s request fallback. The provider sent one non-streaming generation request and tied the whole operation to that short request timeout, so longer tracks could fail before OpenClaw received usable audio.
Fixes #84506.
Why This Is Safe
The change is limited to the bundled MiniMax music-generation provider. It keeps the same auth resolution, base URL resolution, SSRF/private-network policy, model selection, mp3-only output contract, and existing JSON response fallback paths. Streaming frames are decoded only from MiniMax's response body, and provider
base_resperrors continue to fail the request.Security/runtime controls unchanged: MiniMax credentials still come from the existing provider auth flow, downloads still use the provider download helper, private-network access remains disabled by default, and no prompt-based policy or security behavior was added.
Real behavior proof
Behavior addressed: MiniMax music generation no longer fails at the old 120s request fallback when generation takes longer than that window.
Real environment tested: Local macOS checkout running this branch, using
MINIMAX_API_KEYfrom local.envwithout printing the key.Exact steps or command run after this patch: A local
node --import tsxscript invoked the patched MiniMax provider withminimax/music-2.6,instrumental=true,durationSeconds=130,format=mp3, andtimeoutMs=300000. A second localnode --import tsxscript invoked the patched OpenClawmusic_generatetool withminimax/music-2.6,instrumental=true,durationSeconds=20,format=mp3, and saved the generated media.Evidence after fix: Provider proof logs showed
POST https://api.minimax.io/v1/music_generationreturned200 text/event-streamafter 119819ms and completed after 159219ms with oneaudio/mpegtrack of 3130558 bytes. Tool proof logs showed localmusic_generategenerated oneminimax/music-2.6audio attachment and saved oneaudio/mpegpath after a provider request lasting 136518ms plus download.Observed result after fix: Both live runs completed successfully; the tool run produced a generated audio attachment instead of timing out.
What was not tested: A 240-300 second live MiniMax track was not run to avoid additional provider spend. Telegram/channel delivery was not tested because this PR only changes the MiniMax music provider HTTP flow.
Verification
pnpm exec oxfmt --write --threads=1 extensions/minimax/music-generation-provider.ts extensions/minimax/music-generation-provider.test.tspnpm test extensions/minimax/music-generation-provider.test.tsgit diff --checkpnpm check:changeddurationSeconds=130, redacted logsmusic_generatetool proof withdurationSeconds=20, redacted logsOut of Scope
GET /v1/query/music_generationreturned404, so this PR uses the live-backed streaming contract instead.Made with Cursor