fix(sse): add the missing minimax-music dispatch to music generation - #10650
Merged
diegosouzapw merged 1 commit intoAug 21, 2026
Conversation
The minimax provider entry declares format "minimax-music" in the music registry and its models are published by the specialty catalog, but handleMusicGeneration had no branch for that format, so every request for those models fell through to "Unsupported music format: minimax-music". Add the handler for the format: a single synchronous POST that maps the documented request fields, keeps the response non-streaming, supports the url and hex output formats (hex normalized to base64), restricts the audio container to the accepted ones, verifies the base_resp envelope, and reads the audio only once the generation reports itself finished - the operation exposes no task id and no query endpoint, so an unfinished generation is reported back instead of polled. Wire the format into the dispatch chain, complete the registry entry with the generation and cover model ids, and declare the regional endpoint reachable through the per-connection base URL override, which is also the only endpoint that accepts the watermark field.
Owner
|
Reviewed and validated: checked out the branch, ran |
muhamadgalihsaputra
pushed a commit
to niyatna/NiyatnaRoute
that referenced
this pull request
Sep 27, 2026
…iegosouzapw#10650) Obrigado — bug real: MUSIC_PROVIDERS.minimax declara format "minimax-music" e seus modelos são publicados pelo catálogo, mas handleMusicGeneration nunca teve um branch para esse format — todo request minimax/* caía no guard final com "Unsupported music format", modelos anunciados mas inalcançáveis. Handler completo cobrindo os dois output formats (url/hex), envelope base_resp, endpoint regional, e guarda local de credencial ausente. Validação (worktree própria a partir de origin/release/v3.8.50, merge limpo, 0 conflitos): - typecheck:core limpo, complexity/cognitive-complexity dentro do baseline - tests/unit/minimax-music-generation.test.ts — 9/9 passando
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Reason: registered MiniMax music models were impossible to call because the music handler had no branch for their provider format.
Problem
MUSIC_PROVIDERS.minimaxdeclaresformat: "minimax-music"and its models are published byGET /v1/music/generationsand by the specialty model catalog, buthandleMusicGenerationnever grew a branch for that format. Everyminimax/*music request fell through the whole dispatch chain to the final guard and came back as:So the models were advertised while being unreachable, and no open or merged PR adds the missing handler.
Change
open-sse/handlers/mediaGeneration/minimaxMusic.ts(new) — theminimax-musichandler. The upstream operation is a single synchronous POST, so the handler:model,prompt,lyrics,output_format,audio_setting,lyrics_optimizer,is_instrumental,audio_url,audio_base64andcover_feature_id, forwarding only the fields the caller actually supplied (instrumentalis accepted as the alias the route already uses);stream: false— this route answers with a single JSON payload, and streaming responses are restricted to the hex output format anyway;url(a link that expires after 24h) is returned as{ url, format },hexis decoded and returned as{ b64_json, format }, rejecting malformed hex instead of lettingBufferdrop bad nibbles silently;audio_setting.formatto themp3/wav/pcmcontainers the endpoint accepts and reports the resolved container back to the caller;base_respenvelope (a non-zerostatus_codealso arrives on HTTP 200) and reads the audio fromdata.audioonly oncedata.statussays the generation finished — an unfinished generation is reported back rather than polled, because this operation has no task id and no query endpoint;saveCallLoglike the other media handlers.open-sse/handlers/musicGeneration.ts— dispatchminimax-musicto that handler, next to the other provider-format branches.open-sse/config/musicRegistry.ts— add the generation and cover model ids the entry was missing, declare the regional endpoint (regionalBaseUrl), and drop the query URL that does not exist for this operation. A connection reaches the regional endpoint through the existing per-connectionproviderSpecificData.baseUrloverride; that endpoint is also the only one that accepts theaigc_watermarkrequest field, so the field is forwarded there and dropped otherwise.tests/unit/minimax-music-generation.test.ts(new) — 9 regression tests: registry shape, dispatch + URL normalization + request-field mapping, hex → base64, cover inputs, regional endpoint + regional-only field,base_respfailure on HTTP 200, unfinished generation, completed-without-audio, upstream HTTP failure, and the missing-credential guard.changelog.d/fixes/minimax-music-generation-dispatch.md— changelog fragment.No behavior changes for any other music provider format: the new branch is additive and sits before the unsupported-format guard.
Checks
Run in this environment:
node --test tests/unit/minimax-music-generation.test.ts— 9/9 pass. Executed with Node 24's native TypeScript execution; the usage-log module (@/lib/usageDb) was stubbed because the workspace dependencies could not be installed here, sonpm run test:unitand the ESLint / typecheck gates still need to run in CI.node scripts/check/check-changelog-integrity.mjs— OK.node scripts/check/check-file-size.mjs— OK (no baseline change needed: the new files are well under the cap andmusicGeneration.tsis not frozen).