Skip to content

feat: 运行期间定时检查更新与一键重启安装,新增六家润色服务商,失败时显示服务原因 - #187

Merged
sunerpy merged 1 commit into
mainfrom
fix/refine-failure-reason
Oct 24, 2026
Merged

sunerpy merged 1 commit into
mainfrom
fix/refine-failure-reason

Conversation

@sunerpy

@sunerpy sunerpy commented Oct 24, 2026

Copy link
Copy Markdown
Owner

改动

这一个 PR 合并为补丁版本 0.1.8(用户 2026-10-25 要求):

  • 应用内升级(apps/desktop/src-tauri/src/update.rs,dictation.md §9「运行期间再检查」,做法同 Lockra 0.16.3):开启自动更新后,启动 10 秒后检查一次,此后每次检查结束 4 小时再检查(AutoSchedule,在 UpdateSlot::finish 排下一次;手动检查也算)。只有启动检查可以安装 update-ready.json 记下的版本,之后的检查只下载;ready / installing 后不再检查;失败 4 小时后再试;关掉开关清掉已排的检查。标题栏「重启以更新」一次点击就开始安装(对话框直接显示「正在安装」),悬停提示写明版本;设置里的说明写明两个时间。Windows 照旧以 /S 静默安装(0.1.7 起)。
  • 测试构建:编译期 VOLTIP_UPDATE_INTERVAL_SECS(至少 60 秒)缩短间隔;清单地址是 http:// 且都在本机或局域网(localhost、回环、私有或链路本地 IPv4)时,注入的插件配置带 dangerousInsecureTransportProtocol,否则发布构建会拒绝 http 地址。公网主机仍必须 https,安装包照旧验签;发布构建不设这两个变量。
  • 润色服务商:Kimi、智谱 GLM(一张卡片可切换中国站与国际站)、火山方舟、腾讯混元(TokenHub)、小米 MiMo、OpenRouter;每家预设 2–3 个模型,填好密钥后从服务商拉取模型列表;按模型族控制思考与温度(chat_controls,Kimi K3 不能传 temperature)。图标取自 Lobe Icons(bcdb7c8),首页列表依赖 feat(voltip): AI 润色服务商新增 Kimi、智谱 GLM 等六家的图标 firlab#113(已合并)。
  • 失败原因(新 crate voltip-reply,§3.12):识别、润色、测试连接失败时显示服务的原话,遮住密钥、令牌和账号;客户端自己的英文说法由 serviceReasonText 换成界面语言(同步文档站时发现界面把「ASR rejected the credentials」夹在中文里)。
  • Google AI Studio 润色失败(§3.11):503 繁忙归为「服务繁忙」,Gemini 用 reasoning_effort: low 和更大的输出上限,记录里写原因。
  • 文档:dictation.md、frontend.md、acceptance.md、文档站更新、隐私、云端服务和润色页(中英文),AGENTS.md 加了品牌图标的规则(用户 2026-10-25:图标遵循 LobeHub Icons)。

验证

  • make verify(toolchain 1.98.0):除格式检查外全部通过(Rust 覆盖率门槛、clippy、cargo-deny、IPC e2e、web lint/typecheck/coverage/build、台账、主机名扫描、发布脚本、自建网关);格式问题修正后 cargo fmt --check 与 pnpm -r run format:check 通过。
  • 新测试:update.rs 在暂停时钟上验证 4 小时间隔、启动检查的安装许可只用一次、ready 停止检查、开关;tests/update.rs 用本地清单服务器验证运行期间再检查(去掉排期那一行后测试超时失败)、开关关闭时手动检查不排检查;UpdateDialog.test.tsx 验证「重启以更新」一次点击调用 update_install 一次(去掉调用后测试失败);labels.test.ts 覆盖每种客户端说法的中英文。两个依赖时间的集成测试在所有核心满载下各运行 200 次。
  • 真机(用户的 Windows,2026-10-25):测试构建 A(0.1.7,局域网清单,120 s,测试密钥)启动 10 s 后已是最新;放上 0.1.8 清单后,第一次检查结束整 120 s 时再检查,下载并校验 30 MB 安装包,之后不再检查;界面自动化点击「重启以更新」,3.3 s 后插件启动安装器,约 6 s 后 0.1.8 打开。scripts/smoke-windows-update.ps1 按插件参数运行同一安装器:/S 512 次采样没有窗口,/P 833 次采样 0 次可见,都重新打开 Voltip。

