fix(stt): reject structured transcription errors (#78098) - #78118
RerankerGuo wants to merge 1 commit into
Conversation
|
Adversarial verification (Vox Lockin lane 09 — desktop voice class; reviewed for #78098): Verdict: mergeable and fixes the user-visible symptom — no duplicate PR opened. Verified against
No desktop-side change is needed: the API contract is now enforced server-side and the desktop's |
fbf8d0f to
85cbbe2
Compare
Do not stringify SDK transcription objects with missing text into user messages. Surface explicit provider errors through the existing failure path and treat empty structured responses as empty transcripts.
85cbbe2 to
b8e379b
Compare
|
@kshitijk4poor, would you be willing to take a focused look when bandwidth permits? Tagging you because you recently maintained the STT path in #77516 and #81027. This is a 2-file fix for P2 issue #78098: 13 production lines prevent structured provider errors from becoming user messages. The same two regressions fail on current An independent verifier also traced the full failure path through the desktop endpoint and confirmed valid string/object/dict transcripts remain unchanged. CI has not failed; the fork workflow is awaiting maintainer approval. If another owner is more appropriate, no action is needed. I will not re-ping. |
What does this PR do?
Fixes #78098 by preventing structured STT error objects from becoming user
message text.
An OpenAI-compatible transcription response can be a structured object with
text=Noneand an explicit provider error. Currentmainfalls through tostr(transcription), treats the Python representation as a successfultranscript, and sends it as the user's message.
Structured responses now:
failure path; or
Plain strings and unknown scalar response types preserve existing behavior.
Current-main reproduction
Verified against
origin/mainat87fd0ed25using the same two regressiontests added by this PR:
On current
main,_transcribe_openai()reportssuccess=True, and_extract_transcript_text()does not raise for the structured provider error.End-to-end validation
Independent native validation on this PR traced the reported object through
_extract_transcript_text->_transcribe_openai-> the web transcriptionendpoint -> Desktop conversation mode. The PR converts that path to the
existing HTTP 400/error-toast flow while preserving successful plain-string,
object-with-text, dict-with-text, and silent-empty responses.
Verification
The complete transcription test file reports 51 passed and one unrelated
faster-whisper configuration assertion failure. That exact failure reproduces
on current
main(compute_typeisint8, while the stale assertion expectsfloat32).Scope