From d74384f6e2a1d0b04f7788883d1b599e7e0b85fa Mon Sep 17 00:00:00 2001 From: tidely <43219534+tidely@users.noreply.github.com> Date: Mon, 1 Sep 2025 00:42:57 +0300 Subject: [PATCH] anthropic: Remove logging when no credentials are available (#37276) Removes excess log which got through on each start of Zed ``` ERROR [agent_ui::language_model_selector] Failed to authenticate provider: Anthropic: credentials not found ``` The `AnthropicLanguageModelProvider::api_key` method returned a `anyhow::Result` which would convert `AuthenticateError::CredentialsNotFound` into a generic error because of the implicit `Into` when using the `?` operator. This would then get converted into a `AuthenticateError::Other` later. By specifying the error type as `AuthenticateError`, we remove this implicit conversion and the log gets removed. Release Notes: - N/A --- crates/language_models/src/provider/anthropic.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/language_models/src/provider/anthropic.rs b/crates/language_models/src/provider/anthropic.rs index c492edeaf569fe5eeedadd840bd6338c073b48dd..6c003c4c3919a9f553024c6b1b56d03d410d984b 100644 --- a/crates/language_models/src/provider/anthropic.rs +++ b/crates/language_models/src/provider/anthropic.rs @@ -197,7 +197,7 @@ impl AnthropicLanguageModelProvider { }) } - pub fn api_key(cx: &mut App) -> Task> { + pub fn api_key(cx: &mut App) -> Task> { let credentials_provider = ::global(cx); let api_url = AllLanguageModelSettings::get_global(cx) .anthropic