Repository navigation
fix(audio): send Xiaomi MiMo TTS audio.format as the mp3/wav enum - #15752
Merged
diegosouzapw merged 2 commits intoOct 8, 2026
Merged
diegosouzapw merged 2 commits into
diegosouzapw merged 2 commits into
Conversation
Xiaomi's TTS API expects `audio.format` to be the enum `mp3` | `wav`, but the handler forwarded an IANA media type (`audio/mpeg` / `audio/wav`), so every `POST /v1/audio/speech` for mimo-v2.5-tts failed upstream with 400 "Param Incorrect". The media type now only feeds the response Content-Type, an unsupported response_format still returns the same 400 without calling upstream, and a missing response_format defaults to `mp3`.
Contributor
Author
|
CI note: the failing checks in this run are pre-existing drift on Evidence:
Scope stays minimal: enum fix + tests + changelog fragment — no baseline widening, no unrelated fixes. |
diegosouzapw
merged commit Oct 8, 2026
7963e88
into
diegosouzapw:release/v3.8.52
29 of 51 checks passed
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.
Summary
POST /v1/audio/speech,mimo-v2.5-tts) failed upstream with400 Param Incorrectfor everyresponse_format. The upstream body fieldaudio.formatwas populated with an IANA media type (audio/mpeg/audio/wav) instead of themp3|wavenum the MiMo chat-completions audio API requires.Related Issues
Validation
npm run lintTests Added Or Updated
tests/unit/audio-speech-handler.test.tsaudio.format: "audio/wav"→"wav") — it encoded the bug;response_formatmust send the enum"mp3"(never an IANA media type);response_format(ogg) returns 400 without calling upstream.open-sse/handlers/audioSpeech.tsmakes exactly the 2 MiMo tests fail.Coverage Notes
open-sse/handlers/audioSpeech.ts; the new unit tests covernormalizeXiaomiMimoRequestFormat()(enum mapping, default, rejection) end-to-end throughhandleAudioSpeechwith a mockedfetch. Coverage does not move down.Reviewer Notes
normalizeXiaomiMimoMimeType()is kept unchanged and is still the source for the responseContent-Type; only theaudio.formatrequest field switches to the enum. Invalidresponse_formatstill returns 400 before any upstream call.pcm/pcm16remain unsupported (out of scope; the client-facing 400 message is unchanged).check:open-sse-typecheckfails onopen-sse/services/apiKeyRotator.ts(TS2484) on a cleanrelease/v3.8.52checkout as well — pre-existing, untouched.