Skip to content

Commit e98dce7

Browse files
authored
fix: mute Claude API key warning if Bedrock in use (#18988)
Fixes: #17402
1 parent 482463c commit e98dce7

File tree

1 file changed

+17
-7
lines changed

1 file changed

+17
-7
lines changed

cli/exp_mcp.go

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ func (r *RootCmd) mcpConfigureClaudeCode() *serpent.Command {
127127
appStatusSlug string
128128
testBinaryName string
129129
aiAgentAPIURL url.URL
130+
claudeUseBedrock string
130131

131132
deprecatedCoderMCPClaudeAPIKey string
132133
)
@@ -154,14 +155,15 @@ func (r *RootCmd) mcpConfigureClaudeCode() *serpent.Command {
154155
configureClaudeEnv[envAgentURL] = agentClient.SDK.URL.String()
155156
configureClaudeEnv[envAgentToken] = agentClient.SDK.SessionToken()
156157
}
157-
if claudeAPIKey == "" {
158-
if deprecatedCoderMCPClaudeAPIKey == "" {
159-
cliui.Warnf(inv.Stderr, "CLAUDE_API_KEY is not set.")
160-
} else {
161-
cliui.Warnf(inv.Stderr, "CODER_MCP_CLAUDE_API_KEY is deprecated, use CLAUDE_API_KEY instead")
162-
claudeAPIKey = deprecatedCoderMCPClaudeAPIKey
163-
}
158+
159+
if deprecatedCoderMCPClaudeAPIKey != "" {
160+
cliui.Warnf(inv.Stderr, "CODER_MCP_CLAUDE_API_KEY is deprecated, use CLAUDE_API_KEY instead")
161+
claudeAPIKey = deprecatedCoderMCPClaudeAPIKey
162+
}
163+
if claudeAPIKey == "" && claudeUseBedrock != "1" {
164+
cliui.Warnf(inv.Stderr, "CLAUDE_API_KEY is not set.")
164165
}
166+
165167
if appStatusSlug != "" {
166168
configureClaudeEnv[envAppStatusSlug] = appStatusSlug
167169
}
@@ -280,6 +282,14 @@ func (r *RootCmd) mcpConfigureClaudeCode() *serpent.Command {
280282
Value: serpent.StringOf(&testBinaryName),
281283
Hidden: true,
282284
},
285+
{
286+
Name: "claude-code-use-bedrock",
287+
Description: "Use Amazon Bedrock.",
288+
Env: "CLAUDE_CODE_USE_BEDROCK",
289+
Flag: "claude-code-use-bedrock",
290+
Value: serpent.StringOf(&claudeUseBedrock),
291+
Hidden: true,
292+
},
283293
},
284294
}
285295
return cmd

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy