diff options
| author | Adam <[email protected]> | 2026-01-12 18:42:19 -0600 |
|---|---|---|
| committer | GitHub <[email protected]> | 2026-01-12 18:42:19 -0600 |
| commit | 05019dae7607451aab33c593875438f0cc88b199 (patch) | |
| tree | 00d4d74b9c73f5de303d5f2d2efce3a85807a4f5 | |
| parent | bf37a88f7f86dc01341a711e9a49e914f9e066a4 (diff) | |
| download | opencode-05019dae7607451aab33c593875438f0cc88b199.tar.gz opencode-05019dae7607451aab33c593875438f0cc88b199.zip | |
fix(bedrock): use reasoningConfig for Anthropic models on Bedrock (#8092)
| -rw-r--r-- | packages/opencode/src/provider/transform.ts | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/packages/opencode/src/provider/transform.ts b/packages/opencode/src/provider/transform.ts index 38b2c9aa1..fe2484785 100644 --- a/packages/opencode/src/provider/transform.ts +++ b/packages/opencode/src/provider/transform.ts @@ -364,6 +364,25 @@ export namespace ProviderTransform { case "@ai-sdk/amazon-bedrock": // https://v5.ai-sdk.dev/providers/ai-sdk-providers/amazon-bedrock + // For Anthropic models on Bedrock, use reasoningConfig with budgetTokens + if (model.api.id.includes("anthropic")) { + return { + high: { + reasoningConfig: { + type: "enabled", + budgetTokens: 16000, + }, + }, + max: { + reasoningConfig: { + type: "enabled", + budgetTokens: 31999, + }, + }, + } + } + + // For Amazon Nova models, use reasoningConfig with maxReasoningEffort return Object.fromEntries( WIDELY_SUPPORTED_EFFORTS.map((effort) => [ effort, |
