feat(windows): add sherpa-onnx local ASR#504
Conversation
PR Reviewer Guide 🔍(Review updated until commit 83221df)Here are some key observations to aid the review process:
|
|
Persistent review updated to latest commit 691068f |
691068f to
55c4531
Compare
|
Persistent review updated to latest commit 55c4531 |
|
那啥,你搞完了踢我一下 |
55c4531 to
7072c30
Compare
|
Persistent review updated to latest commit 7072c30 |
|
@H-Chris233 冲突解决完了 |
|
对于 release-archive 模型,此函数只检查归档文件本身。下载成功后,归档会被解压并删除,因此尽管模型文件已经存在,downloaded_bytes 仍会回落为 0。这会导致 UI 和任何状态逻辑将已完整下载的模型报告为缓存为空。 |
…-onnx-local-asr # Conflicts: # openless-all/app/src/i18n/en.ts # openless-all/app/src/i18n/ja.ts # openless-all/app/src/i18n/ko.ts # openless-all/app/src/i18n/zh-CN.ts # openless-all/app/src/i18n/zh-TW.ts
|
Persistent review updated to latest commit 83221df |
|
@H-Chris233 已经修复,麻烦再看一下 |
@claude |
|
Claude finished @H-Chris233's task in 1m 47s —— View job 分析 Stale Hotkey 问题
结论:这是误报,问题并不存在Bot 的顾虑是:如果用户"只修改了 这个假设本身是错的。 关键在于 // commands.rs:160-162
let mut previous = coord.read_settings();
sync_dictation_hotkey_legacy_fields(&mut previous); // ← 对旧值同步
sync_dictation_hotkey_legacy_fields(&mut prefs); // ← 对新值同步这个 sync 函数的逻辑( fn sync_dictation_hotkey_legacy_fields(prefs: &mut UserPreferences) {
if let Some(trigger) = legacy_modifier_trigger(&prefs.dictation_hotkey) {
prefs.hotkey.trigger = trigger; // trigger 由 dictation_hotkey 决定
prefs.custom_combo_hotkey = None;
return;
}
prefs.hotkey.trigger = HotkeyTrigger::Custom; // 同上
prefs.custom_combo_hotkey = ...;
}sync 之后, 因此:
另外, 这段代码逻辑是正确的,无需修改。 Bot 没有追踪到 |
User description
背景
本 PR 为 Windows 端接入
sherpa-onnx本地离线 ASR 能力,补齐 OpenLess 在 Windows 上不依赖云端服务的语音识别路径。目标是让用户可以在本地下载、管理 Sherpa 模型,并通过现有 Tauri/React 设置页启用本地识别,同时保持现有 Qwen、Foundry、云端 ASR 路径不受影响。
主要变更
1. 新增 Windows Sherpa 本地 ASR 后端
sense-voice-small-zhparaformer-zhwhisper-small-multisherpa-onnx = 1.13.2静态链接依赖。2. 新增 Sherpa 模型下载与管理
sherpa-onnx-asr-download-progress3. 扩展 Tauri IPC 命令
新增 Sherpa 相关命令,用于前端管理本地模型和运行时状态,包括:
同时在 lib.rs 中注册
SherpaDownloadManager和相关 command handler。4. 接入 coordinator 运行链路
sherpa-onnx-localprovider。5. 前端 Local ASR / Settings 页面集成
6. Windows Common Controls v6 manifest 修复
Sherpa 测试二进制在 Windows 上曾因为缺少 Common Controls v6 manifest,启动时报
STATUS_ENTRYPOINT_NOT_FOUND。本 PR 在 build.rs 中加入更稳妥的 manifest dependency 注入方式:
/MANIFESTINPUT,避免和 Tauri app 自带 manifest 产生duplicate resource type:MANIFEST。cargo:rustc-link-arg=/MANIFESTDEPENDENCY:...传参,避免 MSVC/Cargo 因空格拆参导致LNK1181。#pragma comment(linker, "/manifestdependency:...")注入 Common Controls v6 dependency,并用/INCLUDE强制 linker 拉入该 object。这样测试二进制和主应用二进制都能获得 Common Controls v6 dependency,同时不会造成 manifest 重复资源冲突。
7. 测试修正
cmdmodifier 归一化为Ctrl的快捷键测试断言。验证结果
已在 Windows 本地完成以下验证:
git diff --check✅git diff --cached --check✅cargo check --manifest-path openless-all/app/src-tauri/Cargo.toml✅cargo build --manifest-path openless-all/app/src-tauri/Cargo.toml✅cargo test --manifest-path openless-all/app/src-tauri/Cargo.toml sherpa --lib -- --nocapture✅19 passedcargo test --manifest-path openless-all/app/src-tauri/Cargo.toml --lib✅323 passednpm run build✅已知非阻塞项
PR Type
Enhancement, Tests, Documentation
Description
Add Sherpa runtime skeleton
Expose download and prepare commands
Route Windows sessions to Sherpa
Update settings, tests, and docs
Diagram Walkthrough
File Walkthrough
13 files
Add Sherpa ASR command endpointsImplement model manifest and download flowAdd Windows Sherpa runtime skeletonDefine Sherpa catalog and metadataIntegrate Sherpa runtime into coordinatorRoute dictation sessions to SherpaWrap Sherpa runtime as audio consumerRegister Sherpa state and commandsExpose reusable download helpersAdd Sherpa local ASR settings viewAdd frontend helpers for Sherpa ASRExtend IPC bindings for Sherpa commandsSurface Sherpa controls in settings3 files
Persist Sherpa model preferencesLink Windows manifest dependencySerialize new Sherpa preference fields1 files
Export Sherpa local ASR modules1 files
Include Sherpa stub in backend tests1 files
Add Windows Sherpa dependency and config1 files
Document Sherpa ASR rollout plan13 files