Skip to content

fix(engines): 候补模型顶替时的实时预览状态与隐私说明 - #94

Merged
sunerpy merged 4 commits into
mainfrom
fix/fallback-status
Oct 4, 2026
Merged

sunerpy merged 4 commits into
mainfrom
fix/fallback-status

Conversation

@sunerpy

@sunerpy sunerpy commented Oct 4, 2026

Copy link
Copy Markdown
Owner

Summary

Follow-up to #89 (fallback models, v0.0.35), from the completion review of that work.

  • Status follows the stand-in (ResolvedEngines::status_with): the pages now compute the live preview and the output mode from the first model with quota left, in the order the engine's chain asks them (open_order, shared with the chain). When a model that takes whole recordings only stands in for a used-up realtime model, the takes already ran whole; the pages still showed 边说边识别 as in effect. Now live_preview_ready is false, live_source stays stream, effective_output_mode is whole_take; 实时预览 shows "暂不可用 · 候补模型不支持实时识别" and the output mode block no longer asks for a model download. The TS mirror and the mock follow the same rule.
  • Privacy line: it named the fallback providers whatever the switch said. It now names them only while the chain runs (switch on, selected service usable).
  • Phone: the 语音模型 and AI 模型 pages show the 当前 line (with (候补) while a fallback model stands in) and the privacy line under the provider cards, as the desktop does. Both lines are shared components now (CurrentService, ServicePrivacy in packages/ui); shortModel moved to @voltip/shared.
  • Flaky test: one_request_at_a_time_and_a_preview_of_a_closed_sentence_is_dropped (from feat(dictation): the built-in service previews while you speak #77) read the fake's call count before the request's task had started: 16 of 640 runs failed with every core busy. It now waits for the call; only the decode thread's feed/poll send requests, so the count cannot move meanwhile.
  • Docs: dictation.md §3.5, frontend.md, acceptance.md, site cloud and privacy pages in both languages.

Testing

  • make verify on the pushed head 7b9cd66 (overall_exit=0, log bound to HEAD).
  • New regression tests, each failing without its fix: regression_the_status_shows_the_mode_the_next_take_runs_with (engine vs status), the_status_follows_the_model_that_stands_in_for_a_realtime_one, the TS mirror test, ServiceSummary.test.tsx, two desktop page tests, one phone page test.
  • With every core busy (32 busy loops next to 32 workers): the fallback engine, chain and redecode tests 640 runs, tests/fallback.rs 320 runs, the long-take fallback test 320 runs — no failures on 7b9cd66 (before the test fix: 16 of 640 failed, all in the redecode test above).

🤖 Generated with Claude Code

- status_with 按账本取第一个仍有额度的模型(open_order,与引擎的链同序)
- 整段识别模型顶替实时模型时,实时预览显示暂不可用,输出方式按整段输出生效
- TS 镜像与 mock 按同一规则计算,桌面不再提示下载模型
- 当前模型与隐私说明提取为共享组件 CurrentService、ServicePrivacy
- 开关关闭或当前选择不可用时,隐私说明不再列出候补服务商
- 手机的语音模型、AI 模型页在服务商卡片下方显示这两行
- 满核压力下 640 次中有 16 次读到 0 次调用:请求任务尚未开始执行
- 请求只由解码线程的 feed、poll 发出,等待期间计数不会再变
@codecov

codecov Bot commented Oct 4, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 96.21212% with 5 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
crates/voltip-core/src/dictation/redecode.rs 50.00% 2 Missing ⚠️
...ackages/ui/src/features/engines/ServiceSummary.tsx 93.10% 0 Missing and 2 partials ⚠️
packages/shared/src/engine-drafts.ts 50.00% 0 Missing and 1 partial ⚠️

Impacted file tree graph

@@           Coverage Diff           @@
##             main      #94   +/-   ##
=======================================
  Coverage   93.48%   93.48%           
=======================================
  Files         335      336    +1     
  Lines       47163    47250   +87     
  Branches     3143     3150    +7     
=======================================
+ Hits        44088    44173   +85     
- Misses       2669     2672    +3     
+ Partials      406      405    -1     
Flag Coverage Δ
rust 93.48% <97.56%> (+<0.01%) ⬆️
web 93.51% <94.00%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...desktop/src/pages/settings/engines/EnginesPane.tsx 100.00% <ø> (+2.98%) ⬆️
...desktop/src/pages/settings/engines/LivePreview.tsx 100.00% <ø> (ø)
.../desktop/src/pages/settings/engines/OutputMode.tsx 100.00% <100.00%> (ø)
apps/desktop/src/pages/settings/engines/helpers.ts 100.00% <100.00%> (ø)
apps/desktop/src/shell/page-meta.ts 95.94% <ø> (+1.20%) ⬆️
apps/mobile/src/screens/AiModels.tsx 84.61% <ø> (ø)
apps/mobile/src/screens/SpeechModels.tsx 88.23% <ø> (ø)
crates/voltip-core/src/dictation/engine.rs 97.36% <100.00%> (-0.06%) ⬇️
crates/voltip-core/src/dictation/fallback.rs 98.89% <100.00%> (+0.01%) ⬆️
crates/voltip-core/src/dictation/mod.rs 100.00% <ø> (ø)
... and 8 more

... and 2 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@sunerpy
sunerpy merged commit f09776d into main Oct 4, 2026
31 checks passed
@sunerpy
sunerpy deleted the fix/fallback-status branch October 4, 2026 05:48
@github-actions github-actions Bot mentioned this pull request Oct 4, 2026
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.

1 participant