fix: complete canonical language channel acceptance

This commit is contained in:
冰朔 2026-08-20 05:33:35 +08:00
commit e72ee85b89
7 changed files with 105 additions and 17 deletions

View file

@ -491,7 +491,7 @@ async fn invoke_provider(
.map(str::to_string)
.or_else(|| (!config.model.is_empty()).then_some(config.model.clone()))
.ok_or_else(|| "HOLOLAKE_MODEL_SELECTION_REQUIRED".to_string())?;
let secret = read_secret(app, provider_id).ok();
let secret = read_secret_bounded(app, provider_id).await.ok();
match config.kind.as_str() {
"OPENAI_COMPATIBLE" => invoke_openai_compatible(
&config,
@ -1015,13 +1015,6 @@ fn secret_account(app: &AppHandle, provider_id: &str) -> Result<String, String>
Ok(format!("{scope}:{provider_id}"))
}
fn read_secret(app: &AppHandle, provider_id: &str) -> Result<String, String> {
Entry::new(SECRET_SERVICE, &secret_account(app, provider_id)?)
.map_err(|error| format!("HOLOLAKE_MODEL_KEYCHAIN_UNAVAILABLE: {error}"))?
.get_password()
.map_err(|_| "HOLOLAKE_MODEL_SECRET_NOT_FOUND".to_string())
}
pub(crate) async fn codex_execution_model_route(
app: &AppHandle,
) -> Result<Option<CodexExecutionModelRoute>, String> {