feat(tts): add Xiaomi MiMo-V2-TTS as speech provider#55614
Conversation
Greptile SummaryThis PR adds Xiaomi MiMo-V2-TTS as a new speech synthesis provider within the existing Xiaomi extension. The implementation correctly follows the established Confidence Score: 4/5Safe to merge after regenerating and committing the bundled plugin metadata snapshot. The speech provider implementation itself is correct and follows existing patterns. The single remaining blocker is the stale generated file — a one-command fix with no architectural change required. src/plugins/bundled-plugin-metadata.generated.ts — needs to be regenerated to reflect the new contracts.speechProviders: ["mimo"] entry for the xiaomi plugin.
|
| Filename | Overview |
|---|---|
| extensions/xiaomi/speech-provider.ts | New MiMo TTS speech provider implementing the non-standard chat-completions API. Structure, error handling, and auth fallback pattern all follow existing codebase conventions correctly. |
| extensions/xiaomi/index.ts | Minimal addition of the register hook that calls api.registerSpeechProvider(buildMimoSpeechProvider()). Correctly follows the same pattern used by other speech-provider plugins. |
| extensions/xiaomi/openclaw.plugin.json | Added contracts.speechProviders: ["mimo"] — correct intent, but the downstream generated file (bundled-plugin-metadata.generated.ts) was not regenerated, leaving the system's capability metadata stale and the CI check failing. |
Prompt To Fix All With AI
This is a comment left during a code review.
Path: extensions/xiaomi/openclaw.plugin.json
Line: 3-5
Comment:
**Generated metadata file not regenerated**
`openclaw.plugin.json` was updated to add `contracts.speechProviders: ["mimo"]`, but the auto-generated file `src/plugins/bundled-plugin-metadata.generated.ts` was not regenerated. The xiaomi entry in that file still has no `contracts` key.
This has two concrete consequences:
1. `BUNDLED_SPEECH_PLUGIN_IDS` (computed from the generated file in `src/plugins/bundled-capability-metadata.ts:61`) will not include `"xiaomi"`, so the system has no record that the xiaomi plugin contributes a speech provider.
2. The `pnpm check:bundled-plugin-metadata` CI step (which runs `node scripts/generate-bundled-plugin-metadata.mjs --check`) will fail because the generated file no longer matches the actual plugin JSON on disk.
Run `node scripts/generate-bundled-plugin-metadata.mjs` from the repo root to regenerate the file and commit the result.
How can I resolve this? If you propose a fix, please make it concise.Reviews (2): Last reviewed commit: "fix: correct plugin manifest contracts a..." | Re-trigger Greptile
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 360f47083c
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3e2982773f
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
Add MiMo-V2-TTS support as a new speech synthesis provider in the existing Xiaomi extension. MiMo TTS uses a non-standard endpoint (/v1/chat/completions with audio field) and authenticates via api-key header instead of Bearer token. Features: - Natural language style control via <style> tags - Three voices: mimo_default, default_zh, default_en - Support for dialects, role-playing, and singing synthesis - Currently free (no API cost) Configuration: messages.tts.provider: "mimo" messages.tts.providers.mimo.apiKey: "sk-xxx" Or set MIMO_API_KEY environment variable. Closes openclaw#52376
- voiceCompatible: false for WAV output (not in allowed voice-note formats) - regenerate bundled-plugin-metadata with speechProviders contract
MiMo TTS supports wav, mp3, pcm, pcm16 formats. Switch from wav to mp3: - MP3 is compatible with OpenClaw voice-note channels (Feishu, Telegram) - WAV caused voiceCompatible issues per src/media/audio.ts - MP3 is ~8x smaller (19KB vs 150KB for similar text)
MiMo TTS and text models share the same API platform. TTS provider now falls back to XIAOMI_API_KEY so users only need one key for both text inference and speech synthesis.
Co-authored-by: Copilot <[email protected]>
bd74745 to
15437c2
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 15437c22ec
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| aliases: ["xiaomi", "mimo"], | ||
| models: MIMO_TTS_MODELS, | ||
|
|
||
| isConfigured: ({ providerConfig }) => | ||
| Boolean( |
There was a problem hiding this comment.
Normalize Xiaomi alias-backed TTS config lookup
This provider advertises xiaomi as an alias, but it does not normalize alias config keys to the canonical mimo id. In extensions/speech-core/src/tts.ts (resolveRawProviderConfig), TTS settings are resolved by canonical provider id, so messages.tts.providers.xiaomi.* is ignored and only messages.tts.providers.mimo.* is read; users who select provider: "xiaomi" and configure providers.xiaomi.apiKey will still hit not configured / MiMo API key missing unless an env var is present. Please add alias-aware resolveConfig handling (or remove the alias) so alias selection and config paths stay consistent.
Useful? React with 👍 / 👎.
|
Deep review against current Positive evidence:
Blockers:
So: correct feature, API verified live, not solved on |
|
Superseded by the implementation landed on I kept the feature from this PR, but rebuilt it with the missing maintainer pieces:
Verification on the landed code:
Closing this PR as superseded by the landed mainline fix. Thanks for pushing the Xiaomi TTS gap forward. |
Summary
Add Xiaomi MiMo-V2-TTS as a new speech synthesis provider in the existing Xiaomi extension.
Closes #52376
Motivation
MiMo-V2-TTS provides high-quality Chinese TTS with unique capabilities:
Implementation
Uses the existing Xiaomi extension. MiMo TTS uses a non-standard API:
/v1/chat/completions(not/v1/audio/speech)api-keyheader (notAuthorization: Bearer)message.audio.database64, 24kHz 16bit mono MP3Configuration
Files Changed
extensions/xiaomi/speech-provider.tsextensions/xiaomi/index.tsextensions/xiaomi/openclaw.plugin.jsonTesting
pnpm buildpassesAI-assisted (OpenClaw + GitHub Copilot). Fully tested.