Skip to content

[feat] providers: add MiniMax speech with system voices - #283

Open
wuli666 wants to merge 2 commits into
ThinkFlowLab:mainfrom
wuli666:feat/minimax-tts
Open

wuli666 wants to merge 2 commits into
ThinkFlowLab:mainfrom
wuli666:feat/minimax-tts

Conversation

@wuli666

@wuli666 wuli666 commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

Summary

MiniMax speech could not be used through the mainland provider preset. This adds MiniMax Official Speech with speech-2.8-hd and speech-2.8-turbo, system voice selection, and persisted MP3 results through the shared UI and Agent services.

  • Use POST /v1/t2a_v2 for non-streaming synthesis and POST /v1/get_voice for the read-only system voice catalog. Preserve voice IDs containing spaces and parentheses, including trailing spaces.
  • Reject unsupported official speech model IDs when saving, and missing voices, unsupported references and text over 9,999 characters before accepting a job. Revalidate account-scoped selections through the live registry.
  • Classify HTTP-200 provider failures without persisting raw response text. Treat malformed or incomplete submissions as unknown. Save result URLs before downloading; recovery never submits another synthesis request and preserves the accepted model snapshot and public-download checks after model removal or replacement, without borrowing current credentials.
  • Reuse the checked public-result downloader and real media probe. Ship matching Chinese/English labels, errors, user documentation and model branding.

Scope is mainland China synchronous speech with system voices. Cloning, voice design, voice deletion, streaming and international endpoints are outside this change.

Linked issue

Refs #240. This addresses its mainland MiniMax minimum-workflow speech gap; it does not close the broader provider tracking issue.

Labels

Requested: type:feat, area:provider, area:canvas, area:i18n, modality:audio, provider:minimax.

Test plan

Local macOS arm64, Python 3.12.9, Node 24.22.2. Based on upstream bd0727c2.

  • tests/test_minimax_speech.py: 70 passed, covering official-model routing, localized and atomic rejection of unsupported models, system voice identity/account scope, Agent voice queries, malformed responses, HTTP-200 errors, UI/Agent acceptance, real MP3 probing, idempotent replay, project reopening, and recovery after configuration removal or replacement. Recovery cases reject private URLs, private DNS answers and private redirects without another synthesis submission.
  • 239 related Python tests passed across test_generation_recovery.py, test_result_download_security.py, test_model_configs.py, test_moss.py, and test_creation_generation_service.py.
  • 23 targeted frontend tests passed across modelBrands.test.ts, providerPresets.test.ts, and generationFailureText.test.ts.
  • npm run build, npm run check:i18n, npm run check:browser-locale, npm run check:browser-manifest, lint-imports, and scripts/generate_contracts.py --check passed.
  • tests/browser/voice_library.mjs passed in both languages with CI's pinned Playwright 1.58.2 against voice_library_server.py: preset save/reopen, localized unknown-model errors, key privacy, read-only system voices, exact selected IDs, HD/Turbo selection retention, text-length precheck, saved execution inputs, project reopening and actual local-audio playback. Both new error presentations were visually checked.

At c13c80ff, Linux CI passed the full Python suite, frontend tests, production build and installed-wheel checks. Only Voice library workflows failed: the refresh had no acknowledged session release, then repeated open-canvas 409 responses before the saved-state timeout. The persisted-audio reopen check now acknowledges the page's release request before refreshing. A focused probe dropping the native unload-time release reproduced eight conflicts without this step and zero with it. This verifies persisted-audio reopening; it does not establish why native unload delivery failed on that runner. The follow-up commit requires a fresh Linux CI result. Windows, manual timeline export and the full local CI suite were not rerun.

Evidence that it works

These screenshots use a mocked system voice catalog, not a live MiniMax account. The browser workflow generates a local WAV fixture; the Python lifecycle cases use real MP3 bytes with mocked HTTP.

English MiniMax system voice library

中文 MiniMax 系统音色库

Provider verification

No real MiniMax service calls were made. Wire fields and endpoint scope were checked against the official T2A documentation, voice catalog API, and error codes. Live account access, generated speech quality and the one-account multi-modality workflow have not been verified. Result URLs have a provider-defined 24-hour lifetime; expired URLs cannot be refreshed by this synchronous integration.

Bilingual UI

Both locales are updated and were exercised in Chromium. User guides and screenshots are included in both languages. Stored IDs and business values remain unchanged when the display language changes.

AI assistance

This contribution was developed with Codex assistance.

## summary

- Add mainland MiniMax synchronous TTS and a read-only system voice
  library through the shared generation and voice services.
- Preserve provider voice IDs, validate accepted inputs, classify
  HTTP-200 failures, and recover public MP3 downloads without reposting.
- Add bilingual presets, errors, docs, browser evidence and regression
  tests for UI/Agent use, persisted media and recovery.

## validation

- MiniMax speech: 58 tests passed; related generation, model, voice,
  media download security and contract suites passed.
- npm test: 768 passed. Build, import boundaries, generated contracts,
  i18n, browser locale and manifest checks passed.
- Bilingual voice-library browser workflow passed with mocked HTTP
  and local WAV playback. Python cases probe real MP3 fixture bytes.
- No live MiniMax calls or perceptual voice-quality checks were made.

Refs: ThinkFlowLab#240
## summary

- Recover downloads with the accepted model snapshot and no credentials,
  preserving public-host checks after configuration removal or replacement.
- Reject unsupported official speech models through shared input rules,
  with bilingual errors, atomic save coverage and updated contracts.
- Acknowledge session release before the persisted-audio browser check
  reloads, avoiding dependence on unload-time request delivery.

## validation

- 70 MiniMax tests, 239 related Python tests and 23 frontend tests passed.
- Bilingual voice workflow passed with Playwright 1.58.2.
- Build, i18n, browser manifests, import boundaries and contracts passed.
- Provider HTTP was mocked; live MiniMax synthesis was not checked.
@wuli666
wuli666 marked this pull request as ready for review November 11, 2026 03:13
@github-actions github-actions Bot added area:i18n Localisation and bilingual UI area:provider Model providers and generation protocols modality:audio Speech, music or audio processing provider:minimax MiniMax H3 / speech / music services type:feat New capability or behaviour labels Nov 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:i18n Localisation and bilingual UI area:provider Model providers and generation protocols modality:audio Speech, music or audio processing provider:minimax MiniMax H3 / speech / music services type:feat New capability or behaviour

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant