fix(asr): 过滤 GLM-ASR 偶发的纯井号占位转写(#787) - #916
Merged
H-Chris233 merged 1 commit intoAug 4, 2026
Merged
Conversation
Contributor
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
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.
User description
修复 issue #787:智谱 GLM-ASR 作为供应商时,静音/弱音片段偶发把整段识别为单个 #\(或 ##\…),当前 Whisper 兼容客户端仅 trim 后当作有效转写,导致占位符被插入用户输入。
改动
测试
新增 4 个单元测试(纯 #/##/### 归一化为空、混合分片丢弃占位、全占位整体为空、正常内容不受影响),\cargo test -p openless asr::whisper\ 33 个测试全部通过。
PR Type
Bug fix, Tests
Description
Filter GLM-ASR pure
#placeholder transcriptions.Normalize placeholder chunks to empty transcripts.
Add unit tests covering placeholder scenarios.
Guard real transcripts with other characters.
Diagram Walkthrough
flowchart LR A["ASR response text"] --> B{"is_placeholder_heading?"} B -- "yes" --> C["Empty transcript"] B -- "no" --> D["Normal transcript"] C --> E["Existing empty guard"]File Walkthrough
whisper.rs
Filter pure hash placeholders in ASR transcriptionsopenless-all/app/src-tauri/src/asr/whisper.rs
is_placeholder_headinghelper for pure#text.transcribe_chunkand fallback.C#and# 你好.