Support reasoning configuration for AWS Bedrock provider #2274

Closed
opened 2026-02-16 17:34:56 -05:00 by yindo · 4 comments
Owner

Originally created by @kv0409 on GitHub (Oct 24, 2025).

Originally assigned to: @rekram1-node on GitHub.

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:

  1. The underlying Claude model supports reasoning
  2. AWS Bedrock API supports the reasoningConfig parameter
  3. 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:

  1. Config schema - Add reasoning option to Bedrock model definitions:

    {
      "provider": {
        "amazon-bedrock": {
          "models": {
            "anthropic.claude-3-7-sonnet-20250219-v1:0": {
              "reasoning": true
            }
          }
        }
      }
    }
    
  2. Model invocation - Pass reasoningConfig when creating Bedrock client requests:

    const requestParams = {
      // ... other params
      reasoningConfig: { traceEnabled: true }
    }
    
  3. 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

Questions for Maintainers

  1. Would this be considered "Support for new providers" per the contributing guidelines?
  2. Should reasoning be agent-level configuration or model-level?
  3. Are there other Bedrock-specific configurations that should be exposed?
Originally created by @kv0409 on GitHub (Oct 24, 2025). Originally assigned to: @rekram1-node on GitHub. ## 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: 1. The underlying Claude model supports reasoning 2. AWS Bedrock API supports the `reasoningConfig` parameter 3. 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: ```typescript // From the config schema (anthropic/claude-*-thinking) interface ThinkingConfig { type: 'enabled' budget_tokens: number } ``` AWS Bedrock API supports `reasoningConfig`: ```typescript interface BedrockReasoningConfig { traceEnabled?: boolean } ``` ## Proposed Solution Add support for Bedrock reasoning configuration in the OpenCode config schema and model invocation logic: 1. **Config schema** - Add `reasoning` option to Bedrock model definitions: ```json { "provider": { "amazon-bedrock": { "models": { "anthropic.claude-3-7-sonnet-20250219-v1:0": { "reasoning": true } } } } } ``` 2. **Model invocation** - Pass `reasoningConfig` when creating Bedrock client requests: ```typescript const requestParams = { // ... other params reasoningConfig: { traceEnabled: true } } ``` 3. **Agent config** - Allow enabling reasoning per-agent if needed: ```json { "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 `thinking` format - AWS Bedrock reasoning docs: https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html - OpenCode schema: `config.json` schema includes model `reasoning: boolean` flag (read-only metadata) ## Questions for Maintainers 1. Would this be considered "Support for new providers" per the contributing guidelines? 2. Should reasoning be agent-level configuration or model-level? 3. Are there other Bedrock-specific configurations that should be exposed?
yindo added the bug label 2026-02-16 17:34:56 -05:00
yindo closed this issue 2026-02-16 17:34:56 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Oct 24, 2025):

This issue might be a duplicate of existing issues. Please check:

  • #1106: claude sonnet "thinking"? - asks about how to enable thinking with Claude Sonnet, similar core need for reasoning support
  • #2984: how to : 1. deepseek do a "deep think" like ultrathink in claude code 2. use deepseek v3.2-exp? - requests similar thinking functionality for different models
  • #450: Support for reasoning_effort parameter in UI - requests reasoning configuration support across multiple models

Feel free to ignore if none of these address your specific case.

@github-actions[bot] commented on GitHub (Oct 24, 2025): This issue might be a duplicate of existing issues. Please check: - #1106: claude sonnet "thinking"? - asks about how to enable thinking with Claude Sonnet, similar core need for reasoning support - #2984: how to : 1. deepseek do a "deep think" like ultrathink in claude code 2. use deepseek v3.2-exp? - requests similar thinking functionality for different models - #450: Support for reasoning_effort parameter in UI - requests reasoning configuration support across multiple models Feel free to ignore if none of these address your specific case.
Author
Owner

@rekram1-node commented on GitHub (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:

{
  "$schema": "https://opencode.ai/config.json",
  "provider": {
    "amazon-bedrock": {
      "models": {
        "anthropic.claude-3-7-sonnet-20250219-v1:0": {
          "options": {
            "reasoningConfig": { "type": "enabled", "budgetTokens": 1024 }
          }
        }
      }
    }
  }
}
@rekram1-node commented on GitHub (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: ``` { "$schema": "https://opencode.ai/config.json", "provider": { "amazon-bedrock": { "models": { "anthropic.claude-3-7-sonnet-20250219-v1:0": { "options": { "reasoningConfig": { "type": "enabled", "budgetTokens": 1024 } } } } } } } ```
Author
Owner

@rekram1-node commented on GitHub (Oct 24, 2025):

fixed here, not released yet: https://github.com/sst/opencode/commit/5fec5ff4249e820865e8b9c2b3bb92cdc3504a1e

@rekram1-node commented on GitHub (Oct 24, 2025): fixed here, not released yet: https://github.com/sst/opencode/commit/5fec5ff4249e820865e8b9c2b3bb92cdc3504a1e
Author
Owner

@rekram1-node commented on GitHub (Oct 25, 2025):

Just released so this should work on 0.15.17, if not lmk

@rekram1-node commented on GitHub (Oct 25, 2025): Just released so this should work on 0.15.17, if not lmk
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#2274