Skip to content

feat(polish): support ASR-driven Rhai polish strategies - #1262

Open
HKLHaoBin wants to merge 11 commits into
Open-Less:betafrom
HKLHaoBin:HKLHaoBin/polish-asr-llm
Open

HKLHaoBin wants to merge 11 commits into
Open-Less:betafrom
HKLHaoBin:HKLHaoBin/polish-asr-llm

Conversation

@HKLHaoBin

@HKLHaoBin HKLHaoBin commented Oct 24, 2026 •

Copy link
Copy Markdown
Collaborator

摘要

Closes #1225。

  • 在 ASR 最终转写及纠错完成后、普通 LLM 润色调用前,增加可选、默认关闭的 Rhai 润色策略;支持 skip、polish 和 request 三类决策。
  • 公开文本、非空白 Unicode 字符数、音频时长、语言、置信度、实际 ASR 服务及模型信息;支持单次请求覆盖温度、输出 token 上限及推理强度,保留模型能力限制。
  • 脚本采用有界沙箱,无文件/网络/进程能力;空脚本、无效返回值或执行错误回退至原有润色流程。不改变翻译、Voice Edit、云笔记、QA 和短文本阈值等既有规则。
  • 增加设置项、加密同步和 Linux egui 策略编辑;React 设置编辑器旁提供“复制 Agent 编写说明”,复制契约及当前草稿,由用户自行交给 Agent 编写并审核,不自动调用 Agent 或回写脚本。
  • 增加核心/契约/剪贴板/E2E 测试及 docs/polish-strategy.md 使用说明。

与最新 beta 集成

本分支通过合并上游 beta 更新,不重写已推送历史;保留上游新加入的云端/本地 ASR 竞速、离线回退、语音唤醒、ChatGPT Plan 及 Linux 设置改动,策略元数据跟随实际获胜的 ASR 结果。

验证

本轮未在本地执行编译、测试、打包或依赖构建;全部自动化验证与桌面/移动端产物均在 GitHub Actions 执行。最终验证提交:1754a3dcbe43fb2cdfb5233210cb0d5b743d359e,已包含上游最新 beta(38fbe1c0)。

验证 结果
上游 PR CI 通过:Windows、macOS、Rust 1.99 MSRV、Linux Core/egui、Android、Harmony、Chromium/WebKit
iOS 测试及设备构建 通过
Fork 完整 CI 通过
桌面端构建 Windows x64、macOS Apple Silicon / Intel 全部通过
Android 构建 arm64-v8a APK 通过

Linux 发布 job 按 PR 工作流规则跳过,测试和打包检查均已通过。所有后续修复均经 Bugbot 定向复审,最终结论为 No bugs found。已修复合并后的 Rhai feature 依赖锁、iOS 隔离补丁上下文、ASR 激活回滚兼容性及动画测试采样器安装与点击之间的同步缺口;未放宽 --locked 或测试断言。

最终提交的测试产物

PR 无合并冲突;仍需上游维护者完成审批。未合并 PR,未启用自动合并。

真实设备上的使用体验仍欢迎 Issue 提出者验收;自动化通过不代替真机体验验证。

🤖 Generated with Claude Code

HKLHaoBin and others added 11 commits October 18, 2026 09:07
Add a bounded Rhai policy between corrected transcription and LLM polishing, including provider-aware request overrides, shared and Linux settings, encrypted preference sync, documentation, and regression coverage.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Add a clipboard-ready Rhai contract and current-draft prompt for coding agents, plus robust clipboard fallback and localized settings feedback.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Preserve ASR fallback and voice activation behavior, carry actual ASR metadata into strategies, update all platform lockfiles, and disable filesystem imports in the Rhai sandbox.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Keep portable-atomic enabled through once_cell in all four platform lockfiles. Refresh the isolated iOS patch anchors while preserving its translation policy and regression coverage.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Remove the obsolete credential ownership guard so local runtime retirement still runs when the selected channel changes during model validation. Restore the upstream implementation covered by the failing activation regression contract.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Await listener registration before clicking switches so browser context setup cannot race transitionrun. Preserve all animation assertions and frame sampling, without delays or retries.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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.

[polish] 支持根据 ASR 结果和元数据,自定义 LLM 润色策略与调用参数

1 participant