fix: load credential error for bedrock gateway (#667)

Sometimes leads to long initialization and error if
AWS_BEARER_TOKEN_BEDROCK:
Could not load credentials from any providers
This commit is contained in:
Aleksandr Suhinin
2026-05-16 09:11:04 +03:00
committed by GitHub
parent 9258652169
commit 8d76be356a
2 changed files with 2 additions and 2 deletions

View File

@@ -2164,7 +2164,7 @@ function createEnvForGateway(request?: GatewayAuthRequest) {
if (request.methodId === "gateway-bedrock") {
return {
CLAUDE_CODE_USE_BEDROCK: "1",
AWS_BEARER_TOKEN_BEDROCK: "",
AWS_BEARER_TOKEN_BEDROCK: " ", // Must be non-empty to bypass pass configuration check
ANTHROPIC_BEDROCK_BASE_URL: request._meta.gateway.baseUrl,
ANTHROPIC_CUSTOM_HEADERS: customHeaders,
};

View File

@@ -154,7 +154,7 @@ describe("authorization", () => {
options: expect.objectContaining({
env: expect.objectContaining({
CLAUDE_CODE_USE_BEDROCK: "1",
AWS_BEARER_TOKEN_BEDROCK: "",
AWS_BEARER_TOKEN_BEDROCK: " ",
ANTHROPIC_BEDROCK_BASE_URL: "https://gateway.example",
ANTHROPIC_CUSTOM_HEADERS: "custom-header: test",
}),