fix(amazon-bedrock): pass model.baseUrl as endpoint to BedrockRuntimeClient (#3402)

BedrockRuntimeClient was constructed without the endpoint option,
causing model.baseUrl to be silently ignored. This meant custom
Bedrock endpoints (VPC endpoints, proxy setups, custom routing)
were never used — requests always went to the default regional
endpoint.

Pass model.baseUrl as the endpoint config when set. When not set
(the default), the SDK falls back to the standard regional endpoint
constructed from the region config, preserving existing behavior.

Fixes openclaw/openclaw#47899
This commit is contained in:
wirjo
2026-04-19 16:47:10 +10:00
committed by GitHub
parent c6a493c50b
commit 5a889ef58b

View File

@@ -115,6 +115,12 @@ export const streamBedrock: StreamFunction<"bedrock-converse-stream", BedrockOpt
profile: options.profile,
};
// Pass custom endpoint when the model has a non-default baseUrl.
// This enables VPC endpoints, proxy setups, and custom routing.
if (model.baseUrl) {
config.endpoint = model.baseUrl;
}
// Resolve bearer token for Bedrock API key auth.
const bearerToken = options.bearerToken || process.env.AWS_BEARER_TOKEN_BEDROCK || undefined;
const useBearerToken = bearerToken !== undefined && process.env.AWS_BEDROCK_SKIP_AUTH !== "1";