Skip to content

fix(windows): ASR final result 等待加超时保护#120

Merged
appergb merged 1 commit into
Open-Less:mainfrom
Cooper-X-Oak:codex/windows-asr-final-timeout
May 1, 2026
Merged

fix(windows): ASR final result 等待加超时保护#120
appergb merged 1 commit into
Open-Less:mainfrom
Cooper-X-Oak:codex/windows-asr-final-timeout

Conversation

@Cooper-X-Oak
Copy link
Copy Markdown
Contributor

@Cooper-X-Oak Cooper-X-Oak commented May 1, 2026

Closes #97

修复要点

Windows 端结束录音后,Volcengine ASR 发送 last frame 之后会等待服务端 final result。此前这一步没有 deadline:如果服务端没有返回 final frame、但连接也没有立即断开,coordinator 会一直卡在 Transcribing

本 PR 给 final result 等待增加明确超时保护:

  • 默认最多等待 12 秒 final result。
  • 超时后记录错误日志并 cancel 当前 streaming ASR。
  • 返回明确的 FinalResultTimeout 错误,而不是无限 await。
  • coordinator 继续走既有错误胶囊和回到 Idle 的收尾路径。
  • 新增单测覆盖“final frame 永远不来”的路径。

测试计划

  • npm run build
  • cargo +stable-x86_64-pc-windows-gnu test --manifest-path openless-all\app\src-tauri\Cargo.toml --target x86_64-pc-windows-gnu asr::volcengine::tests::await_final_result_returns_error_when_final_frame_never_arrives --no-run
  • git diff --check
  • GitHub Actions: Windows Tauri checks 通过

备注

本机 GNU 测试二进制在运行阶段遇到 STATUS_ENTRYPOINT_NOT_FOUND,但测试目标已完成编译;因此本地使用 --no-run 作为 Rust 编译门禁,并由 GitHub Windows CI 补足平台检查。

Copy link
Copy Markdown

@sourcery-ai sourcery-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry @Cooper-X-Oak, you have reached your weekly rate limit of 500000 diff characters.

Please try again later or upgrade to continue using Sourcery

@Cooper-X-Oak Cooper-X-Oak changed the title fix(windows): add timeout for ASR final result fix(windows): ASR final result 等待加超时保护 May 1, 2026
@H-Chris233
Copy link
Copy Markdown
Collaborator

@codex review

@appergb appergb merged commit 6614fe2 into Open-Less:main May 1, 2026
2 checks passed
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.

[Windows][P1] ASR 结束态缺少 timeout/retry,可能长期卡在 Transcribing

3 participants