fix: resolve Kiro provider model mapping typo and region fallback#651
Open
alaa-alghazouli wants to merge 1 commit into
Open
fix: resolve Kiro provider model mapping typo and region fallback#651alaa-alghazouli wants to merge 1 commit into
alaa-alghazouli wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR addresses two critical authorization and configuration issues within the Kiro provider:
Model Mapping Resolution Bug: Fixed a logical typo in
claude-kiro.jswherefinalModelincorrectly evaluated to the original model name instead of the mapped value. This ensures models likeclaude-haiku-4-5are correctly transformed toclaude-haiku-4.5before being sent to Amazon Q, preventing 403 authorization rejections.Regional Configuration Fallback: Fixed an issue where the region would incorrectly fallback to
us-east-1and ignore the user'sidcRegion. When users authenticate via AWS Builder ID in regions likeeu-central-1, the standardregionkey may be omitted in favor ofidcRegion. This update ensures the token's region is respected, and patcheskiro-oauth.jsto populate the standardregionfield moving forward.Changes Made
src/providers/claude/claude-kiro.js: FixedMODEL_MAPPINGtypo ingenerateContentandgenerateContentStream. ImplementedidcRegionfallback forthis.region. Added missingclaude-haiku-4-5-20251001alias.src/auth/kiro-oauth.js: Added theregionfield to the saved credentials when using AWS Builder ID tokens.These fixes resolve recurring
403 ForbiddenAPI errors and ensure smooth multi-region deployments.