Skip to content

feat(voice-activation): 支持 Windows 本地语音唤醒听写 - #1240

Merged
H-Chris233 merged 15 commits into
Open-Less:betafrom
HKLHaoBin:HKLHaoBin/1003-voice-activation
Oct 21, 2026
Merged

H-Chris233 merged 15 commits into
Open-Less:betafrom
HKLHaoBin:HKLHaoBin/1003-voice-activation

Conversation

@HKLHaoBin

@HKLHaoBin HKLHaoBin commented Oct 20, 2026 •

Copy link
Copy Markdown
Collaborator

摘要

Refs #1003。新增 Windows 本地语音唤醒听写:用可自定义的开始/完成命令控制录入,减少按键操作。按用户要求先提交 PR 供审阅;目前不宣称该 issue 已完整解决,也不自动关闭 issue。

修复 / 新增 / 改进

  • 使用本地 Zipformer / Sherpa-ONNX 监听唤醒词与完成词;提供独立开关、自定义短语和超时设置,默认关闭语音激活。
  • 采用有界 VAD、缓冲和交接预录音,静音边界触发在线识别 flush,保留唤醒后紧接的正文。
  • 区分修订与新识别分段,清理唤醒前缀及完整完成词后缀,保留原始累积器的偏移语义。
  • 根据设备回传,为静音边界与最终 EOF 补入有界模型尾部上下文。唤醒反馈已获确认;完成词残留仍需进一步修复,详见下文。
  • 保留六个安全 NDJSON 诊断边界与匹配的 Windows EXE/PDB,便于继续调查堆损坏;不记录音频或转写正文,诊断尚未清理。
  • 已合入上游 beta 101f5142,解决 8 个文件的冲突,保留上游 Android Sherpa、实时文字转发、设置页 OS/重启行为及构建来源信息。

兼容

  • 语音激活仅在 Windows 提供;保留热键、鼠标和 CLI 入口,不将语音激活扩展到其他平台。
  • 保留上游 local_asr_sherpa 对 Windows 与 arm64 Android 的支持和跨平台编译路径。
  • 对构建流程的影响:Windows 测试产物保留诊断符号;保留上游 provenance 文件。
  • 不包含 / 尚未验收:
    • 识别期间仍曾出现 0xC0000374 堆损坏,原始损坏来源未定位,不能将 UI 析构检测栈当作根因。
    • 最新设备反馈指出,完成词可能被文字优化模型移动到句中,现有末尾清理无法完整移除;A2 不能视为已解决这一问题。参见 功能建议:用语音替代按键来激活输入法 #1003 (comment) 。
    • 超时当前仍按总录音时长,而不是最后语音活动后的静音时长计算。
    • 默认短语仍为“开始语音录入”/“完成语音录入”,可在设置中自定义;最新讨论建议“开始文字录入”/“完成文字录入”,本次合并没有顺便修改默认值。

CI 集成修复

  • 9c75062c:远程 CI 的 E0063 指向上游新增测试夹具缺少 voice_activation_runtime;补为 None,不改产品行为。
  • 5372769a:Windows 原生构建成功后,第二次 checkout 的凭据清理因无 .gitmodules 映射的可选 gitlink 失败;改为按准确 workflow_sha 获取同一 smoke 脚本,保留安装器/注册表验证。
  • 43381885:同步安装器工作流契约测试,验证新的固定 SHA 获取方式、失败传播与字节保真;下游安装器注册检查全部保留。
  • 三次修复均经 Bugbot 审查得到 No bugs found.;当前 SHA 的上游 PR CI 与 Android Release 构建已通过。分支 CI 的 Windows、Linux、Android、Harmony、UI motion 均通过;macOS 因 hosted runner 容量不足未执行,导致整体结果为 failure,而非代码或测试断言失败。
  • 前一轮上游 Android instrumentation 在系统镜像下载时遭遇损坏 ZIP;当前提交的上游 Android 检查已成功,未跳过该门禁。

测试计划

  • Bugbot 对功能改动及本次 8 个文件的合并集成分别审查,返回 No bugs found.;静态审查不代替运行验证。
  • 原分支 e776f798 的远程 CI、桌面端和 Android 构建成功:
  • 当前提交 433818859bba5d814b133eb82a7f771b4063b730 的分支 CI整体通过:除 macOS 未获得 runner 被取消、MSRV 按条件跳过外,其余作业均成功;此项仍受 runner 容量阻塞。
  • 当前提交的 PR CI 通过;macOS MSRV 按工作流条件跳过。
  • 当前提交的 Android Release arm64 构建通过,APK 产物的 SHA 已核对。
  • 当前提交的 Windows x64 构建、NSIS 安装/卸载及 TSF 注册冒烟检查、EXE/PDB 校验通过;Beta 版本按现有工作流跳过 MSI。已核对桌面产物的提交与归档 digest:sha256:d49ef0b39c2b64486d87ff927909ca565eed9e63ae1419f72866210d5505a696。
  • 桌面端全平台构建整体通过:Windows 与 macOS Intel 已成功;macOS arm64 原始运行及一次定向重跑均未分配到 hosted runner(runner_id=0、无执行步骤,官方 annotation 明确指出 arm64 容量限制);第二次仍取消,整体工作流未通过。暂不无限重跑,也不替换架构或跳过门禁;等待托管 runner 容量恢复。分支 CI 的 macOS 作业也遇到相同容量限制。
  • Windows 设备复验完成词清理、堆损坏与静音超时语义。

所有编译、测试与打包统一在 GitHub Actions 执行;未在本地执行这些任务。上述结果均对应准确 HEAD,不沿用旧 SHA 的成功结论。当前工作流均已结束,无运行中的后台监控;尚不能宣称全部通过。Windows 完整后端测试若由工作流预设跳过,会与实际执行项区分报告。

🤖 Generated with Claude Code

HKLHaoBin and others added 11 commits October 18, 2026 08:51
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Add bounded privacy-safe P1-P6 runtime probes and matching Windows symbols for issue Open-Less#1003 reproduction. No behavioral fix is included.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Experiment A1-tail-context / C1-nonterminal-padding: add bounded zero-sample context before nonterminal input_finished, retaining diagnostics for verification.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Reuse bounded Sherpa tail input when formal transcription finishes so final tokens can decode before transcript cleanup. Retain diagnostic probes and identify the A2 terminal-padding experiment.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Preserve voice-command cleanup before partial insertion, Windows activation and Android Sherpa capability gates, both settings props, and diagnostic/provenance artifacts.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Set the optional voice activation runtime to None in the upstream polished-final-insertion fixture so the merged Core tests compile on all platforms.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Read the smoke script from the workflow commit through the authenticated GitHub contents API. Preserve byte contents and installer checks while avoiding checkout auth cleanup traversing optional vendor gitlinks.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Keep immutable workflow revision, authentication, failure propagation, and byte-preserving script retrieval assertions aligned with the workflow. Retain all installer registration checks.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@H-Chris233 H-Chris233 self-assigned this Oct 21, 2026
@H-Chris233

Copy link
Copy Markdown
Collaborator

开始审查

@H-Chris233
H-Chris233 merged commit 43df23b into Open-Less:beta Oct 21, 2026
10 checks passed
HKLHaoBin added a commit to HKLHaoBin/openless that referenced this pull request Oct 21, 2026
Retain the newer voice activation implementation, punctuation regression tests, privacy-safe P1-P6 diagnostics, and Windows symbols already merged through Open-Less#1240. Resolve overlapping feature conflicts without reverting upstream fixes.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants