Skip to content

fix(asr): 修复 Apple Speech 听写误走火山路径#741

Open
snvtac wants to merge 1 commit into
Open-Less:betafrom
snvtac:snvtac/731-apple-speech-dictation-path
Open

fix(asr): 修复 Apple Speech 听写误走火山路径#741
snvtac wants to merge 1 commit into
Open-Less:betafrom
snvtac:snvtac/731-apple-speech-dictation-path

Conversation

@snvtac

@snvtac snvtac commented Jun 23, 2026

Copy link
Copy Markdown

User description

摘要

Fixes #731

修复 macOS Apple Speech ASR 在普通听写启动时仍落入火山引擎凭据 / WebSocket 路径的问题。

修复 / 新增 / 改进

  • apple-speech 纳入无外部凭据的本地 ASR provider 门禁,macOS 直接放行,非 macOS 返回明确平台错误。
  • 普通听写启动路径新增 Apple Speech 本地分支,录音 consumer 直接接入 ActiveAsr::AppleSpeech,不再进入 Volcengine fallback。
  • 增加 macOS provider 路由单测,锁定 apple-speechlocal-qwen3 的本地路径选择。

兼容

  • 不包含:Apple Speech 识别实现、权限弹窗、音频处理逻辑变更。
  • 对现有用户 / 本地环境 / 构建流程的影响:仅影响选择 apple-speech 的 macOS 用户;其他 ASR provider 路径保持不变。

测试计划

  • 命令:git diff --check
  • 命令:cargo test --lib macos_keyless_dictation_provider_routes_apple_speech_locally
  • 命令:cargo test --lib qa_asr_provider_kind_tracks_active_provider
  • 命令:cargo test --lib local_asr_providers_skip_external_validation
  • 结果:上述检查通过。cargo test 有仓库既有 unused/deprecated warning,未发现本次改动相关失败。
  • 证据路径:本 PR 分支本地终端输出。

PR Type

Bug fix, Enhancement


Description

  • Add Apple Speech to local ASR credential gate

  • Route Apple Speech dictation locally on macOS

  • Unify local dictation providers with enum


Diagram Walkthrough

flowchart LR
  A["active_asr"] --> B{"is apple-speech?"}
  B -- yes --> C["credential gate: macOS -> Ok"]
  C --> D["begin_session_as: apple-speech local branch"]
  B -- no --> E["existing paths (volcengine, bailian, etc.)"]
Loading

File Walkthrough

Relevant files
Bug fix
asr_wiring.rs
Add Apple Speech to credential gate                                           

openless-all/app/src-tauri/src/coordinator/asr_wiring.rs

  • Added Apple Speech to the local ASR credential gate
  • On macOS, returns Ok; on non-macOS, returns a platform error
  • Prevents Apple Speech from falling through to Volcengine credential
    checks
+11/-0   
Enhancement
dictation.rs
Route Apple Speech dictation locally                                         

openless-all/app/src-tauri/src/coordinator/dictation.rs

  • Introduced MacosKeylessDictationProvider enum
  • Implemented macos_keyless_dictation_provider function
  • Added Apple Speech local branch in begin_session_as
  • Added unit test for provider routing
+83/-24 

@github-actions

Copy link
Copy Markdown
Contributor

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

🎫 Ticket compliance analysis 🔶

731 - Partially compliant

Compliant requirements:

  • Apple Speech no longer requires Volcengine credentials in the credential gate (asr_wiring.rs).
  • Apple Speech dictation is routed locally (dictation.rs) and does not fall through to Volcengine.
  • The credential gate returns Ok(()) on macOS for Apple Speech.
  • The dictation startup path has an explicit AppleSpeech branch via the new MacosKeylessDictationProvider enum.

Non-compliant requirements:

(empty)

Requires further human verification:

(empty)

⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
🧪 PR contains tests
🔒 No security concerns identified
⚡ No major issues detected

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

macOS Apple Speech provider falls through to Volcengine credential path during dictation

1 participant