Skip to content

fix: resolve Kiro provider model mapping typo and region fallback#651

Open
alaa-alghazouli wants to merge 1 commit into
justlovemaki:mainfrom
alaa-alghazouli:fix-kiro-auth-region-and-model-mapping
Open

fix: resolve Kiro provider model mapping typo and region fallback#651
alaa-alghazouli wants to merge 1 commit into
justlovemaki:mainfrom
alaa-alghazouli:fix-kiro-auth-region-and-model-mapping

Conversation

@alaa-alghazouli

Copy link
Copy Markdown

Description

This PR addresses two critical authorization and configuration issues within the Kiro provider:

  1. Model Mapping Resolution Bug: Fixed a logical typo in claude-kiro.js where finalModel incorrectly evaluated to the original model name instead of the mapped value. This ensures models like claude-haiku-4-5 are correctly transformed to claude-haiku-4.5 before being sent to Amazon Q, preventing 403 authorization rejections.

  2. Regional Configuration Fallback: Fixed an issue where the region would incorrectly fallback to us-east-1 and ignore the user's idcRegion. When users authenticate via AWS Builder ID in regions like eu-central-1, the standard region key may be omitted in favor of idcRegion. This update ensures the token's region is respected, and patches kiro-oauth.js to populate the standard region field moving forward.

Changes Made

  • src/providers/claude/claude-kiro.js: Fixed MODEL_MAPPING typo in generateContent and generateContentStream. Implemented idcRegion fallback for this.region. Added missing claude-haiku-4-5-20251001 alias.
  • src/auth/kiro-oauth.js: Added the region field to the saved credentials when using AWS Builder ID tokens.

These fixes resolve recurring 403 Forbidden API errors and ensure smooth multi-region deployments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant