Commit Graph
481 Commits
Author SHA1 Message Date
baiqing e090eb2a3b fix(tauri): 锁 Rust crate ~2.10 — 修 npm/Rust 跨 minor 版本检查 fail
CI release-tauri.yml 三平台 (mac arm64 / Windows / Linux) Build step 在
~10 秒内全部失败:

    Found version mismatched Tauri packages.
    tauri (v2.11.0) : @tauri-apps/api (v2.10.1)

根因:
- Cargo.toml 写 \`tauri = { version = "2" }\`,cargo 解析到 latest 2.x = 2.11.0
- npm \`@tauri-apps/api\` / \`@tauri-apps/cli\` latest 仍是 2.10.1(Tauri 团队
  把 Rust crate 发到了 crates.io 2.11,但 npm 包还没同步发 2.11)
- tauri build 启动时校验 npm 与 Rust crate 必须 major+minor 一致,跨 minor
  直接 fail——三平台都没机会跑到 bundle 阶段。

修复:
- Cargo.toml 把 \`tauri\` 锁成 \`~2.10\`,让 cargo 选 2.10.x patch 版本,
  与 npm 端 2.10.1 对齐。
- cargo update 精确下调到 tauri 2.10.3 / tauri-runtime 2.10.1 /
  tauri-runtime-wry 2.10.1(连带 wry 0.55.1→0.54.4 / tray-icon 0.23.1→0.21.3
  等 transitive 依赖一并回退,让 lock 内部一致——这也是 Cargo.lock diff 大
  的原因,所有改动都是 \`cargo update\` 自动算出来的,没有手改)。

等 Tauri 团队把 npm @tauri-apps/api 2.11 发布后,再放开 Cargo.toml 的
约束。期间 package-lock.json 保持 2.10.1,CI 走 \`npm ci\` 不会自动漂。
2026-05-06 11:55:39 +08:00
TRIP 6b38e5ef1d Merge pull request #280 from appergb/chore/release-prep-dedupe-nsis
chore(release-prep): 清理 #268/#279 双 NSIS 方案残留
2026-05-06 11:25:56 +08:00
baiqing 3414e1ff5e chore(release-prep): 修 P2 + 清理 noop bundle.resources override
完整审查 CI 流程后发现两类问题:

1. windows-build-gnu.ps1 不 build OpenLessIme.dll 也不 export
   OPENLESS_IME_DLL_X64 / _X86 env,但 NSIS hook (nsis/openless-ime-hooks.nsh)
   PREINSTALL 用 File "$%OPENLESS_IME_DLL_X64%" / _X86 引用 dll,
   makensis 编译时 env 为空 → File 路径无效 → NSIS bundle 失败。
   补 IME dll 双平台 (x64 / Win32) build + Set-Item Env:。
   (Codex PR #280 P2 review)

2. build-mac.sh 之前为绕过 bundle.resources 占位 dll 加的
   --config '{"bundle":{"resources":{}}}' override,
   PR #280 已删除 bundle.resources,此 override 退化为 noop,删除让命令更干净。

release-tauri.yml 还有 2 处同源遗留("复制 dll 到 openless-ime-payload"
死步骤、Linux build 同样的 noop override)需要 workflow scope 才能动,
留待下一个 PR。
2026-05-06 11:20:24 +08:00
baiqing 7799b5e0d2 chore(release-prep): 清理 #268/#279 双方案残留
main 上 #268 (millionart/codex/register-windows-ime-nsis-installer) 与 #279
(本人) 都修了 NSIS 注册 TSF DLL,merge #279 时未手动解决冲突,导致:

1. tauri.conf.json 出现两个 windows.nsis block(line 92-95 和 105-108),
   serde_json 用最后写入的覆盖前面,结果 #268 的 nsis/openless-ime-hooks.nsh
   被丢弃,实际生效的是 #279 的 installer.nsh。
2. #279 的 bundle.resources 把 dll 多打一份到 $INSTDIR\tsf-ime\,与 #268
   PREINSTALL File 直接装到 $INSTDIR\windows-ime\ 并存。
3. installer.nsh 与 openless-ime-payload/ 残留为死代码。

#268 方案更稳:x64 注册带 Sysnative + DisableX64FSRedirection 双保险,有
POSTUNINSTALL 清理 hook,有测试覆盖(4a7a1b6b/test、933e014a/test),且
不污染 MSI(不用 bundle.resources,避免 dll 重复)。

清理:
- 删除 tauri.conf.json 重复 nsis block,保留 nsis/openless-ime-hooks.nsh
- 删除 bundle.resources(#268 不需要)
- 删除死文件 installer.nsh
- 删除死目录 openless-ime-payload/

release-tauri.yml 里"复制 dll 到 openless-ime-payload"步骤、build-mac.sh
与 Linux build 的 --config '{"bundle":{"resources":{}}}' override 暂留 —
没有 bundle.resources 后这些是 noop,不会破坏 build;当前 token 没有
workflow scope,等下一次有需求再清。
2026-05-06 11:12:06 +08:00
TRIP b84b0bdae3 Merge pull request #279 from appergb/fix/local-asr-release-flow
fix(windows): NSIS 安装包注册 TSF DLL + local-asr RAM 真正归还
2026-05-06 11:07:27 +08:00
baiqing 81fa80da69 fix(windows): NSIS x64 dll 用 Sysnative 绕过 WOW64 重定向
NSIS installer 是 32-bit 进程,进程内的 $SYSDIR / $WINDIR\System32 都因
WOW64 文件系统重定向变成 $WINDIR\SysWOW64,跑的是 32-bit regsvr32 → x64 dll
被注册到 HKLM\Software\Wow6432Node\Classes\CLSID(KEY_WOW64_32KEY 视图)。
但 windows_ime_profile.rs 用 KEY_WOW64_64KEY 校验时只看 HKLM\Software\Classes
\CLSID,永远查不到 → 仍判 RegistrationBroken("OpenLess COM registration is
missing")。

修复:x64 改用 $WINDIR\Sysnative\regsvr32.exe — 这是 32-bit 进程访问真
64-bit System32 的专用 alias,写入会落在 KEY_WOW64_64KEY 视图。x86 保持
SysWOW64 不变(确实需要 32-bit regsvr32 写 Wow6432Node)。
2026-05-06 10:52:12 +08:00
baiqing c52658b08b fix(windows): NSIS 也注册 32-bit TSF DLL — 修 P1 review
Codex review 发现:windows_ime_profile.rs::inspect_windows_ime_registration() 同时
用 KEY_WOW64_64KEY 和 KEY_WOW64_32KEY 两次检查 HKLM\Software\Classes\CLSID\{...}\
InprocServer32,少了任一边就返回 RegistrationBroken("OpenLess 32-bit COM
registration is missing")。MSI 流程通过 wxs 同时跑了 64-bit 和 SysWOW64\regsvr32
注册两份;之前的 NSIS hook 只注册了 x64,所以 NSIS / updater 用户依然在 Settings
页看到「不可用」。

修复:
- bundle.resources 拆出 x64 / x86 两份 dll target;x64 → tsf-ime\x64,x86 → tsf-ime\x86
- installer.nsh PostInstall/PreUninstall 增加 x86 分支,
  x86 用 $WINDIR\SysWOW64\regsvr32.exe(写 KEY_WOW64_32KEY 必需)
- CI Build Windows IME native DLLs 步骤把复制 dll 移到循环里,x64 + x86 都覆盖
  仓库占位
- 仓库新增 0 字节 x86 占位 dll,让本地 mac/linux 构建也能 resolve resources
2026-05-06 10:47:03 +08:00
baiqing 5aec74653b fix(windows): NSIS 安装包注册 OpenLess TSF DLL — 修"输入法后端:不可用"
## 现象
1.2.15 起在 Settings 页"Windows 输入法后端"出现 Pill「不可用」。`get_windows_ime_status()`
查 HKLM 注册表四件套(COM CLSID + TSF LanguageProfile + 三个 Category),缺一即报 NotInstalled。

## 根因
- MSI 通过 wix/openless-ime.wxs 的 RegisterOpenLessIme* CustomAction 跑 regsvr32 → 注册齐全。
- NSIS 包既没把 OpenLessIme.dll 打进去(wxs.componentRefs 是 MSI-only),也没 hook 跑
  regsvr32 → 用 setup.exe 安装的用户、走 updater 自动升级的存量用户全部命中"不可用"。
- 由于 updater latest-windows-x86_64.json 是 NSIS pass 写的,老 MSI 用户每次更新后也
  会被替换为没 TSF 的 NSIS 版本。

## 修复
- 加 src-tauri/installer.nsh:NSIS_HOOK_POSTINSTALL/PREUNINSTALL 跑 regsvr32 注册/反注册。
- bundle.resources map 把 OpenLessIme.dll 拷贝到 $INSTDIR\tsf-ime\OpenLessIme.dll
  (target 路径避开 wxs File 已声明的 windows-ime\x64\,避免 MSI component 路径冲突)。
- bundle.windows.nsis.installMode = "perMachine",让 NSIS 以管理员身份运行(写 HKLM 必需)。
- CI 在 build native dll 后把真 dll 复制到 src-tauri/openless-ime-payload/x64/OpenLessIme.dll;
  仓库 commit 0 字节占位文件,让本地 mac 端 tauri build 也能 resolve resources 路径。
- build-mac.sh 与 Linux build 步骤加 --config '{"bundle":{"resources":{}}}' 跳过 Windows-only
  的 dll 占位,避免污染 mac .app / Linux .deb/.rpm/.AppImage。

## Trade-off
- NSIS perMachine 升级需要 UAC,老 currentUser 用户首次升级时多一次 UAC 提示。
- MSI 包里 dll 会有两份(wxs File + bundle.resources),磁盘冗余 ~几百 KB,无功能影响。
2026-05-06 10:41:07 +08:00
Chris233 7f1df503b9 Merge pull request #276 from H-Chris233/fix/issue-222-pr-agent-hardening
加固 PR-Agent workflow 的 secrets 暴露面
2026-05-06 08:08:40 +08:00
H-Chris233 bd4547b613 Pin PR-Agent runtime while preserving automatic reviews
The workflow must keep reviewing every PR and every pushed commit automatically, including fork PRs, so the hardening focuses on pinning the code that actually runs in the secrets-bearing job. The wrapper action commit still delegates to a mutable Docker tag, so the workflow now calls the PR-Agent container by immutable digest directly.

Constraint: Maintainer preference is automatic PR-Agent coverage for each PR and synchronize event.

Constraint: Issue #222 requires removing mutable third-party execution refs from the secrets-bearing path.

Rejected: Pin only the action repository commit | the wrapper Dockerfile still resolves pragent/pr-agent:github_action at runtime.

Rejected: Require trusted comment triggers for fork PRs | too inconvenient because new commits would not be reviewed automatically.

Confidence: medium

Scope-risk: moderate

Directive: If fork PR automation remains required, keep the runtime container digest-pinned and do not checkout PR head code in this workflow.

Tested: Parsed .github/workflows/pr-agent.yml with PyYAML and asserted docker:// sha256 form; git diff --check; grep confirmed no action ref or github_action tag remains in the workflow.

Not-tested: Live GitHub Actions execution or Docker Hub digest pull from this host.

Related: https://github.com/appergb/openless/issues/222
2026-05-06 07:51:46 +08:00
Chris233 56694db7f6 Merge pull request #275 from Hongbro886/docs
docs(readme): document macOS-only qwen-asr submodule init step
2026-05-06 07:12:31 +08:00
Chris233 f803361b5c Merge pull request #273 from H-Chris233/fix/issue-223-active-asr-credentials
fix(providers): 按 active ASR provider 返回配置状态
2026-05-06 07:11:00 +08:00
whoa bfc718323b docs(readme): document macOS-only qwen-asr submodule init step 2026-05-06 06:29:38 +08:00
H-Chris233 cb60a034b6 让凭据状态按 active provider 判断,修复错误配置提示
get_credentials 不再把 ASR 配置状态硬编码为 Volcengine,而是返回 active provider 与通用 asrConfigured/llmConfigured。前端 provider setup prompt 与 Overview 改为读取通用状态并展示 active provider 名称,避免 Whisper-compatible 用户已配置却持续被提示未配置。配置完成判定统一为 API Key 可空但 endpoint/model 必须存在:云端 ASR 需 endpoint/model,LLM 需 endpoint/model。保留旧字段做兼容过渡。

Constraint: 最小修改原则,保持现有 provider 凭据存储结构不变

Rejected: 只按 ASR API key 标记已配置 | keyless provider 会被误判,且 endpoint/model 缺失仍不可运行

Rejected: 彻底移除旧 volcengineConfigured/arkConfigured 字段 | 需要分阶段兼容前端调用

Confidence: high

Scope-risk: moderate

Reversibility: clean

Directive: Provider configured 表示具备 endpoint/model 基础配置;连接有效性仍由验证按钮负责

Tested: npm run -s build

Tested: cargo test -q (74 passed)

Related: #223
2026-05-06 00:23:19 +08:00
Chris233 b802dc4154 Merge pull request #274 from sora520/feat/mute-during-recording
feat(recording): mute system output while recording
2026-05-06 00:14:57 +08:00
Chris233 fa6d4d15c8 Merge pull request #270 from appergb/fix/local-asr-release-flow
fix(local-asr): 切走/删模型/手动释放时真正归还 RAM
2026-05-06 00:05:57 +08:00
Chris233 d7e3017fa9 Merge pull request #272 from sora520/fix/translation-hotkey-placeholder
fix(i18n): render translation hotkey placeholder
2026-05-06 00:02:32 +08:00
kaku.ki 78a38460ce fix(recording): make QA mute release idempotent 2026-05-06 00:13:44 +09:00
kaku.ki bb0fefc786 fix(recording): share mute guard across sessions 2026-05-05 23:56:26 +09:00
kaku.ki 9511eb6333 feat(recording): mute system output while recording 2026-05-05 23:28:56 +09:00
kaku.ki 72c14bc437 fix(i18n): render translation hotkey placeholder 2026-05-05 22:02:36 +09:00
Chris233 6d1ff0f872 Merge pull request #271 from H-Chris233/feat/ja-ko-output-language
feat(i18n): 增加日语/韩语支持并让输出语言随界面语言联动
2026-05-05 20:47:49 +08:00
H-Chris233 04536830a2 让界面语言直接驱动日文/韩文输出偏好并避免翻译链路冲突
在现有简繁联动基础上扩展 ja/ko 本地化与 outputLanguagePreference,保持不新增额外设置项。前端在语言切换时统一同步 chineseScriptPreference + outputLanguagePreference;后端在 polish/QA 链路注入输出语言偏好,但翻译链路固定以 target_language 为唯一约束,避免 UI 语言与翻译目标冲突。

Constraint: 用户要求最小修改且不新增独立输出语言开关

Rejected: 新增单独输出语言设置项 | 与既定交互约束冲突

Confidence: high

Scope-risk: moderate

Reversibility: clean

Directive: 翻译链路不要再次注入 output language 偏好,除非先定义与 target_language 的优先级规则

Tested: npm run -s build

Tested: cargo test -q (72 passed)

Not-tested: 真机端到端切换 ja/ko 后的实际模型输出体验
2026-05-05 20:28:38 +08:00
Chris233 5c1a796771 Merge pull request #268 from millionart/codex/register-windows-ime-nsis-installer
fix: register Windows IME from NSIS installer
2026-05-05 20:20:57 +08:00
baiqing 463a6d9716 fix(local-asr): 切走/删模型/手动释放时真正归还 RAM
三个问题合修:

1. 用户点"释放"按钮后活动监视器看 RSS 不下降。原因:encoder f32 weights
   是 malloc 出来的几百 MB,free 后 macOS libmalloc 不会立即把页归还内核。
   修:drop QwenAsrEngine 后调 malloc_zone_pressure_relief(NULL, 0),主动
   归还。decoder bf16 走 mmap 不依赖这个。

2. 切回云端 ASR 后本地引擎仍驻留。set_active_asr_provider 切到非 local
   时未释放,1.2GB+ RAM 一直留到进程退出。

3. 删除已下载的模型时未释放内存里加载的同 id 引擎,留下 mmap 指向已
   unlink 文件 + RAM 不归还的双重问题。

Windows 端本期不上线(cache.rs macOS cfg 块包住改动)。
2026-05-05 20:20:46 +08:00
millionart ec9f658a1d fix: harden Windows IME installer smoke 2026-05-05 19:31:49 +08:00
millionart b303ea405b fix: guard windows installer smoke exits 2026-05-05 19:05:56 +08:00
millionart 4a7a1b6b8c test: cover nsis ime edge cases 2026-05-05 18:51:29 +08:00
millionart eca76deaee fix: require machine nsis installs for ime 2026-05-05 18:50:10 +08:00
millionart dbbe419ffb fix: handle nsis ime installer edge cases 2026-05-05 18:49:36 +08:00
millionart 933e014a80 test: assert nsis uninstall ignores unregister failures 2026-05-05 18:36:17 +08:00
millionart 68ee9dfae4 fix: keep nsis uninstall non-blocking 2026-05-05 18:26:09 +08:00
millionart e67755d04e fix: address Windows IME installer review feedback 2026-05-05 18:16:48 +08:00
millionart 753236dd55 fix: register Windows IME from NSIS installer 2026-05-05 17:38:28 +08:00
Chris233 c4dba80f34 Merge pull request #265 from H-Chris233/feat/zh-tw-script-sync
Align Chinese output script with locale selection (zh-CN/zh-TW)
2026-05-05 17:31:28 +08:00
H-Chris233andOmX 7985476886 Avoid stale locale-script writes when language change awaits i18n switch
Latest review flagged that language handlers captured prefs before awaiting setLocalePreference, then replayed stale snapshots via object spread.

This adds functional update support to updatePrefs in HotkeySettingsContext and switches both language pickers to merge chineseScriptPreference against current prefs at write time.

Constraint: Keep the fix minimal and avoid refactoring unrelated settings flows
Rejected: Read prefs from IPC again before each write | Adds extra roundtrip and still duplicates merge logic
Confidence: high
Scope-risk: narrow
Reversibility: clean
Directive: Async settings handlers should pass functional updaters whenever they await before persisting
Tested: npm run -s build (openless-all/app)
Not-tested: cargo test -q (no Rust changes in this patch)
Related: https://github.com/appergb/openless/pull/265
Co-authored-by: OmX <omx@oh-my-codex.dev>
2026-05-05 17:03:22 +08:00
H-Chris233andOmX 1adde82f13 Apply script normalization when translation falls back to raw ASR
Latest PR review flagged that translation-mode failures were bypassing chinese script normalization because of a translation_active guard.

This narrows the condition to normalize only ASR-direct outputs, including translation fallback failures, while still avoiding normalization on successful translation/LLM outputs.

Constraint: Keep successful translation and polished LLM outputs untouched
Rejected: Remove all guards and always normalize final text | Would risk mutating successful non-ASR outputs
Confidence: high
Scope-risk: narrow
Reversibility: clean
Directive: Script normalization should run for any fallback-to-raw path regardless of translation mode
Tested: cargo test -q (openless-all/app/src-tauri)
Not-tested: Manual runtime translation failure simulation in desktop UI
Related: https://github.com/appergb/openless/pull/265
Co-authored-by: OmX <omx@oh-my-codex.dev>
2026-05-05 16:32:01 +08:00
H-Chris233andOmX 2970451f01 Prevent locale script sync from persisting stale preference snapshots
The review highlighted a race where script auto-sync could persist an older prefs snapshot while concurrent settings updates were queued.

This updates HotkeySettingsContext persistence to resolve the object at queue execution time from latestPrefsRef, then merge chineseScriptPreference into that latest shape for script sync writes.

Constraint: Keep fix minimal and limited to HotkeySettingsContext persistence flow
Rejected: Full settings-store refactor with transactional backend API | Out of scope for this review round
Confidence: medium
Scope-risk: narrow
Reversibility: clean
Directive: Any future auto-sync writes must merge against latest prefs before calling setSettings
Tested: npm run -s build (openless-all/app)
Not-tested: Full cargo test rerun (no Rust code changes in this patch)
Related: https://github.com/appergb/openless/pull/265
Co-authored-by: OmX <omx@oh-my-codex.dev>
2026-05-05 16:06:29 +08:00
H-Chris233andOmX 1075ba463f Keep Chinese output script aligned with the selected UI locale
This change binds locale selection to a persisted chineseScriptPreference so zh-CN and zh-TW drive output script consistently.

It injects script preference into LLM context for polish/translate/QA, removes ASR language-hint submission, and applies script conversion only in pure-ASR fallback paths. It also hardens preference persistence sequencing in HotkeySettingsContext to reduce write-order races.

Constraint: Must keep output script behavior coupled to locale choice without adding a new toggle
Constraint: ASR requests should not send language parameters
Rejected: Add an independent output-script option | Conflicts with required locale-driven behavior
Confidence: medium
Scope-risk: moderate
Reversibility: clean
Directive: Keep zh-CN=>simplified and zh-TW=>traditional mapping consistent in both Settings entry points and backend consumers
Tested: npm run -s build (openless-all/app)
Tested: cargo test -q (openless-all/app/src-tauri)
Not-tested: Live external provider E2E verification across multiple real ASR/LLM vendors
Related: #242
Co-authored-by: OmX <omx@oh-my-codex.dev>
2026-05-05 16:06:29 +08:00
TRIP c85b1bd4c6 Merge pull request #263 from appergb/fix/local-asr-pr-review-fixes
fix(local-asr): 修 PR #262 review 提的两个 bug
2026-05-05 13:36:55 +08:00
baiqing cd00ebc584 fix(local-asr): 修 PR #262 review 提的两个 bug
(1) 小文件路径 try_download_range_append 的 retry 污染:
  原实现用 append 模式打开 .partial。若上一次 attempt 已写了部分字节后失败,
  retry 拿到的还是完整 chunk → append → 文件比应有大小多 N 字节,永久损坏。
  改成 truncate(effective_start) + seek 写入,每次 attempt 从干净起点重写。
  小文件(≤ 32MB)每个 chunk 是整个文件,重写无成本。

(2) 多文件并发一个失败不 abort 其它 worker:
  原代码只 log "signaling others to stop",没真 set cancel flag。剩下的
  workers 会继续吃带宽直到全部完成才把错误冒上来。
  现在错误时主动 cancel.store(true),再用 self_aborted 标记区分这是"我们
  因错误 abort"还是"用户主动 cancel"——前者 emit Failed,后者 emit Cancelled,
  避免错误被误报成用户取消。

跟踪 PR: #262 review by github-actions PR Reviewer Guide
2026-05-05 12:59:01 +08:00
TRIP 438fce26ab Merge pull request #262 from appergb/feat/local-asr-qwen3
feat(local-asr): 加本地 Qwen3-ASR 引擎(macOS 优先)
2026-05-05 12:53:35 +08:00
baiqing 8c3e4aca0d Merge remote-tracking branch 'origin/main' into feat/local-asr-qwen3
# Conflicts:
#	openless-all/app/src-tauri/src/coordinator.rs
2026-05-05 12:48:13 +08:00
Chris233 a0cc88d2ac Merge pull request #260 from weikeyi/capsule-confirm-overflow
fix(capsule): keep confirm icon inside pill on done/error states
2026-05-05 12:46:39 +08:00
Chris233 f984dec84b Merge pull request #261 from sora520/fix/windows-hotkey-trigger-leak
fix(windows): suppress consumed hotkey trigger events
2026-05-05 12:42:27 +08:00
Chris233 3e1ba69bfc Merge pull request #252 from Cooper-X-Oak/fix/recorder-timeout-238
fix(recorder): 添加 liveness watchdog 和全局超时保护以修复 #238
2026-05-05 12:32:37 +08:00
kaku.ki 9c0ae1495a fix(windows): suppress consumed hotkey trigger events 2026-05-05 13:17:50 +09:00
baiqing 520787b0f7 feat(local-asr): 引擎内存常驻 + 切到本地时预加载 + 释放时机可配
用户痛点:之前每次按 hotkey 都重加载 1.2GB 模型 → 首句词延迟 3-5s。

新流程:
- 新 LocalAsrCache:模型一次 load 后驻留内存,跨多次会话复用
- LocalQwenAsr::new 改成接受 Arc<QwenAsrEngine>(引擎所有权挪到 cache)
- build_local_qwen3 改成 async + spawn_blocking 走 cache.get_or_load()
- 切换 active model 时自动 drop 旧引擎再加载新的
- end_session 后调 cache.touch() + schedule_local_asr_release
  - keep_loaded_secs == 0 → 立即释放
  - keep_loaded_secs > 0 → spawn 一个 sleep+check 任务,到点查 last_used,
    若中间又被使用过则跳过释放

预加载:
- commands::set_active_asr_provider("local-qwen3") 触发 preload_in_background
- 用户在「模型设置」页可手动「立即加载」/「立即释放」
- 实时显示「内存中的引擎: <model id>(约占 1.2-3.4 GB 内存)」
- 5 秒轮询刷新状态

新设置项:
- prefs.local_asr_keep_loaded_secs (u32,默认 300)
- UI 选项:说完话立即释放 / 1 min / 5 min(默认)/ 30 min / 始终保留
- 4 个新 IPC:local_asr_engine_status / release_engine / preload /
  set_keep_loaded_secs
2026-05-05 12:09:55 +08:00
baiqing 8ed674ecaf fix(local-asr): 多文件并发 + 8MB 小块 + aria2 UA — 对齐 hfd/hf_xet 实测
参考 hf-mirror 官方推荐工具 hfd(aria2 包装)+ hf_xet 默认 16 并发:
- PARALLEL_FILES = 3:原本顺序下文件,大 .safetensors 在跑时 6 个小文件
  全在排队;改成最多 3 个文件并发,让小文件不阻塞、大文件 throttle
  时剩余带宽喂别的文件
- PARALLEL chunks per file = 4 → 8:贴 hf_xet 默认 (16) 的折中
- CHUNK_SIZE = 32MB → 8MB:单连接寿命缩到 5-20s(CDN throttle 临界点之下),
  失败重做成本降 4 倍
- User-Agent: openless/x → aria2/1.36.0:实测 aria2 UA 在 HF / hf-mirror
  反滥用规则里走白名单;自定义 UA 在 sustained 传输后会被切流
  (日志里大量 "end of file before message length reached" 就是这个)

进度计算改成多文件汇总:每个文件 in_flight bytes 用 AtomicU64,全模型
总进度 = sum(in_flight) + already_done。失败时 cancel 标志传播给其它
spawn task 早退。
2026-05-05 11:33:46 +08:00
weikeyi dab04fc345 fix(capsule): keep confirm icon inside pill on done/error states 2026-05-05 11:17:49 +08:00