Repository navigation
feat: 电脑端服务出错时可改用候补模型,本机模型可作候补,历史记录写明实际服务商 - #210
Merged
Merged
Conversation
- 候补模型新增「服务出错时也改用候补」,默认关闭:请求超时、网络错误、服务器出错(5xx、503)、请求过于频繁(429),以及本机识别的显卡、内存或模型出错时,按顺序改用下一个模型;密钥无效、请求有误、取消不切换 - 出错的模型约 1 分钟内跳过(429 按服务给的等待时间,最长一天),之后自动恢复;每次请求最多尝试 3 个出错的模型,识别一次最长 150 秒、润色 60 秒 - 已安装的本机整段模型可以加入语音模型的候补列表;选用本机识别时,列表里的云端服务不参与,出错也不会把音频上传到云端 - 历史记录写明实际识别、润色的服务商,是否由候补模型完成以及原因(额度用完或服务出错),详情页显示 - 云端识别与润色客户端的超时、网络、服务器错误带类型传到核心,提示文字不变;导入音频或视频仍不走候补链 - 手机读取新的状态字段(出错跳过、本机识别不改用云端),不提供开关 - 文档 §3.14,站点云端识别、本机识别与历史记录页
Codecov Report❌ Patch coverage is @@ Coverage Diff @@
## main #210 +/- ##
==========================================
+ Coverage 93.43% 93.49% +0.05%
==========================================
Files 452 452
Lines 71984 72987 +1003
Branches 4557 4594 +37
==========================================
+ Hits 67257 68237 +980
- Misses 4099 4118 +19
- Partials 628 632 +4
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 6 files with indirect coverage changes 🚀 New features to boost your workflow:
|
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.
候补模型从「只在额度用完时切换」扩展为可选的「服务出错时也切换」,默认关闭(路线图 R11,计划 PR-7);同时承接原 PR-5 的「历史记录写明实际服务商与是否候补」。用户决定 D25、D26 见下文。手机端只能显示新的行状态,没有开关,行为不变。
用户能看到的变化
文档与截图
docs/dictation.md:新增 §3.14「服务出错时改用候补」(触发表、冷却、上限、本地候补、本地为主不上传、导入、历史字段、状态与界面),§3.5 三处指向它。docs/acceptance.md两行(行为、界面)。docs/site/{,zh/}recognition/cloud.md(「服务出错时也改用候补」一节、历史说明)、docs/site/{,zh/}recognition/local.md(出错时改用其他本地模型,本地为主不上传)、docs/site/{,zh/}dictation/history.md(详情里的服务商与候补原因)。站点文档同步检查通过。docs/site/public/screens/local-{zh,en}-light.webp。这两张图背景里露出候补区块,区块多了开关一行。其他截图不受影响:历史页截图的示例记录没有服务商字段,AI 模型页截图拍不到候补区块。验证(head
c59bab8520fd6426b520752f35bb2d136ddabfd7)make verify(干净 HEAD):commit=c59bab8520fd6426b520752f35bb2d136ddabfd7 dirty_paths=0 gates=all,21 个门禁全部通过(overall_exit=0)。Rust 过滤后行覆盖 92.82%;前端行覆盖 shared 95.42%、ui 97.89%、desktop 97.57%、mobile 97.69%、mobile-rn 97.31%(36 个测试套件、278 个测试)。scripts/windows-remote.sh gate test(日志开头commit c59bab852):本 PR 涉及的测试全部通过,包括 voltip-core lib 566 个、tests/fallback.rs4 个、tests/long.rs15 个、tests/import.rs11 个、voltip-cloud27 个、voltip-asr-local45 个、contract.rs13 个。失败的 2 个是 main 上就有、与本 PR 无关的voltip-relaysocket.rsgone-silent 和voltip-transportlink.rsprobe。ci.ymlrun 41190735559(headc59bab85)全部成功,其中macos-aarch64 · build + native run、macos-x64 · build + native run和CI Success都通过。PR 本身的检查见下方。fd31c75e(feat: 电脑端词典新增学习建议,一键把 AI 润色改正的写法加入词典或忽略,规则页提示有问题的规则 #208、feat: 电脑端新增自动备份,每周、更新安装前和替换导入前各备份一份,每台电脑保留自己最近 5 份 #209)时没有冲突。核对过:COMMANDS、UiState、UiEvent、ALL_EVENT_TAGS本 PR 没有改;HistoryEntry与history/revs.rs的shallow()只有本 PR 改;设置里 feat: 电脑端新增自动备份,每周、更新安装前和替换导入前各备份一份,每台电脑保留自己最近 5 份 #209 的backup字段与本 PR 的on_outage都在;docs/dictation.md的 §3.14、§4.6.1、§16.10、§28、§29、§31 都在;站点dictation/history.md保留 feat: 电脑端新增自动备份,每周、更新安装前和替换导入前各备份一份,每台电脑保留自己最近 5 份 #209 的「自动备份」小节。变基后重新生成 IPC 夹具,没有变化。voltip-core的候补、冷却与截止点测试,tests/long.rs两个分段候补测试,tests/fallback.rs全部,tests/import.rs两个导入测试,各 200 次,0 失败。pnpm tauri dev -- --bin voltip-desktop,Xvfb,独立数据目录,内存密钥库,两个只监听 127.0.0.1 的假 OpenAI 兼容服务,本地模型 paraformer-zh 与一个故意损坏的 qwen3-asr-0.6b):outage;需要在用户电脑上做的验证
未决项
asr_note与refine_failure,没有改。风险与回滚
serde(default),空值不写),旧设置和旧历史照常读取;旧版本读到新字段会忽略。降级时有一处例外:候补列表里加了本地模型的话,旧版本照常听写,但在删掉这一项之前,保存语音模型设置和「换用其他模型重新识别」会被旧版本的检查拒绝(旧版本不允许本地模型作候补)。