Skip to content

fix(settings): let media model fields take any vendor model id (#136) - #145

Open
Alphaxiaoteng wants to merge 1 commit into
0xsline:mainfrom
Alphaxiaoteng:fix/136-configurable-media-models
Open

fix(settings): let media model fields take any vendor model id (#136)#145
Alphaxiaoteng wants to merge 1 commit into
0xsline:mainfrom
Alphaxiaoteng:fix/136-configurable-media-models

Conversation

@Alphaxiaoteng

Copy link
Copy Markdown
Contributor

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.3 is already in the list but MiniMax-Hailuo-2.3-Fast and 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:

  1. modelSelect() emitted kind: 'select', which renders a closed <select>.
  2. minimaxVideoFamily() in server/plugins/video.ts threw on an id it did not recognize.

Change

  • modelSelectmodelPicker: emits kind: 'text' with the known ids as options. TextInput already renders kind: 'text' + options as <input list> + <datalist>, so this is a free-text field with autocomplete and no new renderer. defaultLabel is kept, so isModelField() 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-01 still requires a first frame, MiniMax-Hailuo-2.3 still rejects last-frame, 512p is still Hailuo-02 only).
  • Applied to all 7 affected fields: MINIMAX_IMAGE_MODEL, MINIMAX_VIDEO_MODEL, MINIMAX_MUSIC_MODEL, ATLASCLOUD_MUSIC_MODEL, ELEVENLABS_TTS_MODEL, MINIMAX_TTS_MODEL, SPEECHIFY_TTS_MODEL.
  • EN/IT/RU dictionaries for the new field note; src/components/settings/media-model-fields.verify.ts locks 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 0
  • npm run lint → 0 warnings / 0 errors on 1849 files
  • npx tsc -b → clean
  • npm run verify:i18ni18n 校验通过: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 locally

No 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 discoverableModel on the Agent-model providers).

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant