fix(openai): route MP3 TTS through voice delivery#100715
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: aed99881fd
ℹ️ About Codex in GitHub
Your team has set up Codex to 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 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| ### Fixes | ||
|
|
||
| - **OpenAI Realtime Codex auth:** reuse external Codex OAuth profiles for Realtime voice sessions when no explicit OpenAI API key is configured. | ||
| - **OpenAI-compatible TTS voice notes:** route configured MP3 speech output through native voice-message delivery when the channel supports it, while keeping WAV output on the audio-file path. (#83227, #80317) Thanks @HemantSudarshan. |
There was a problem hiding this comment.
Remove this non-release changelog entry
For this normal fix commit, adding a manual Unreleased entry conflicts with the root AGENTS.md Docs/Changelog rule that CHANGELOG.md is release-only and release generation owns it; keeping this line risks duplicate or stale release notes when entries are generated from merged PRs and direct commits. Please keep the release-note context in the commit/PR body and remove this line.
Useful? React with 👍 / 👎.
Co-authored-by: Hemantsudarshan <[email protected]>
aed9988 to
a95d22c
Compare
|
Merged via squash.
|
Co-authored-by: Hemantsudarshan <[email protected]>
Co-authored-by: Hemantsudarshan <[email protected]>
What Problem This Solves
OpenAI-compatible TTS configured with
responseFormat: "mp3"reports voice-note output as incompatible. Speech-core then keeps the result on audio-file delivery even though Telegram's native voice-message path and the shared media contract accept MP3.Closes #80317. Supersedes the conflicting, non-maintainer-editable #83227 while preserving its contributor credit.
Why This Change Was Made
The OpenAI speech provider now derives compatibility from the existing shared voice-message media policy instead of maintaining an Opus-only provider rule. The produced file extension is computed once and passed to that policy; voice-note MP3 and Opus remain compatible, while WAV remains an audio file.
This keeps format policy at its existing owner boundary. Existing speech-core tests own provider-metadata routing, and existing Telegram tests own MP3
sendVoicebehavior, so the replacement retains one focused parameterized OpenAI regression instead of duplicating cross-layer tests.User Impact
Users of Piper, Kokoro, and other OpenAI-compatible TTS endpoints can configure MP3 output and receive native Telegram voice messages rather than audio attachments. Non-voice targets and WAV output are unchanged.
Evidence
tbx_01kwv40nw0cbq0f8s7kt1wvps6: OpenAI provider, speech-core, and Telegram send suites passed, 216/216 tests.pnpm check:changedpassed extension production/test typechecks, changed-file lint, dependency and package guards, database-first guard, runtime sidecar guard, and import-cycle verification.response_format: "mp3"and returnedoutputFormat: "mp3",fileExtension: ".mp3",voiceCompatible: true, and six response bytes.sendVoiceaccepts MP3 voice messages.git diff --check origin/main...HEADpassed.Co-authored-by: Hemantsudarshan [email protected]