end
This commit is contained in:
@@ -530,8 +530,15 @@ export function openaiToKiroRequest(model, body, stream, credentials) {
|
||||
// (the ARN doesn't belong to the key's account). So for api_key, only send a
|
||||
// profileArn that was actually resolved for this connection — never the default.
|
||||
// OAuth/social keep the default fallback (their tokens accept it).
|
||||
// api_key / idc / external_idp carry an account-specific (or token-bound)
|
||||
// profile. The shared builder-id/social default ARN belongs to a different
|
||||
// account and triggers 403 "bearer token invalid", so never fall back to it —
|
||||
// send the resolved ARN, or an empty string so CodeWhisperer uses the token's
|
||||
// own default profile. Only OAuth/social keep the shared placeholder.
|
||||
const authMethod = credentials?.providerSpecificData?.authMethod;
|
||||
const profileArn = authMethod === "api_key"
|
||||
const accountBoundAuth =
|
||||
authMethod === "api_key" || authMethod === "idc" || authMethod === "external_idp";
|
||||
const profileArn = accountBoundAuth
|
||||
? (credentials?.providerSpecificData?.profileArn || "")
|
||||
: (credentials?.providerSpecificData?.profileArn || resolveDefaultProfileArn(authMethod));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user