未验证

  • 真实 4 小时的间隔没有在真机上等过(真机用 120 s 的测试构建,4 小时由暂停时钟测试覆盖);睡眠时间不计入间隔(单调时钟)。
  • 六家新服务商没有用真实密钥测试(模型、思考参数按各家文档实现)。
  • macOS 任务不在 PR 上运行,会在分支上手动触发一次。

开启自动更新后,启动 10 秒后检查一次,此后每次检查结束 4 小时再检查;之后的检查只下载,下载好后不再检查,等用户点标题栏的「重启以更新」。Windows 上照旧由安装程序在后台安装,不显示窗口。

feat: AI 润色新增 Kimi、智谱 GLM、火山方舟、腾讯混元、小米 MiMo 和 OpenRouter,Kimi 与智谱可切换中国站和国际站

feat: 识别、润色和测试连接失败时显示服务返回的原因,其中的密钥和账号已遮住

fix: Google AI Studio 繁忙或思考用完输出上限时,润色会说明原因,不再只显示「请求失败」
@codecov

codecov Bot commented Oct 24, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 96.85746% with 28 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
crates/voltip-cloud/src/lib.rs 61.11% 7 Missing ⚠️
crates/voltip-refine/src/client.rs 98.19% 4 Missing ⚠️
apps/desktop/src-tauri/src/update.rs 98.52% 3 Missing ⚠️
packages/shared/src/labels.ts 89.65% 0 Missing and 3 partials ⚠️
packages/shared/src/tauri-backend.ts 0.00% 3 Missing ⚠️
apps/desktop/src-tauri/src/lib.rs 0.00% 2 Missing ⚠️
apps/desktop/src/features/history/RefineNote.tsx 66.66% 0 Missing and 2 partials ⚠️
crates/voltip-core/src/runtime.rs 50.00% 1 Missing ⚠️
crates/voltip-reply/src/lib.rs 99.40% 1 Missing ⚠️
packages/shared/src/engine-drafts.ts 91.66% 0 Missing and 1 partial ⚠️
... and 1 more

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #187      +/-   ##
==========================================
+ Coverage   93.78%   93.85%   +0.06%     
==========================================
  Files         388      390       +2     
  Lines       55271    56009     +738     
  Branches     3743     3765      +22     
==========================================
+ Hits        51836    52567     +731     
  Misses       2939     2939              
- Partials      496      503       +7     
Flag Coverage Δ
rust 94.00% <97.79%> (+0.09%) ⬆️
web 93.26% <86.48%> (-0.05%) ⬇️

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

Files with missing lines Coverage Δ
apps/desktop/src/features/update/UpdateDialog.tsx 98.50% <100.00%> (+0.17%) ⬆️
apps/desktop/src/pages/history/DetailParts.tsx 100.00% <100.00%> (ø)
apps/desktop/src/pages/history/HistoryDetail.tsx 86.95% <100.00%> (+0.05%) ⬆️
apps/mobile/src-tauri/src/lib.rs 77.05% <100.00%> (ø)
crates/voltip-asr/src/client.rs 98.33% <100.00%> (+0.02%) ⬆️
crates/voltip-asr/src/dashscope.rs 99.80% <100.00%> (+<0.01%) ⬆️
crates/voltip-asr/src/duplex.rs 94.72% <100.00%> (+0.07%) ⬆️
crates/voltip-asr/src/error.rs 100.00% <100.00%> (ø)
crates/voltip-core/src/dictation/engine.rs 97.36% <100.00%> (+0.01%) ⬆️
crates/voltip-core/src/dictation/fakes.rs 99.70% <100.00%> (+<0.01%) ⬆️
... and 28 more

... and 3 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 48bda94 into main Oct 24, 2026
31 checks passed
@sunerpy
sunerpy deleted the fix/refine-failure-reason branch October 24, 2026 20:31
@github-actions github-actions Bot mentioned this pull request Oct 24, 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