Repository navigation
Support reasoning configuration for AWS Bedrock provider #3428
Description
Summary
OpenCode currently supports extended thinking/reasoning for Anthropic Claude models via the thinking format, but AWS Bedrock providers (e.g., amazon-bedrock/anthropic.*) lack equivalent configuration support.
Problem
When using AWS Bedrock-hosted Claude models (like amazon-bedrock/anthropic.claude-3-7-sonnet-20250219-v1:0), there is no way to enable extended thinking/reasoning, even though:
- The underlying Claude model supports reasoning
- AWS Bedrock API supports the
reasoningConfigparameter - OpenCode successfully uses Bedrock for other model capabilities
This creates a capability gap where Bedrock users cannot leverage extended thinking—a feature available to direct Anthropic API users.
Current Implementation
Anthropic direct API models use the thinking format:
// From the config schema (anthropic/claude-*-thinking)
interface ThinkingConfig {
type: 'enabled'
budget_tokens: number
}AWS Bedrock API supports reasoningConfig:
interface BedrockReasoningConfig {
traceEnabled?: boolean
}Proposed Solution
Add support for Bedrock reasoning configuration in the OpenCode config schema and model invocation logic:
-
Config schema - Add
reasoningoption to Bedrock model definitions:{ "provider": { "amazon-bedrock": { "models": { "anthropic.claude-3-7-sonnet-20250219-v1:0": { "reasoning": true } } } } } -
Model invocation - Pass
reasoningConfigwhen creating Bedrock client requests:const requestParams = { // ... other params reasoningConfig: { traceEnabled: true } }
-
Agent config - Allow enabling reasoning per-agent if needed:
{ "agent": { "build": { "model": "amazon-bedrock/anthropic.claude-3-7-sonnet-20250219-v1:0", "reasoning": true } } }
Impact
- Scope: New feature, non-breaking change
- Files affected:
- Config schema validation
- Bedrock provider implementation
- Model invocation logic
- Use cases: Users on AWS/using Bedrock can now leverage extended thinking for complex tasks
Related
- Existing thinking support for Anthropic direct: Uses
thinkingformat - AWS Bedrock reasoning docs: https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html
- OpenCode schema:
config.jsonschema includes modelreasoning: booleanflag (read-only metadata)
Questions for Maintainers
- Would this be considered "Support for new providers" per the contributing guidelines?
- Should reasoning be agent-level configuration or model-level?
- Are there other Bedrock-specific configurations that should be exposed?
Activity
github-actions commentedon Oct 24, 2025
This issue might be a duplicate of existing issues. Please check:
Feel free to ignore if none of these address your specific case.
rekram1-node commentedon Oct 24, 2025
@kv0409 just noticed a bug with bedrock reasoning, it will be fixed in next release.
To read more about bedrock reasoning see here: https://ai-sdk.dev/providers/ai-sdk-providers/amazon-bedrock
Here is what it looks like in opencode.json:
rekram1-node commentedon Oct 24, 2025
fixed here, not released yet: 5fec5ff
rekram1-node commentedon Oct 25, 2025
Just released so this should work on 0.15.17, if not lmk
JuniorJPDJ commentedon Mar 10, 2026
Looks like the provided config didn't work for me.
I tried that:
Models work but there are no thinking blocks at all.