fix(asr): surface Volcengine 403 as 'credentials rejected'#438
Merged
Conversation
… raw HTTP error 用户反馈"豆包云端语音连接不了",日志显示 9 次相同的: [coord] open ASR session failed: connection failed: HTTP error: 403 Forbidden 原因不是网络不通(网络通到 Volcengine 才会有 HTTP 状态码),而是凭据被拒: App ID / Access Token 错、或账号没开通 SAUC bigmodel 资源。当前 capsule 显示原始 `HTTP error: 403 Forbidden`,用户看不懂、客服需要解释一遍。 修法:在 volcengine.rs 加 classify_connect_error 函数,握手收到 401/403 时 转成新的 VolcengineASRError::AuthRejected(status) variant;它的 thiserror display 直接是中文「凭据被拒(HTTP 403):请检查 Settings → 凭据 → Volcengine 的 App ID 和 Access Token,或确认账号已开通 SAUC bigmodel 资源」。 coordinator 沿用原有错误透传路径,capsule 文案自动从英文变中文具体引导。 其它握手错误(DNS / TLS / connection refused)仍走 ConnectionFailed,文案不变。 cargo test 258 全过。
PR Reviewer Guide 🔍(Review updated until commit 1234dcd)Here are some key observations to aid the review process:
|
原文案带 Settings 引导 + SAUC 资源说明,capsule 上显得拥挤。简化到 5 个字 + 状态码,原因留在错误类型 doc comment 里。
|
Persistent review updated to latest commit 1234dcd |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
User description
Summary
用户反馈日志(openless-2026-05-15T01-12-07.log)显示 9 次连续:
```
[coord] open ASR session failed: connection failed: HTTP error: 403 Forbidden
```
诊断:HTTP 403 是 Volcengine bigmodel ASR 在 WebSocket 握手阶段返回的,网络通到了 Volcengine 服务器(不然不会有 HTTP 状态码),但服务端拒绝。这是凭据问题(App ID / Access Token 错、Resource ID 错、或账号没开通 SAUC bigmodel 资源),不是网络 / 代码 bug。
但当前 capsule 显示原始
HTTP error: 403 Forbidden,普通用户不会读 → 反馈到客服。改动
`volcengine.rs`:
用户看到的新文案:
Test plan
不发 tag
按 hotfix 计划,merge 到 beta 后不发 `v1.3.2-3-beta-tauri` tag,下一个 Beta 一起出去。
PR Type
Bug fix
Description
Classify Volcengine 401/403 handshakes
Surface credential rejections as
AuthRejectedKeep other connect failures unchanged
Diagram Walkthrough
File Walkthrough
volcengine.rs
Classify Volcengine handshake credential errorsopenless-all/app/src-tauri/src/asr/volcengine.rs
AuthRejected(u16)for 401/403 handshake responsesconnect_asyncerror mapping withclassify_connect_errorConnectionFailed