-
-
Notifications
You must be signed in to change notification settings - Fork 79.1k
[feature] MiniMax music_generation provider: use async-task polling instead of single blocking HTTP request #84506
Copy link
Copy link
Closed
Labels
P2Normal backlog priority with limited blast radius.Normal backlog priority with limited blast radius.clawsweeper:needs-live-reproClawSweeper needs live local, crabbox, or manual validation to confirm this issue.ClawSweeper needs live local, crabbox, or manual validation to confirm this issue.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.ClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.issue-rating: 🐚 platinum hermitGood issue quality with a plausible reproduction path needing some confirmation.Good issue quality with a plausible reproduction path needing some confirmation.
Metadata
Metadata
Assignees
Labels
P2Normal backlog priority with limited blast radius.Normal backlog priority with limited blast radius.clawsweeper:needs-live-reproClawSweeper needs live local, crabbox, or manual validation to confirm this issue.ClawSweeper needs live local, crabbox, or manual validation to confirm this issue.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.ClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.issue-rating: 🐚 platinum hermitGood issue quality with a plausible reproduction path needing some confirmation.Good issue quality with a plausible reproduction path needing some confirmation.
Type
Fields
Give feedbackNo fields configured for issues without a type.
Summary
The MiniMax music_generation provider in
extensions/minimax/music-generation-provider.tsuses a single blocking HTTP request tohttps://api.minimax.io/v1/music_generation. Any track that takes longer to render than the provider'sDEFAULT_TIMEOUT_MS(120s) fails with a fetch timeout — even though the MiniMax API is still working server-side and would have returned audio.This is normal MiniMax behavior for full-length tracks (240-300s of audio typically take 2-5 minutes wall-clock to render). It is impossible to reliably generate a full-length track through this provider with the current default timeout.
The bug is structural, not a timeout-tuning issue. Even with
agents.defaults.musicGenerationModel.timeoutMs = 600000as a workaround, a single long-lived HTTP connection across that span is fragile (proxies, dispatcher pools, connection resets).Reproduction
agents.defaults.musicGenerationModel.primary = "minimax/music-2.6".MINIMAX_API_KEYin env.music_generatewith a prompt targetingdurationSeconds: 240-300.fetch-timeout: timeoutMs=120000, elapsedMs=120001.Gateway log signature:
Proposed Fix
MiniMax's API supports async-task polling for music generation, identical in shape to their video API:
POST /v1/music_generation→ returnstask_idimmediatelyGET /v1/query/music_generation?task_id=<id>→ poll untilstatus: "Success"or"Fail"audio_urlThis pattern is already implemented in the same extension for video generation: see
extensions/minimax/video-generation-provider.ts, thepollMinimaxVideo()function (~line 160). It uses the project's standardcreateProviderOperationDeadline(),waitProviderOperationPollInterval(), andMAX_POLL_ATTEMPTShelpers — all readily reusable for apollMinimaxMusic()sibling.Porting the same pattern to
music-generation-provider.tswould:timeoutMsoperation deadline up to the runtime'sagents.defaults.musicGenerationModel.timeoutMsconfigWorkaround until fixed
This makes full-length renders succeed in normal cases but doesn't fix the structural fragility of a multi-minute blocking HTTP connection.
Impact
Anyone using MiniMax as their primary music-generation provider for tracks longer than ~2 minutes (i.e. anything beyond a short clip) hits this. NOVA's daily music composition pipeline was silently falling through to Google Lyria (3-min hard cap, abrupt ending) every day because of it.
Environment
extensions/minimax/music-generation-provider.tsminimax/music-2.6