fix(stt): strip Qwen3-ASR response prefix - #65534
Conversation
1df2e19 to
a6792ca
Compare
Normalize the structured <asr_text> marker after extracting text from string, SDK object, and dictionary transcription responses. Preserve the current provider-aware STT configuration architecture. Refreshes NousResearch#8773 on current main. Co-authored-by: angelos <angelos@oikos.lan.home.malaiwah.com> Assisted-by: Codex:gpt-5.6
a6792ca to
113a0aa
Compare
teknium1
left a comment
There was a problem hiding this comment.
Thanks for refreshing the Qwen3-ASR fix and preserving the current STT configuration work. The reported defect remains present: current main returns raw string transcription responses from tools/transcription_tools.py:1880-1881, and _transcribe_openai() forwards that value at tools/transcription_tools.py:1393.
Problems
- The new marker condition matches any
<asr_text>occurrence, while the documented Qwen envelope islanguage ...<asr_text>. Since this helper also serves Mistral and ElevenLabs (tools/transcription_tools.py:1447,1630), it can truncate an otherwise legitimate transcript containing the literal marker. The new tests cover only stripping cases.
Suggested changes
- Restrict the normalization to the start-anchored structured envelope and add a pass-through regression for a non-envelope string containing
<asr_text>.
Automated hermes-sweeper review.
…refix-current-8773
|
Synced with current Local validation on
A broader |
|
Addressed the sweeper review on the current PR head. Change made:
Validation on
|
|
Current-head verification for python -m pytest tests/tools/test_transcription_tools.py -q -k 'qwen or Qwen or managed_media or transcription_prefix or language'
python -m pytest tests/tools/test_managed_media_gateways.py::test_extract_transcript_text_strips_qwen3_asr_prefix -q
python -m py_compile tools/transcription_tools.py tests/tools/test_transcription_tools.py tests/tools/test_managed_media_gateways.py
git diff --check origin/main...HEAD
git rev-list --left-right --count origin/main...HEADResults:
I also tried the broader two-file pytest selection. It reaches 117 passing tests, then fails only in unrelated lazy-dependency paths because this host's system Python is PEP 668 externally managed and cannot lazy-install |
…refix-current-8773
|
Synced this PR with current
Fresh validation on the synced head: I also ran the broader transcription/media-gateway test files; the Qwen-related tests passed, while unrelated optional-provider tests hit this runner's system-Python PEP 668 guard while trying to lazy-install |
|
Merged into main via consolidated salvage PR #73510 (merge Your contribution is credited to you in git history. Thank you! Closing this PR as merged-via-salvage. |
Summary
language ...<asr_text>prefix returned by Qwen3-ASR-compatible OpenAI transcription endpoints.text, dictionary, and fallback response handlingContext
This refreshes the valid fix from #8773 onto the maintained
mainline. The original branch is now reported as conflicting and also contains an unrelated rollback of the current STT model configuration behavior.The implementation retains attribution to @malaiwah through the original author trailer.
Validation
main@56e2ba5e7;git range-diffconfirms the one-commit patch is unchanged from prior heada6792ca4a113a0aa25ruff checkpassed for both changed filesgit diff --checkpassedruff format --checkprobe reproduces the same pre-existing formatting result on currentmain; the two-file PR patch remains unchanged