Skip to content

[codex] 移除 WhisperKit 并整合 MLX/会议重构#109

Merged
hehehai merged 9 commits into
feat/pr-101-103-104-integrationfrom
feat/mlx-whisper-refactor
Jun 19, 2026
Merged

[codex] 移除 WhisperKit 并整合 MLX/会议重构#109
hehehai merged 9 commits into
feat/pr-101-103-104-integrationfrom
feat/mlx-whisper-refactor

Conversation

@hehehai

@hehehai hehehai commented Jun 19, 2026

Copy link
Copy Markdown
Owner

概览

这个 PR 汇总了 feat/mlx-whisper-refactor 分支相对 main 的全部改动。整体目标是把 Voxt 的本地语音、会议、模型、设置和工程结构往新的 MLX/功能化架构推进,同时移除旧 WhisperKit 运行时依赖,补齐会议模式、日志、热键和本地模型管理相关能力。

本分支改动规模较大:约 586 个文件变更,包含源码目录重组、新功能模块、测试覆盖、文档和资源更新。

主要改动

1. 工程与源码结构重组

  • 将大量 AppDelegate+... 扩展拆分并重命名为更明确的 flow/coordinator 文件,例如录音、翻译、转写详情、菜单窗口、LLM warmup、hotkey lifecycle 等。
  • 将原本较分散的 Support 代码迁移到更清晰的 Core/* 命名空间,包括:
    • Core/Dictionary
    • Core/History
    • Core/LLM
    • Core/Logging
    • Core/Models
    • Core/RemoteProviders
    • Core/Security
    • Core/Transcription
    • Core/Utilities
  • 将设置页面拆成 Settings/FeaturesSettings/ModelsSettings/OnboardingSettings/Shell 等子模块,并补充各目录 README,降低后续维护成本。
  • 将 UI/窗口相关代码进一步收敛到 Windows 目录,增加会议详情、会议浮层和模型调试窗口相关结构。

2. 会议模式恢复与扩展

  • 恢复并扩展会议录音/转写模式,新增会议捕获、实时会话、系统音频/麦克风捕获、VAD、说话人分析和会议转写处理管线。
  • 新增会议详情窗口、会议浮层、会议摘要、会议历史和会议转写格式化能力。
  • 增加远程会议 ASR 会话支持,包括远程 provider live session、实时 diarization、speaker transcript assembler 等。
  • 增加大量会议相关测试,覆盖音频归档、chunking、会议开始规划、会议摘要、说话人转写组装、会议详情 ViewModel 等。

3. 本地模型与 MLX 能力更新

  • 集成本地 GGUF 翻译模型管理,新增 GGUFTranslationModelManager 与对应模型支持。
  • 更新 MLX ASR 模型目录和状态管理,补充新的 ASR 模型支持、下载状态展示和本地模型分组逻辑。
  • 更新 Qwen、Voxtral、Parakeet、GLM、Nemotron、FireRed、SenseVoice、MLX Whisper 等本地 ASR 模型展示与兼容逻辑。
  • 更新模型设置页、下载进度、安装状态、模型 badge 和 debug 信息。

4. 移除 WhisperKit 运行时依赖

  • 从 Xcode project 和 Swift Package resolved 中移除 WhisperKit 依赖。
  • 删除旧 WhisperKit 运行时代码:
    • WhisperKitModelManager
    • WhisperKitTranscriber
    • WhisperKitModelSupport
    • WhisperKitDownloadSupport
    • WhisperModelArtifacts
    • WhisperTextPostProcessor
  • 删除 WhisperKit 专属测试。
  • 保留旧用户配置迁移逻辑,将历史 Whisper 选择迁移到 MLX Whisper repo:
    • tiny -> mlx-community/whisper-tiny-mlx
    • base -> mlx-community/whisper-base-mlx
    • small -> mlx-community/whisper-small-mlx
    • medium -> mlx-community/whisper-large-v3-turbo
    • large-v3 -> mlx-community/whisper-large-v3-mlx
  • whisperKit engine/provider raw value 会迁移到新的 MLX/LLM 路径。
  • 删除 Whisper direct translation 分支;Whisper 现在只作为 ASR,翻译统一走已选 LLM 链路。

5. 日志系统与调试能力

  • 新增结构化日志管线,包括 file/os/multiplex log handler、日志 redaction、formatter、export store 和 runtime environment 支持。
  • 修复日志文件写入时可能只写入部分 buffer 的问题,改为循环写完整数据。
  • 调整 verbose log 的懒求值,关闭 verbose 时不会提前计算昂贵日志字符串。
  • 更新 debug/support 输出,不再展示旧 WhisperKit 模型状态。

6. 热键与交互行为

  • 升级 hotkey bindings 与翻译 overlay 目标语言选择逻辑。
  • 调整 hotkey runtime configuration 缓存和失效逻辑。
  • 生产路径中 hotkey 回调改为异步派发,避免事件处理过程中直接执行回调造成阻塞或重入风险。
  • 对重复 flagsChanged debug 日志做节流,减少 hotkey debug 噪音。
  • 增加对应 hotkey 单测。

7. 设置、Onboarding 和模型选择体验

  • 新增完整 onboarding/setup guide flow。
  • 更新 Feature 模式下的转写、翻译、改写、会议配置页。
  • 更新设置页颜色、按钮、badge、history action icon、translation answer card 目标语言选择宽度等 UI 细节。
  • 更新本地模型选择器,隐藏 legacy Whisper 短 ID,展示 MLX Whisper entry。
  • 旧 Whisper direct translate 选择会迁移到本地 LLM 翻译模型。

8. 词典、提示词和文档

  • 增加词典分类能力和相关设置/测试。
  • 重组 Prompt 资源目录,新增多语言 README 和翻译、改写、摘要、ASR hint 等 prompt 文件。
  • 更新中文文档:
    • ASR 模型名称清单
    • MLX 2025+ 模型支持清单
    • 本地模型精简评估
    • README 中的本地模型与 Whisper/MLX 说明
  • 新增会议相关文档、性能/安全修复总结文档和 PR 资源图片。

用户影响

  • 用户不再需要 WhisperKit 依赖即可使用本地 Whisper ASR;历史 Whisper 配置会自动迁移到 MLX Whisper 模型。
  • 旧 Whisper direct translation 不再作为独立翻译路径;翻译统一由 LLM provider 执行,行为更一致。
  • 会议模式能力明显增强,支持更完整的会议录制、实时转写、说话人分析、摘要和详情查看。
  • 设置页和 onboarding 更模块化,用户更容易配置 ASR、LLM、翻译、改写和会议模型。
  • 日志和 hotkey 行为更稳,调试信息更可控。

开发影响

  • 代码目录变化较大,后续开发应优先按新的 Core/*Settings/*Meeting/*Windows/* 模块边界放置文件。
  • WhisperKit 相关 API 已移除,后续不要再添加 WhisperKit fallback;Whisper 相关能力应通过 MLX Audio 路径处理。
  • 翻译链路不再有 Whisper direct provider 特例,新的翻译模型能力应接入 LLM/GGUF/Remote LLM provider。
  • 旧配置兼容集中在 migration helper 和 feature settings 解析逻辑中,后续迁移应继续沿用这种集中处理方式。

验证

已运行:

xcodebuild build -quiet -project Voxt.xcodeproj -scheme Voxt -destination 'platform=macOS' -derivedDataPath build/CodexDerivedData CODE_SIGNING_ALLOWED=NO

结果:通过。

已运行 WhisperKit 移除和 MLX 迁移相关聚焦测试:

xcodebuild test -quiet -project Voxt.xcodeproj -scheme Voxt -destination 'platform=macOS' -derivedDataPath build/CodexDerivedData CODE_SIGNING_ALLOWED=NO -only-testing:VoxtTests/MLXModelSupportTests -only-testing:VoxtTests/ASRHintSettingsTests -only-testing:VoxtTests/TranslationProviderResolverTests -only-testing:VoxtTests/MeetingTranslationSupportTests -only-testing:VoxtTests/RecordingStartPlannerTests -only-testing:VoxtTests/MeetingStartPlannerTests -only-testing:VoxtTests/MeetingASRSupportTests -only-testing:VoxtTests/FeatureModelCatalogBuilderTests -only-testing:VoxtTests/ModelCatalogBuilderTests -only-testing:VoxtTests/ModelSettingsProgressRefreshSupportTests -only-testing:VoxtTests/ModelSettingsManagerRefreshSupportTests -only-testing:VoxtTests/SettingsModelDownloadBadgeSupportTests -only-testing:VoxtTests/OnboardingSupportTests -only-testing:VoxtTests/TranslationSessionLanguageSwitchTests

结果:通过。

已运行日志和热键相关聚焦测试:

xcodebuild test -quiet -project Voxt.xcodeproj -scheme Voxt -destination 'platform=macOS' -derivedDataPath build/CodexDerivedData CODE_SIGNING_ALLOWED=NO -only-testing:VoxtTests/VoxtLoggerTests -only-testing:VoxtTests/HotkeyManagerTests

结果:通过。

全量测试也运行过:

xcodebuild test -quiet -project Voxt.xcodeproj -scheme Voxt -destination 'platform=macOS' -derivedDataPath build/CodexDerivedData CODE_SIGNING_ALLOWED=NO

结果:仍有 1 个失败:MeetingHotkeyPreferenceTests/testDefaultMeetingHotkeyIsFnOption(),断言默认 meeting hotkey 的 keyCode 期望 65535,实际为 37。这个需要单独确认当前产品期望是继续使用 Fn/Option 组合,还是接受新的默认 hotkey 配置。

风险与注意事项

  • 分支体量较大,包含重构、新功能和依赖移除,建议 reviewers 按模块分批审查。
  • WhisperKit 被完全移除后,任何依赖旧 Core ML artifact、旧 WhisperKit transcriber 或旧 direct translation 的路径都不会再工作;旧用户配置依赖迁移逻辑转到 MLX/LLM。
  • 会议模式和 hotkey 变化可能影响录音启动、结束、快捷键触发和 overlay 状态,需要重点回归真实 macOS 交互。
  • 全量测试里剩余的 meeting hotkey 默认值失败需要在合并前决策或修复。

hehehai added 9 commits June 19, 2026 08:58
Refine local ASR catalog visibility, MLXAudio model support, Nemotron live transcription handling, and related settings/docs.

Also fixes the debug app bundle metadata and scheme product name for Xcode Run.

Generated with Codex.
Migrate legacy Whisper selections to MLX Whisper repos and route translation through the LLM path.\n\nGenerated with Codex.
Avoid evaluating verbose log messages when verbose logging is disabled and ensure log file writes flush complete buffers.\n\nGenerated with Codex.
Cache hotkey runtime configuration, throttle repeated debug logs, and dispatch production callbacks asynchronously while keeping test helpers synchronous.\n\nGenerated with Codex.
@hehehai hehehai changed the base branch from main to feat/pr-101-103-104-integration June 19, 2026 13:22
@hehehai hehehai marked this pull request as ready for review June 19, 2026 13:25
@hehehai hehehai self-assigned this Jun 19, 2026
@hehehai hehehai added the Enhancement New feature or request label Jun 19, 2026
@hehehai hehehai merged commit 730a9a4 into feat/pr-101-103-104-integration Jun 19, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant