fix(settings): let media model fields take any vendor model id (#136) - #145
Open
Alphaxiaoteng wants to merge 1 commit into
Open
fix(settings): let media model fields take any vendor model id (#136)#145Alphaxiaoteng wants to merge 1 commit into
Alphaxiaoteng wants to merge 1 commit into
Conversation
The image, video, music and TTS model fields rendered as a plain <select>, so a vendor model released after our hard-coded option list was unreachable until we shipped a new build — 0xsline#136. modelPicker keeps the same ids as autocomplete suggestions but stores free text, so any id the vendor accepts can be saved. Relaxing the UI alone was not enough: minimaxVideoFamily threw on an id outside its list, so MINIMAX_VIDEO_MODEL still failed at request time. An uncategorized id now maps to the 'unknown' family and gets the current-generation request shape, with MiniMax judging the id itself. Families we have categorized keep their exact constraints, including first-and-last-frame and 512p staying Hailuo-02-only for known models.
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
#136— the model fields in 设置 were locked<select>lists, so a model the vendor shipped after our list was written was unreachable until a new OpenChatCut release. MiniMax video is the concrete case:MiniMax-Hailuo-2.3is already in the list butMiniMax-Hailuo-2.3-Fastand any future id are not.The lock was two-layer, so opening only the dropdown would have shipped a field that saves and then fails at generation time:
modelSelect()emittedkind: 'select', which renders a closed<select>.minimaxVideoFamily()inserver/plugins/video.tsthrew on an id it did not recognize.Change
modelSelect→modelPicker: emitskind: 'text'with the known ids asoptions.TextInputalready renderskind: 'text'+optionsas<input list>+<datalist>, so this is a free-text field with autocomplete and no new renderer.defaultLabelis kept, soisModelField()and the discovered-model picker behave exactly as before.minimaxVideoFamily()returns'unknown'for an id outside the categorized list instead of throwing.'unknown'invents no capability constraints — an uncategorized model gets the current-generation request shape and MiniMax answers for itself. Every model we have categorized keeps its exact constraints (S2V-01still requires a first frame,MiniMax-Hailuo-2.3still rejects last-frame,512pis still Hailuo-02 only).MINIMAX_IMAGE_MODEL,MINIMAX_VIDEO_MODEL,MINIMAX_MUSIC_MODEL,ATLASCLOUD_MUSIC_MODEL,ELEVENLABS_TTS_MODEL,MINIMAX_TTS_MODEL,SPEECHIFY_TTS_MODEL.src/components/settings/media-model-fields.verify.tslocks the shape (kind, suggestions,isModelField) so these cannot regress into closed selects.Verification
Run on Node 24 (matching CI):
npm test→ exit 0 (all 576 tracked verify files are registered)npm run build(tsc -b && vite build) → exit 0npm run lint→ 0 warnings / 0 errors on 1849 filesnpx tsc -b→ cleannpm run verify:i18n→i18n 校验通过:149 个 UI 文件,2458 个英文词条tsx server/plugins/video.verify.ts→ ok, including a synthetic future id (MiniMax-Hailuo-9.9) that must reach the request builder instead of being rejected locallyNo real vendor credentials are involved — the new assertions use a synthetic model id.
Scope note
This only makes the field configurable; it does not add per-vendor model discovery to these fields (that already exists separately via
discoverableModelon the Agent-model providers).