fix(providers): used neutral bedrock profile metadata

Stopped synthetic Bedrock inference profile ARN models from inheriting Claude Opus reasoning and context metadata.

Fixes #3004
This commit is contained in:
roboomp
2026-06-18 21:40:08 +00:00
parent b67d07e829
commit 12f608e0f4
2 changed files with 15 additions and 7 deletions
@@ -214,17 +214,21 @@ function resolveBedrockInferenceProfileModelId(
return undefined;
}
const providerModels = availableModels.filter(model => model.provider.toLowerCase() === AMAZON_BEDROCK_PROVIDER);
const defaultModelId = DEFAULT_MODEL_PER_PROVIDER[AMAZON_BEDROCK_PROVIDER];
const template =
providerModels.find(model => model.id === defaultModelId) ?? pickDefaultAvailableModel(providerModels);
const template = availableModels.find(model => model.provider.toLowerCase() === AMAZON_BEDROCK_PROVIDER);
if (!template) return undefined;
return {
...template,
return buildModel({
id: requestedId,
name: "Bedrock inference profile",
};
api: "bedrock-converse-stream",
provider: AMAZON_BEDROCK_PROVIDER,
baseUrl: template.baseUrl,
reasoning: false,
input: ["text"],
cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 },
contextWindow: null,
maxTokens: null,
});
}
function resolveBedrockInferenceProfileReference(
@@ -918,6 +918,10 @@ describe("resolveCliModel", () => {
expect(baseResult.model?.api).toBe("bedrock-converse-stream");
expect(baseResult.model?.id).toBe(profileArn);
expect(baseResult.model?.name).toBe("Bedrock inference profile");
expect(baseResult.model?.reasoning).toBe(false);
expect(baseResult.model?.thinking).toBeUndefined();
expect(baseResult.model?.contextWindow).toBeNull();
expect(baseResult.model?.maxTokens).toBeNull();
expect(baseResult.thinkingLevel).toBeUndefined();
expect(offResult.error).toBeUndefined();
expect(offResult.model?.id).toBe(profileArn);