The agent that grows with you
Python aiai-agentai-agentsanthropicchatgptclaudeclaude-codecodexhermeshermes-agentllmnous-researchopenai
fix(stt): anchor Qwen3-ASR envelope stripping
LauraGPTd219392e5b58
diff --git a/tests/tools/test_transcription_tools.py b/tests/tools/test_transcription_tools.pyindex c0186513a0e..9cfe47a50c8 100644--- a/tests/tools/test_transcription_tools.py+++ b/tests/tools/test_transcription_tools.py@@ -1850,6 +1850,30 @@ class TestTranscribeAudioElevenLabsDispatch:assert mock_elevenlabs.call_args[0][1] == "scribe_v2"+# ============================================================================+# _extract_transcript_text+# ============================================================================++class TestExtractTranscriptText:+ def test_strips_qwen3_asr_language_envelope(self):+ from tools.transcription_tools import _extract_transcript_text++ result = _extract_transcript_text(+ "language zh\n<audio_language>zh</audio_language>\n<asr_text>你好,世界",+ )++ assert result == "你好,世界"++ def test_keeps_non_envelope_marker_literal(self):+ from tools.transcription_tools import _extract_transcript_text++ result = _extract_transcript_text(+ "The user literally said <asr_text> while reading markup.",+ )++ assert result == "The user literally said <asr_text> while reading markup."++# Shell safety — shlex.split on auto-detected templates# ============================================================================class TestShellSafety:diff --git a/tools/transcription_tools.py b/tools/transcription_tools.pyindex 0b14e34bbcf..725020ed369 100644--- a/tools/transcription_tools.py+++ b/tools/transcription_tools.py@@ -2095,7 +2095,7 @@ def _extract_transcript_text(transcription: Any) -> str:text = str(transcription).strip()marker = "<asr_text>"- if marker in text:+ if text.lstrip().lower().startswith("language") and marker in text:text = text.split(marker, 1)[1].strip()return text