Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/auth/kiro-oauth.js
Original file line number Diff line number Diff line change
Expand Up @@ -436,6 +436,7 @@ async function pollKiroBuilderIDToken(clientId, clientSecret, deviceCode, interv
authMethod: 'builder-id',
clientId,
clientSecret,
region: options.region || 'us-east-1',
idcRegion: options.region || 'us-east-1'
};

Expand Down
9 changes: 5 additions & 4 deletions src/providers/claude/claude-kiro.js
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@ const KIRO_MODELS = getProviderModels(MODEL_PROVIDER.KIRO_API);
// 完整的模型映射表
const FULL_MODEL_MAPPING = {
"claude-haiku-4-5":"claude-haiku-4.5",
"claude-haiku-4-5-20251001":"claude-haiku-4.5",
"claude-opus-4-8":"claude-opus-4.8",
"claude-opus-4-7":"claude-opus-4.7",
"claude-opus-4-6":"claude-opus-4.6",
Expand Down Expand Up @@ -722,8 +723,8 @@ async loadCredentials() {
applyCredential('idcRegion');

if (!this.region) {
logger.warn('[Kiro Auth] Region not found in credentials. Using default region us-east-1 for URLs.');
this.region = 'us-east-1';
this.region = this.idcRegion || 'us-east-1';
logger.warn(`[Kiro Auth] Region not found in credentials. Using idcRegion/default: ${this.region}`);
}

// idcRegion 用于 REFRESH_IDC_URL,如果未设置则使用 region
Expand Down Expand Up @@ -2124,7 +2125,7 @@ async saveCredentialsToFile(filePath, newData) {
this._markCredentialNeedRefresh('Token near expiry in generateContent');
}

const finalModel = MODEL_MAPPING[model] ? model : model;
const finalModel = MODEL_MAPPING[model] || model;
logger.info(`[Kiro] Calling generateContent with model: ${finalModel}`);

// Estimate input tokens before making the API call
Expand Down Expand Up @@ -2483,7 +2484,7 @@ async saveCredentialsToFile(filePath, newData) {
this._markCredentialNeedRefresh('Token near expiry in generateContentStream');
}

const finalModel = MODEL_MAPPING[model] ? model : model;
const finalModel = MODEL_MAPPING[model] || model;
logger.info(`[Kiro] Calling generateContentStream with model: ${finalModel} (real streaming)`);

let inputTokens = 0;
Expand Down