acp: Don't share API key with Anthropic provider (#37543)

Since Claude Code has it's own preferred method of grabbing API keys, we
don't want to reuse this one.

Release Notes:

- acp: Don't share Anthropic API key from the Anthropic provider to
allow default Claude Code login options

---------

Co-authored-by: Agus Zubiaga <agus@zed.dev>
This commit is contained in:
Ben Brandt
2025-09-04 16:01:50 +00:00
committed by GitHub
co-authored by Agus Zubiaga
parent e37efc1e9b
commit 0870a1fe80
2 changed files with 49 additions and 58 deletions
+4 -11
View File
@@ -1,4 +1,3 @@
use language_models::provider::anthropic::AnthropicLanguageModelProvider;
use settings::SettingsStore;
use std::path::Path;
use std::rc::Rc;
@@ -99,16 +98,10 @@ impl AgentServer for ClaudeCode {
.await?
};
if let Some(api_key) = cx
.update(AnthropicLanguageModelProvider::api_key)?
.await
.ok()
{
command
.env
.get_or_insert_default()
.insert("ANTHROPIC_API_KEY".to_owned(), api_key.key);
}
command
.env
.get_or_insert_default()
.insert("ANTHROPIC_API_KEY".to_owned(), "".to_owned());
let root_dir_exists = fs.is_dir(&root_dir).await;
anyhow::ensure!(