Repository navigation
Magenta RealTime 2: accept the legacy duration_seconds field and add the missing WebUI catalog entry - #1158
Merged
0xShug0 merged 3 commits intoNov 1, 2026
Conversation
The server forwards the top-level duration_seconds field verbatim, and the WebUI gen path sends that legacy field to every family except controlfoley and midashenglm_gen. Magenta RealTime 2 validated raw option keys against its schema-v1 contract before parsing, so GUI music requests failed with "unknown Magenta RealTime 2 request option: duration_seconds". Normalize legacy request names with apply_option_v1_compatibility before the whitelist check, as stable_audio and heartmula already do, and parse all options from the normalized map. Sending both spellings still fails with the explicit use-duration_sec error.
PR 0xShug0#1121 added the family everywhere except models_catalog.json, so a Magenta RealTime 2 model configured through the server config found no catalog base and its GUI entry carried no request_options metadata. With that metadata missing, supportsMaxTokens fell back to the task-based assumption and sent max_tokens with every gen request, which magenta's strict schema-v1 whitelist rejected with "unknown Magenta RealTime 2 request option: max_tokens". Add the catalog entry following the other music-gen families, and regenerate the embedded dist bundle. Config-defined magenta entries now match the catalog by family and task, get their request options from the family spec, and no longer send max_tokens.
Owner
|
Thanks for the PR! AFK now and I will check the PR later today. |
Owner
|
@noctrex It's a WebUI integration bug rather than the model issue. After v0.9.2, new models are expected to use normalized option names instead of ad-hoc ones. Released models can still use the old names for compatibility, but new models should not. I just updated the PR directly. Update: PR merged. |
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.
Problem
Two requests to a Magenta RealTime 2 model configured through the server config fail from the WebUI with strict-whitelist rejections:
No issue or PR for this exists yet (searched before opening this one).
Root causes
1.
duration_seconds(server side). The request parser forwards the top-levelduration_secondsfield verbatim into the options map (app/cli/request.cpp), and the WebUI's sharedgenpath sends exactly that legacy field to every family exceptcontrolfoleyandmidashenglm_gen(+page.svelte:2213). Magenta RealTime 2 is spec-backed and validates every option key against its schema-v1 contract before parsing (magenta_realtime_2/session.cpp), and its spec declares onlyduration_sec- so GUI music requests were rejected before generation started.2.
max_tokens(WebUI side). PR #1121 added the family everywhere exceptwebui/configs/models_catalog.json. A config-defined magenta model therefore finds no catalog base (exact id or family+task), and its GUI entry carries norequest_optionsmetadata. With the metadata missing,supportsMaxTokensfalls back to the task-based assumption ("task gen -> yes"), shows the max-tokens field, and sendsmax_tokenson every request - which magenta's strict whitelist rejects. Every other music family (ace_step, heartmula, stable_audio, yue2) has a catalog entry, which is why only magenta misbehaves.Fixes
runtime::apply_option_v1_compatibility({{"duration_seconds", "duration_sec"}}, ...)before the whitelist check, the same patternstable_audio/request.cppandheartmula/session.cppalready use, and parse all options from the normalized map. Sending both spellings still fails with the explicit "options contain both ...; use duration_sec" error.magenta_realtime_2catalog entry following the other music-gen families, and regenerate the embeddeddist/index.html. Config-defined magenta entries now match the catalog by family and task, take their request options from the family spec, and no longer sendmax_tokens.Both changes are needed: the catalog fix alone does not help
duration_seconds(the GUI still sends the legacy field to families outside the hardcoded two), and the server shim alone cannot fixmax_tokens(the field is meaningless for a duration-driven model, so accepting it would pollute the spec).Testing
--backend rocm, model: config-definedmagenta-rt2-base-f16.gguf(2.4B Base, F16).npm run checkreports 0 errors / 0 warnings;npm run buildregenerateddist/index.html.duration_secondsandduration_sectogether still fails with the explicit error, matching stable_audio's behavior.LLM Disclamer: I had the help of a clanker.