From 105fb99dc0ef04e26ccc40d3ba22f7b0453a9216 Mon Sep 17 00:00:00 2001 From: sim Date: Thu, 10 Sep 2026 13:15:46 +0800 Subject: [PATCH] =?UTF-8?q?fix(core):=20volcengine=20=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E5=88=A4=E5=AE=9A=E4=B8=8D=E5=86=8D=E8=A6=81=E6=B1=82=20resour?= =?UTF-8?q?ce=20id=E2=80=94=E2=80=94=E8=BF=90=E8=A1=8C=E6=97=B6=E7=95=99?= =?UTF-8?q?=E7=A9=BA=E4=BC=9A=E5=9B=9E=E8=90=BD=E9=BB=98=E8=AE=A4=E8=B5=84?= =?UTF-8?q?=E6=BA=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 听写运行时对空 resource id 回落 volc.seedasr.sauc.duration(resolve_resource_id), 但 volcengine_configured 把它当硬门槛:合法的「密钥齐全、资源 id 留空」配置被误报 「语音识别未配置」并每次启动弹配置提示。认证是否就绪只取决于密钥本身。 --- .../app/crates/openless-core/src/provider_rules.rs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/openless-all/app/crates/openless-core/src/provider_rules.rs b/openless-all/app/crates/openless-core/src/provider_rules.rs index 4b460aca..9bcbe439 100644 --- a/openless-all/app/crates/openless-core/src/provider_rules.rs +++ b/openless-all/app/crates/openless-core/src/provider_rules.rs @@ -334,7 +334,9 @@ pub struct CredentialConfiguration { pub fn volcengine_configured(configuration: &CredentialConfiguration) -> bool { use crate::asr::volcengine::VolcengineAuthMode; - let credentials_ready = match configuration + // resource id 不是配置门槛:留空时运行时回落默认资源 + //(见 VolcengineCredentials::resolve_resource_id),认证只取决于密钥本身。 + match configuration .volcengine_auth_mode .as_deref() .map(VolcengineAuthMode::parse) @@ -344,8 +346,7 @@ pub fn volcengine_configured(configuration: &CredentialConfiguration) -> bool { configuration.volcengine_app_key && configuration.volcengine_access_key } VolcengineAuthMode::ApiKey => configuration.volcengine_api_key, - }; - credentials_ready && configuration.volcengine_resource_id + } } pub fn asr_configured( @@ -962,6 +963,9 @@ mod tests { configuration.volcengine_api_key = true; configuration.volcengine_resource_id = true; assert!(volcengine_configured(&configuration)); + // resource id 留空(运行时回落默认资源)不构成「未配置」。 + configuration.volcengine_resource_id = false; + assert!(volcengine_configured(&configuration)); assert!(!asr_configured( "foundry-local-whisper", &configuration,